Virtual Host help

Virtual Host help

Post by Michael Josephso » Thu, 21 Sep 2000 04:00:00



Oh no, not another virtual host question.

Ok, I've done searches on the news group, and I've seen that other people
have add the problem I'm having, but I can't figure out what I'm doing
wrong.

I'm setting up Apache with a virtual host directive. However, when I try to
browse to my virtual host, Apache tries to serve
/usr/local/htdocs/index.html. Which, of course, doesn't exist, and is not
defined anywhere in httpd.conf (and there is not a rogue httpd.conf hiding
somewhere). A syntax check with apachectl -t runs fine, and apache -S a
virtual host is setup, but it's not working. Anyway, here are the revelant
portions of my httpd.conf:

----------------------------------------------------------------------------
-----------
ServerName 208.42.18.182

#DocumentRoot "/usr/local/share/apache/htdocs"
...
 NameVirtualHost 208.42.18.182

 #
 # Virtual host definition -- www.mjjtech.net
 #
 <VirtualHost 208.42.18.182>
   ServerName www.mjjtech.net

   DocumentRoot /home/www/mjjtech.net
   ServerAlias mjjtech.net *.mjjtech.net
   ErrorLog /var/log/apache/www.mjjtech.net-error_log
   CustomLog /var/log/apache/www.mjjtech.net-access_log common

   <Directory "/home/www/mjjtech.net/">
     Options Indexes FollowSymLinks MultiViews
     AllowOverride None
     Order allow,deny
     Allow from all
   </Directory>

   ScriptAlias /cgi-bin/ "/home/www/mjjtech.net/cgi-bin/"
   <Directory "/home/www/mjjtech.net/cgi-bin">
     AllowOverride None
     Options None
     Order allow,deny
     Allow from all
   </Directory>

 </VirtualHost>
 #end mjjtech.net
----------------------------------------------------------------------------
-----------
The output of apache -S is:
VirtualHost configuration:
208.42.18.182:80        is a NameVirtualHost
                                    default server www.mjjtech.net
(/etc/apache/httpd.conf:986)
                                    port 80 namevhost www.mjjtech.net
(/etc/apache/httpd.conf:986)

When I point my browser at www.mjjtech.net, I get a "This page cannot be
found." error. /var/log/apache/error_log has the message "File does not
exist: /usr/htdocs." Though given my virtual host directive, I would expect
the message to be in /var/log/apache/www.mjjtech.net-error_log, if the
virtual host was being resolved correctly. Clearly it is not. I've been
banging my head against the wall all morning. What am I missing?

Thanks, Michael

 
 
 

Virtual Host help

Post by Michael Josephso » Thu, 21 Sep 2000 04:00:00


Doesn't it always seem to work this way? As soon as I post to the newsgroup,

I solve my own problem. Anyway, I'll post my solution here in case anyone is

having the same problem.

I have a DSL connection in which my Cicso 675 modem is assigned a static IP.

I configured NAT on the 675 to pass along the appropriate requests to my

internal server (10.0.0.11). So, instead of refering to the public IP in the

virtual host directives, I needed to reference the internal IP:

BindAddress 10.0.0.11

ServerName 208.42.18.182

VirtualNameHost 10.0.0.11

<VirtualHost 10.0.0.11>

ServerName www.mjjtech.net

...

</VirtualHost>

I just knew I was overlooking something basic.

Cheers, mj

 
 
 

Virtual Host help

Post by Stephan M. Ot » Thu, 21 Sep 2000 04:00:00




Quote:

> When I point my browser at www.mjjtech.net, I get a "This page cannot be
> found." error. /var/log/apache/error_log has the message "File does not
> exist: /usr/htdocs." Though given my virtual host directive, I would
expect
> the message to be in /var/log/apache/www.mjjtech.net-error_log, if the
> virtual host was being resolved correctly. Clearly it is not. I've been
> banging my head against the wall all morning. What am I missing?

Sounds as if the resolving of the name doesn't work correctly.
When you do nslookup www.mjjtech.net , what do you get ?
If you didn't set up a name-server, is the name resolving for this domain
correctly defined in /etc/hosts ?
Maybe you left the standard (usr/htdocs or whatever is defined) definition
for the basic-server ?
When the name is not resolved correct, apache will use the standard
directory as defined at the beginning if the config-file.

HTH

--- Stephan

 
 
 

1. Virtual Hosts Help!

Hello,

Im running apache 1.3.6 on Solaris 7 (x86), and have 1 virtual host up,
but it can only be viewed on the local subnet and not over the web.
heres what ive done:

assigned the virtual host a 'real' IP address
Updated internal and external DNS
assigned the IP address to the logical interface (ifconfig elxl0:1
ipaddy...)
updated httpd.conf
re-started apache

everything works fine when im on the LAN, but when i try to view the
page offsite, it cant load.  am i missing something here?

thanks for any information!

-mike

Sent via Deja.com http://www.deja.com/
Before you buy.

2. blocks free problem with 2.4

3. DNS, Namesever, and Virtual Hosting = HELP!

4. DVD-ROM as CD-ROM

5. virtual hosting help plz

6. HELP: Installing with a Promise Ultra66 SCSI

7. apache ssl and virtual hosts (help)

8. mail spam

9. Virtual hosts help needed!

10. Probably a FAQ--Virtual Hosting help needed

11. Newbie needs virtual hosting help

12. Virtual Host Help needed !

13. Virtual Hosts Help