You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Blomstrom <da...@yahoo.com> on 2006/08/03 05:15:13 UTC

Re: [users@httpd] Rerouting Localhost (to XAMPP home page)


Rob Wilkerson <r....@gmail.com> wrote: You should be able to do this one of two ways:

1.  Change your DocumentRoot directory and the associated 
block to /Applications/xampp/htdocs
2.  Uncomment the NameVirtualHosts directive and create a 
*:80> block that has a DocumentRoot that point to
/Applications/xampp/htdocs

I discovered that DocumentRoot is already set up as you susggested...

DocumentRoot "/Applications/xampp/htdocs"

So I tried the second option, adding this to my httpd.conf file:

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webguy@mysite.com
    DocumentRoot /Applications/xampp/htdocs
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

I then restarted my computer, but nothing changed; http://localhost/ still displays the standard Apache greeting. I was concerned that I might have ruined my httpd.conf file because I'm just learning how to work with it on a Mac, and I've moved, deleted and modified it several times. But the fact that http://localhost indicates it's working, right?

Do I have to substitute something meaningful for the server name? On my PC, my virtual hosts look like this:

<VirtualHost *:80>
ServerName px
ServerAlias px *.px
DocumentRoot C:\sistes\px
</VirtualHost>

So what would be the server name for the example I'm working on now - "etc."?

Thanks.


 			
---------------------------------
See the all-new, redesigned Yahoo.com.  Check it out.