Forum Moderators: phranque
I had been hosting my own site with Apache for my students. Then I heard about virtual hosting so I bought other domains and sent them to my static IP.
I tried using the Server Setup with Fedora but I was unable to get the virtual hosts to associate with different folders.
Now nothing works. I tried to get back the old httpd.conf.bak but it doesn't work either. What should I do? Re-install apache? I'm a beginner to the extent that I know simple linux commands and was hosting a very simple site for history students. I got in trouble when I tried to have more than one website associated with the server.
All the examples I've seen use virtual hosting for stuff like "example.host.com" and "example2.host.com". Can virtual hosts be used with totally different sites like "Ilovehistory.com" and "Ilovelinux.com"? I wonder if those sites are real...
Thanks for any help!
David
Welcome to WebmasterWorld!
See the Apache documentation, Name-based virtual hosts [httpd.apache.org] for some info to get you atarted.
And kind of late for this, but...
always make backups :)
Jim
THis is the code:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com *.example.com
DocumentRoot "/var/www/html"
</VirtualHost>
NameVirtualHost 192.168.2.88:80
<VirtualHost 192.168.2.88:80>
ServerName www.quux_foo.com
ServerAlias quux_foo.com *.quux_foo.com
DocumentRoot /www/htmlccc
</VirtualHost>
quux_foo.com comes up exactly as example.com. Oh boy.
I think it is a binding problem but I don't know what that means really.
Thanks all.
[edited by: jdMorgan at 1:51 pm (utc) on June 8, 2005]
[edit reason] Examplified. [/edit]
You need only one NameVirtualHost statement at the beginning. Delete the second one seen later on. Also, just make the both VirtualHost lines look the same: if the first one seems to work OK, then the second one should look like the same "<VirtualHost *:80>"
Regarads,
R.
I'm wondering, at what point does virtual hosting within the httpd.conf file becomes cumbersome? After how many sites do you need the mod_rewrite (something which I know nothing about now).
But of course I love learning about this stuff.
Virtual hosting is pretty much the standard now within the hosting industry, the number of sites you can host will all depend on your hardware, and more importaintly the speed that you connect to the web.
Mack.