jadoiron Posted May 14, 2008 Share Posted May 14, 2008 Hi there everyone. I'm in the process of configuring Apache 2.0 for hosting 3 websites on a single server/ip. I have the conf file set (i think) correctly and when I type "http://example1.com" or "http://example2.net" into my browser, everything works great! But how can I configure it so that computers that AREN'T my server (ie my pc at work or a friend's pc down the street) can visit my 3 websites? Right now if I'm at work and I type "http://###.###.###.###" (i didn't give my domain registrar my ip address yet), I only see the default Apache index.html page. I can't get to my other sites. "http://###.###.###.###/example2.net" won't work either. How can I make www.example1.com or www.example2.net visible to the outside world?? Is it even possible? Thanks a mil!!!! Quote Link to comment https://forums.phpfreaks.com/topic/105649-virtual-hosts-config/ Share on other sites More sharing options...
trq Posted May 15, 2008 Share Posted May 15, 2008 i didn't give my domain registrar my ip address yet Unless you configure ip based virtual hosting you will need to wait untill you do. Quote Link to comment https://forums.phpfreaks.com/topic/105649-virtual-hosts-config/#findComment-542005 Share on other sites More sharing options...
jadoiron Posted May 15, 2008 Author Share Posted May 15, 2008 So all I have to do is update my nameservers accordingly? And my server will be able to distinguish between example1.com and example2.com on one IP? Sounds... intelligent...?? Quote Link to comment https://forums.phpfreaks.com/topic/105649-virtual-hosts-config/#findComment-542035 Share on other sites More sharing options...
trq Posted May 15, 2008 Share Posted May 15, 2008 Providing your vhosts are configured correctly (name based), yes. Quote Link to comment https://forums.phpfreaks.com/topic/105649-virtual-hosts-config/#findComment-542091 Share on other sites More sharing options...
jadoiron Posted May 15, 2008 Author Share Posted May 15, 2008 They function correctly locally (without "www"). Quote Link to comment https://forums.phpfreaks.com/topic/105649-virtual-hosts-config/#findComment-542096 Share on other sites More sharing options...
jadoiron Posted May 15, 2008 Author Share Posted May 15, 2008 Now it's really odd. When I type in www.example.com or example.com from HOME, it will go to my server here at the office, but if i type in www.example.com or example.com from the office, it times out and I get the "Problem loading page" in my browser. Is there a reason why it isn't working locally but it is working externally? Here's my HOSTS file as well as my apache conf file...... HOSTS= 127.0.0.1 localhost 192.168.0.102 example.com 192.168.0.102 example2.com 192.168.0.102 example3.com 192.168.0.102 example4.com 192.168.0.102 mail.example.com 192.168.0.102 mail.example2.com 192.168.0.102 mail.example3.com 192.168.0.102 mail.example4.com And my conf file... NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@example.com DocumentRoot /www/example.com/htdocs ServerAlias example.com *.example.com ServerName www.example.com ErrorLog /www/example.com/logs/example.com-error_log CustomLog /www/example.com/logs/example.com-access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@example2.com DocumentRoot /www/example2.com/htdocs ServerAlias example2.com *.example2.com ServerName www.example2.com ErrorLog /www/example2.com/logs/example2.com-error_log CustomLog /www/example2.com/logs/example2.com-access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@example3.com DocumentRoot /www/example3.com/htdocs ServerAlias example3.com *.example3.com ServerName www.example3.com ErrorLog /www/example3.com/logs/example3.com-error_log CustomLog /www/example3.com/logs/example3.com-access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@example4.com DocumentRoot /www/example4.com/htdocs ServerAlias example4.com *.example4.com ServerName www.example4.com ErrorLog /www/example4.com/logs/example4.com-error_log CustomLog /www/example4.com/logs/example4.com-access_log common </VirtualHost> Any ideas why it's only working from OUTSIDE my LAN???? Thanks so much! Quote Link to comment https://forums.phpfreaks.com/topic/105649-virtual-hosts-config/#findComment-542481 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.