Forum Moderators: phranque
You need to modify your httpd.conf file to include virtual hosts.
Example:
NameVirtualHost *:80<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /www/example
ServerAdmin webmaster@example.com
</VirtualHost>
Read more here: [httpd.apache.org...]
J.
What do you think?
#<VirtualHost *:80>
#ServerAlias butterflyworld.com.au *.butterflyworld.com.au
#DocumentRoot /Program Files/Apache Group/Apache2/htdocs/butterflies/
#</VirtualHost>
#<VirtualHost *:80>
#ServerName www.wisewombat.com.au
#DocumentRoot /Program Files/Apache Group/Apache2/htdocs/OurShop/
#</VirtualHost>
ServerName www.example.com
ServerAlias example.com, *.example.com
Then apachectl restart (restart Apache) and see what happens!
Best of luck,
J.
#NameVirtualHost Wisewombat.com.au
<VirtualHost wisewombat.com.au:80>
# ServerName www.wisewombat.com.au
# DocumentRoot /Program Files/Apache Group/Apache2/htdocs/OurShop/
# ServerAlias *.butterflyworld.com.au
# DocumentRoot /Program Files/Apache Group/Apache2/htdocs/butterflies/
</VirtualHost>
But this still doesnt change the way a visitor accesses the websites.
Do you require some kind of redirect in the apache index for it to work? Im still lost?
Any other ideas thanks.
# Apache
# will
# commpletely
# ignore
# this
# stuff
but
will
read
this
change
#NameVirtualHost Wisewombat.com.au
<VirtualHost wisewombat.com.au:80>
# ServerName www.wisewombat.com.au
# DocumentRoot /Program Files/Apache Group/Apache2/htdocs/OurShop/
# ServerAlias *.butterflyworld.com.au
# DocumentRoot /Program Files/Apache Group/Apache2/htdocs/butterflies/
</VirtualHost>
to
NameVirtualHost *:80<VirtualHost *:80>
ServerName www.wisewombat.com.au
ServerAlias *.wisewombat.com.au
DocumentRoot /Program Files/Apache Group/Apache2/htdocs/OurShop/
</VirtualHost><VirtualHost *:80>
ServerName www.butterflyworld.com.au
ServerAlias *.butterflyworld.com.au
DocumentRoot /Program Files/Apache Group/Apache2/htdocs/butterflies/
</VirtualHost>
and it should work as-is :-)
J.
I looked over your httpd.conf and I think I found the problems - you need to comment out the ServerName on line 213 because it is overriding the VirtualHosts directives, and also the DocumentRoot on line 229 for the same reason.
The *:80 is intentional in what I've written above, pasting it straight in *should* work, providing those directories are correct, and everything conflicting with/overriding it is commented out.
Keep me posted :-)
Warning: DocumentRoot [/htdocs/OurShop/] does not exist
Warning: DocumentRoot [/htdocs/butterflies/] does not exist
Apache.exe: Could not determine the server's fully qualified domain name, using XXX.XXX.XXX.XXX for
ServerName
Warning: DocumentRoot [/htdocs/OurShop/] does not exist
Warning: DocumentRoot [/htdocs/butterflies/] does not exist
Apache.exe: Could not determine the server's fully qualified domain name, using XXX.XXX.XXX.XXX for
ServerName.
XXX.XXX.XXX.XXX being my router designated local area network IP Address.
I then reset line 213 TO ServerName 203.56.244.186:80 being my static IP and my configure to.
NameVirtualHost 203.56.244.186
<VirtualHost 203.56.244.186:80>
ServerName www.wisewombat.com.au
DocumentRoot /htdocs/OurShop/
</VIRTUALHOST>
<VIRTUALHOST>
ServerAlias butterflyworld.com.au *.butterflyworld.com.au
DocumentRoot /htdocs/butterflies/
</VirtualHost>.
The server runs and starts but it still doesnt direction the guests to the desired websites directorys.
Any other ideas At least every thing seems to run now.
And thanks for taking the time to have alook for me.
Warning: DocumentRoot [/htdocs/OurShop/] does not exist
Warning: DocumentRoot [/htdocs/butterflies/] does not exist
You must use an ABSOLUTE directory path, not a relative one.
Use the lines I wrote above in your httpd.conf, the lines you wrote WON'T WORK.
Comment out the lines I suggested, otherwise it will override the settings.
This:
NameVirtualHost *:80<VirtualHost *:80>
ServerName www.wisewombat.com.au
ServerAlias *.wisewombat.com.au
DocumentRoot /Program Files/Apache Group/Apache2/htdocs/OurShop/
</VirtualHost><VirtualHost *:80>
ServerName www.butterflyworld.com.au
ServerAlias *.butterflyworld.com.au
DocumentRoot /Program Files/Apache Group/Apache2/htdocs/butterflies/
</VirtualHost>
should work.
This:
NameVirtualHost 203.56.244.186
<VirtualHost 203.56.244.186:80>
ServerName www.wisewombat.com.au
DocumentRoot /htdocs/OurShop/
</VIRTUALHOST>
<VIRTUALHOST>
ServerAlias butterflyworld.com.au *.butterflyworld.com.au
DocumentRoot /htdocs/butterflies/
</VirtualHost>
Won't ever work, it's just wrong.