• I have setup a Debian server with Apache & PHP, and installed WordPress. I’ve setup /var/www/wordpress as a virtual host, alongside another one with the original website. The original is working fine.

    When I first installed WordPress it was as well, and I set the theme to Twenty Ten and imported the size from a file exported from a test site at wordpress.com.

    Not sure quite when it fell apart, but now when I try to load it using the virtual host (wordpress.micro) or it’s IP number (192.168.1.x/wordpress) it’s evidently not picking up the theme – I get a very bare screen, though it does have the correct heading & menu so the database isn’t a problem.

    Apache error logging doesn’t help, I’ve tried turning on the WordPress error logging and that isn’t working either which is probably a pointer to what the problem is – I suspect for some reason it’s not picking up wordpress/wp-config.php or rather not picking it up completely, as it can access the database…

    Struggling with where to go as it’s a nest of this goes to that goes to somewhere else that I’ve never had to look at before. With my day job I simply put in display statements that let me trace what is happening via screen output.

    This is especially frustrating as I did the same setup on another PC (not here now) a few weeks back with no problems.

Viewing 3 replies - 1 through 3 (of 3 total)
  • your DB is ok

    your problem is that WP expects to be at localhost/wordpress
    when you access it by its VHost DNS or by its IP it breaks styles and JavaScripts, try accessing it by localhost and you’ll see

    then, you must decide how would you prefer to access it, and if different from localhost (which should be the current one working) then you should read http://codex.wordpress.org/Changing_The_Site_URL

    if your solution isn’t there, then I recommend you to consider investigating the following (which would not go for the VHost unless you also use a subdirectory there)

    The following goes in the wp-config.php, near the end of it
    and intends to make the site available either by its IP (either IP it might be reached at) as well as localhost, or any DNS/VirtualHost, as long as it resides under the same directory (root or subdirectory) for all of them

    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress');
    define('WP_HOME', WP_SITEURL);

    PS: mind your .htaccess as well

    PS: mind your .htaccess as well

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with virtual host site in Apache’ is closed to new replies.