Jump to content

Virtual Hosts Config


jadoiron

Recommended Posts

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!!!!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.