Warning

 

Close
Confirm Action

Are you sure you wish to do this?

Cancel Confirm
AR15.COM
12/17/2004 12:50:57 PM EDT
I'm haveing a hell of a time trying to get someting so simple as virtual hosts to work.

running it on windows xp.  Have created appropriate directories and web pages.  I just can't get it to find the Server2 web page.

here is what i have

MYIP and domain names have been edited.  I actaully have my ip in for MYIP.


#NameVirtualHost *
# *****************************
NameVirtualHost MYIP:80
# *****************************

   <VirtualHost MYIP:80>
   ServerName server.no-ip.com
   DocumentRoot /htdocs
   </VirtualHost>


   <VirtualHost MYIP:80>
   ServerName server2.no-ip.com
   DocumentRoot /htdocs/hidden
   </VirtualHost>


i have restarted the service and it still doesn't work.  am i forgetting a configureation somewere else?  its driving me up a wall!!!!!!    
12/17/2004 12:53:53 PM EDT
[#1]
Do you have both of the IP addresses bound to the network interface?

Remember the Alamo, and God Bless Texas...
12/17/2004 12:57:04 PM EDT
[#2]
Does your ISP block port 80? If so try 8000 or 8080. You can also try using a * so it would look like:

NameVirtualHost *:80

If memory serves me the * worked for on an old linux server I had. The * connects with any address known.
12/17/2004 1:03:02 PM EDT
[#3]
Apache is teh suck!!
12/17/2004 1:03:13 PM EDT
[#4]
i have a router that is redirecting any port 80 traffic to my web server that is on an internal address.  The IP address in httpd.conf is my external address.

my isp doesn't block 80

i am refferencing the virtual host section off my backed up  httpd.conf file from my last web server, and it was able to hand out the right page based on the url request.

12/17/2004 1:07:43 PM EDT
[#5]
my httpd.conf  on linux looks like this,using afrcom as an example host
:
arfcom.no-ip.com goes to   /var/www/html/arfcom.no-ip.com
arfcom.d2g.com    goes to   /var/www/html/arfcom.d2g.com


<snip>
#
# Use name-based virtual hosting.
#
NameVirtualHost *

#
# 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 *>
#    ServerAdmin [email protected]
#    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>

<VirtualHost *>
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/arfcom.no-ip.com
  ServerName arfcom.no-ip.com
  ServerAlias arfcom.no-ip.com
  ErrorLog logs/arfcom.no-ip.com-error_log
  CustomLog logs/arfcom.no-ip.com-access_log common
</VirtualHost>

<VirtualHost *>
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/arfcom.d2g.com
  ServerName arfcom.d2g.com
  ServerAlias arfcom.d2g.com
  ErrorLog logs/arfcom.d2g.com-error_log
  CustomLog logs/arfcom.d2g.com-access_log common
</VirtualHost>
12/17/2004 1:10:49 PM EDT
[#6]

Quoted:
my httpd.conf  on linux looks like this,using afrcom as an example host
:
arfcom.no-ip.com goes to   /var/www/html/arfcom.no-ip.com
arfcom.d2g.com    goes to   /var/www/html/arfcom.d2g.com


<snip>
#
# Use name-based virtual hosting.
#
NameVirtualHost *

#
# 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 *>
#    ServerAdmin [email protected]
#    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>

<VirtualHost *>
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/arfcom.no-ip.com
  ServerName arfcom.no-ip.com
  ServerAlias arfcom.no-ip.com
  ErrorLog logs/arfcom.no-ip.com-error_log
  CustomLog logs/arfcom.no-ip.com-access_log common
</VirtualHost>

<VirtualHost *>
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/arfcom.d2g.com
  ServerName arfcom.d2g.com
  ServerAlias arfcom.d2g.com
  ErrorLog logs/arfcom.d2g.com-error_log
  CustomLog logs/arfcom.d2g.com-access_log common
</VirtualHost>



Tried that config with my info.. still didn't work.        

i was using apache 1.3  before now i'm on 2.0.52  maybe that makes a difference.
12/17/2004 1:26:33 PM EDT
[#7]
Elementary, my dear Watson. Don't make the Document Root of one Virtual Host a subdirectory of another Virtual Host.

Rather, I prefer this method (works great if you have to manage 80+ domains, like I do):

<VirtualHost MYIP:80>
ServerName server.no-ip.com
DocumentRoot /htdocs/server.no-ip.com
</VirtualHost>


<VirtualHost MYIP:80>
ServerName server2.no-ip.com
DocumentRoot /htdocs/server2.no-ip.com
</VirtualHost>

You're welcome.
12/17/2004 1:50:14 PM EDT
[#8]

Quoted:
Elementary, my dear Watson. Don't make the Document Root of one Virtual Host a subdirectory of another Virtual Host.

Rather, I prefer this method (works great if you have to manage 80+ domains, like I do):

<VirtualHost MYIP:80>
ServerName server.no-ip.com
DocumentRoot /htdocs/server.no-ip.com
</VirtualHost>


<VirtualHost MYIP:80>
ServerName server2.no-ip.com
DocumentRoot /htdocs/server2.no-ip.com
</VirtualHost>

You're welcome.



its setup like that right now but now i just get an index page that shows my folders under /htdocs.

whats with that!?  why is it acting like its not even caring what httpd.conf has to say?
12/17/2004 2:02:01 PM EDT
[#9]

Quoted:

Quoted:
Elementary, my dear Watson. Don't make the Document Root of one Virtual Host a subdirectory of another Virtual Host.

Rather, I prefer this method (works great if you have to manage 80+ domains, like I do):

<VirtualHost MYIP:80>
ServerName server.no-ip.com
DocumentRoot /htdocs/server.no-ip.com
</VirtualHost>


<VirtualHost MYIP:80>
ServerName server2.no-ip.com
DocumentRoot /htdocs/server2.no-ip.com
</VirtualHost>

You're welcome.



its setup like that right now but now i just get an index page that shows my folders under /htdocs.

whats with that!?  why is it acting like its not even caring what httpd.conf has to say?



Ah, I see. What hostname are you using to try and access the server? You're behind a firewall/NAT device? Does your internal name server resolve server.no-ip.com to your server's private address?
12/17/2004 2:04:18 PM EDT
[#10]
Actually, I have a better idea. Post your entire httpd.conf. It'll keep my other questions to a minimum.  
12/17/2004 2:09:17 PM EDT
[#11]
Oh crap, I just realized something. Your using a public IP address in the VirtualHost tags, but your server has a private address bound. I don't know why I didn't catch this before. Replace "MYIP:80" with "*", unless you have a good reason why you don't want Apache bound to all interfaces.

<VirtualHost *>        <-- Like that

I'm actually kind of suprised Apache started. Don't forget to restart Apache when you're done.

12/17/2004 2:11:23 PM EDT
[#12]
i don't have an internal dns server if thats what your asking.

when i replace the ip with the wildcard it gives me an apache error page.   "object not found"
12/17/2004 2:13:31 PM EDT
[#13]

Quoted:
i don't have an internal dns server if thats what your asking.



No bigee. See above. If you change your <VirtualHost> lines, you should be fine. They shouldn't be using a public address, if one isn't bound to your server's NIC.
12/17/2004 2:22:06 PM EDT
[#14]

Quoted:
i don't have an internal dns server if thats what your asking.

when i replace the ip with the wildcard it gives me an apache error page.   "object not found"



Ok. No problem. We'll get this fixed up for ya, promise.

What's your server's public address? Is server.no-ip.com and server2.no-ip.com the real hostnames (they resolve correctly, I noticed)?
12/17/2004 2:23:07 PM EDT
[#15]
i sent you and email.  my httpd.conf file was to big for IM.

no those aren't mine, just used them as an example.

12/17/2004 2:54:11 PM EDT
[#16]
.
12/20/2004 1:13:38 PM EDT
[#17]
so what's the deal?  you fix this yet? I gots to know.
12/21/2004 4:40:07 PM EDT
[#18]
nope, still not fixed.
i'll post again when i find the fix.