The MU forums have moved to WordPress.org

Need another pair of eyes on this virtual host entry (7 posts)

  1. sillybean
    Member
    Posted 16 years ago #

    I'm at the end of my second evening spent trying to get WPMU installed, and I just can't make it work. I'm setting this up locally on my laptop running MAMP. Here's my virtual host entry:

    <VirtualHost *>
    ServerName wp.dev
    ServerAlias *.wp.dev
    DocumentRoot /path/to/wp
    <Directory />
    Options FollowSymLinks
    AllowOverride FileInfo Options
    </Directory>
    </VirtualHost>

    When I load wp.dev in the browser, I'm immediately redirected to http://www.wp.dev for no reason that I can find. I can install WPMU just fine, but when I log in at http://www.wp.dev/wp-login.php (the URL linked from the install script), the login page loads without its stylesheet (first clue that something's wrong) and on login it redirects me to http://wp.dev/wp-login.php, which Firefox claims it can't load.

    What am I doing wrong here? How do I get rid of that dratted http://www.?

  2. MrBrian
    Member
    Posted 16 years ago #

    the virtual host entry looks fine perfectly. Check wp_site table in your database and make sure you didn't put the www. in the domain by accident.

  3. sillybean
    Member
    Posted 16 years ago #

    Nope, the domain is wp.dev and the path is /.

  4. sillybean
    Member
    Posted 16 years ago #

    AH HA! Got it: my /etc/hosts file entry had http://www.wp.dev (no idea why I did it that way). Changed it to wp.dev and all is well.

  5. pumpkinpatch
    Member
    Posted 16 years ago #

    What does your hosts file look like. There is a slight chance that here might be only one valid entry, and it might have www in front of it- http://www.wp.dev
    I am not sure about this, but on vhosts, don't you need to set Apache to listen to a particular port and use it: <VirtualHost *:80>?

  6. lunabyte
    Member
    Posted 16 years ago #

    Just remember your hosts file doesn't do wildcards.

    You can, however, put all your stuff on a single line:

    127.0.0.1 wp.dev test.wp.dev test2.wp.dev

    so on and so forth.

    Of course, you can use more than one line when necessary too.

  7. lunabyte
    Member
    Posted 16 years ago #

    As a note, here's an example of one of my vhosts.
    I didn't go MAMP, I just added on mysql and upgraded apache and php.

    <VirtualHost *>
    DocumentRoot /sites/sitename
    ServerName whatever.tld
    ServerAlias *.whatever.tld
    <Directory /sites/sitename>
    Options -Indexes FollowSymLinks Multiviews
    AllowOverride FileInfo Options
    </Directory>
    ErrorLog /sites/logs/sitename/error_log
    TransferLog /sites/logs/sitename/access_log
    </VirtualHost>

    As a note, I have digging though my conf file, and doing all that jazz. I just stuck an include statement in the virtual host area that points to a directory and includes *.conf from it. Much easier to manage, at least for me. I also break out logs per site, as it's much easier to track errors when you bounce back and forth between sites.

    Of course this is for local testing, and not production. If you were in production, you would most certainly want to probably have vhosts for 80 and 443, etc.

About this Topic

  • Started 16 years ago by sillybean
  • Latest reply from lunabyte