WordPress.org

Ready to get started?Download WordPress

Forums

Local Multisite httpd.conf question (2 posts)

  1. epiphanius
    Member
    Posted 2 years ago #

    Hello:

    I'm trying to get multisite working, using the subdomains option; I spent days with xampp, I'm now trying wamp.

    I would like to have my main domain, for which I'm using: localhost.localdomain. I'll also have a test site for a second domain.

    Most tutorials suggest that I should start with two virtual host entries, something like:

    <VirtualHost 127.0.0.1>
    DocumentRoot "C:/wamp/www"
    ServerName localhost
    </VirtualHost>

    <VirtualHost 127.0.0.1>
    DocumentRoot "C:/wamp/www/urbangiraffe.com"
    ServerName local.urbangiraffe.com
    ErrorLog logs/urbangiraffe_error.log
    </VirtualHost>

    What I don't understand is: is the first entry supposed to point to my main blog? Or will it just be a not very functional apache default page, and the second entry is supposed to be for the main WP site. In that case, the second entry should look like:

    <VirtualHost 127.0.0.1>
    DocumentRoot "C:/wamp/www/localhost.localdomain"
    ServerName localhost.localdomain
    ErrorLog logs/localhost.localdomain.log
    </VirtualHost>

    If the above is correct, then do I need a directory called: C:\wamp\www\localhost.localdomain\
    into which I put the wordpress folder? Will this resolve to: localhost.localdomain?

    Thanks for any replies.

  2. spiff06
    Member
    Posted 2 years ago #

    DocumentRoot can point anywhere in your system. Filesystem name and base URL don't need to match either, you're free to organize things as you like.

    I'm not very conversant with WAMP, but I'm curious as to what didn't work with XAMPP. I have it working perfectly on my system, but the trick is to create virtual hosts in the /apache/conf/extra/httpd.vhosts, not in the general httpd.conf settings file.

    This is the structure I have in mine:

    <VirtualHost 192.168.1.3:80>
    	DocumentRoot "C:\Users\Me\Documents\Project1\website"
    	ServerName project1.tld
    	ServerAdmin admin@project1.tld
    	<Directory "C:\Users\Me\Documents\Project1\website">
    		Options Indexes FollowSymLinks
    		AllowOverride All
    		Order allow,deny
    		Allow from all
    	</Directory>
    	ErrorLog logs/project1.tld-error-log
    	CustomLog logs/project1.tld-log common
    </VirtualHost>

    Then you need to edit your HOSTS file (e.g. C:\Windows\System32\drivers\etc\HOSTS) to link your local IP to the newly created local domain. In my case, I'd add:

    192.168.1.3		project1.tld

    Only make configuration file changes when Apache is shut down.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags