WordPress.org

Ready to get started?Download WordPress

Forums

problem with converting 2 WP blogs to use apache virtual hosting (3 posts)

  1. timblack
    Member
    Posted 5 years ago #

    I installed 2 WP 2.6.1 blogs, each with its own db/user/pass/folder. Initially I placed the folders off of my web document root like so:
    /var/www/html/blog1
    /var/www/html/blog2
    I web browsed to these folders and ran the install scripts in their separate locations and the blogs seemed to be installed and functional.

    Then I set up apache for virtual hosting and tested that it was working by placing simple index.html files in the separate Document root folders. I have problems, however, when I set the Document root for each virtual host to the WP folder where the core .php files reside. What happens when I go to one of the VirtualHost ServerName URLs is that apache does not display the blog, but instead redirects me to http://www.servy.com. (My hostname is "servy" - I think this is related)

    I have tested the virtual hosting aspect of my system, so I believe this to be a WP-specific problem. Please let me know if you have any suggestions. More info at http://forums.fedoraforum.org/showthread.php?p=1104996&posted=1#post1104996

    If I decide to just start over and reinstall WP, can I simply replace the WP root folders and then re-use the same database I've already set up?

    Thanks!

  2. timblack
    Member
    Posted 5 years ago #

    I also tried updating my wp-config.php files to include
    define('WP_SITEURL', 'http://<My Site URL>/<blog path relative to web root>');
    This didn't help. Did I use this construct correctly?
    Any other suggestions?

  3. timblack
    Member
    Posted 5 years ago #

    I did manage to solve the problem by reinstalling both instances of the wordpress blog folder. Just had to clear out the tables in the mysql databases corresponding to each wordpress blog, and then run the install php script again. After that, each of my virtual hosts redirects to the correct blog. :-)

    I believe that my critical error was moving the blog folders to new locations when I set up the VirtualHosts. It turns out that the wordpress php code needs to know where it is! If you know a good reason for this, please comment.

    There is a procedure for informing the php application about its new location:

    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Within_Your_Site
    http://codex.wordpress.org/Changing_The_Site_URL

    In the end, I just opted for the reinstall.

Topic Closed

This topic has been closed to new replies.

About this Topic