Hi!
I'm setting up a second virtual host to be able to preview my php-pages.
I've added two v-hosts: "G-Sun 2009" and "flyt"
The apache service is starting but when I try to go to the two v-hosts I'm only ending up in my default httpdoc folder (C:\Webserver).
What's wrong?
httpd-vhosts.conf:
Code:
<Directory "C:\Documents and Settings\Geir\My Documents\Web-design">
Order Deny,Allow
Allow from all
</Directory>
#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
DocumentRoot "C:\Webserver"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\Documents and Settings\Geir\My Documents\Web-design\G-Sun 2009"
ServerName G-Sun2009
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\Documents and Settings\Geir\My Documents\Web-design\Flyt"
ServerName flyt
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
</VirtualHost>
You can use the same IP for all the virtual hosts. You'll need to use the lan IP assigned by DHCP or statically set manually. So your hosts file would read something like:
Remember that you'll have to restart apache every time you edit the config file in order to see any changes. Also on Windoze systems you sometimes have to log out and back in (or reboot) to get the changes in your hosts file to work properly.
Is it necessary that all my virtual host are in subdirectories of localhost (as you typed it above, C:Webserver/ ..)?
Not really but it is much easier to maintain if the webroot is pointed to a folder and all virtual hosts are pointed to sub folders. Alternatively, you can make a localhost folder just like the other two and point the localhost virtual host to that folder.
C:/Documents and Settings/Geir/My Documents/Web-design/
for your localhost so the ServerPath will direct correctly? Is there a particular reason you want localhost directed to a completely different location from all the others?
for your localhost so the ServerPath will direct correctly? Is there a particular reason you want localhost directed to a completely different location from all the others?
Well c:webserver has been a testserver (Dreamweaver)
and C:/Documents and Settings/Geir/My Documents/Web-design/
are the location for my projects.
If I get these virtual hosts up and running, I don't really need the testserver anymore. But until then I'd like to keep it.
..unless changing is necessary.
Bookmarks