Mailing List Archive

VirtualHosts in Apache2.0
I am trying to set up an APache2.0 server. I am converting an existing 1.3
server. I have post based VirtualHosts as described in the 'Port-base vhosts'
section of 'Virtual Host examples for common setups'. I can not get to any of
the Virtual Hosts. The log seems to indicate that all of the requests are
directed to port 80 even though the request is of the form -
10.168.xxx.yyy:1080.

Initially I used the working 1.3 .conf file just fixing a couple of port
statements. I then I tried by applying my changes to the default .conf file
that comes with the .tar file.

There are no startup errors, the /server-info information seems correct as well
as the -t -D DUMP_VHOSTS information.

Any thoughts?

support@sannotes.org...don

dhughes@microtechniques.com
White Plains, NY


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: VirtualHosts in Apache2.0 [ In reply to ]
It may be you are getting redirected. You may need to set servername to

10.168.xxx.yyy:1080

The listen, servername, Port, Bind directives changed in Apache 2.0
Can you post the entries in access_log?

On Sun, Dec 23, 2001 at 01:49:40PM -0500, "" wrote:
> I am trying to set up an APache2.0 server. I am converting an existing 1.3
> server. I have post based VirtualHosts as described in the 'Port-base vhosts'
> section of 'Virtual Host examples for common setups'. I can not get to any of
> the Virtual Hosts. The log seems to indicate that all of the requests are
> directed to port 80 even though the request is of the form -
> 10.168.xxx.yyy:1080.
>
> Initially I used the working 1.3 .conf file just fixing a couple of port
> statements. I then I tried by applying my changes to the default .conf file
> that comes with the .tar file.
>
> There are no startup errors, the /server-info information seems correct as well
> as the -t -D DUMP_VHOSTS information.
>
> Any thoughts?
>
> support@sannotes.org...don
>
> dhughes@microtechniques.com
> White Plains, NY
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: VirtualHosts in Apache2.0 [ In reply to ]
Daniel,

I did try various combinations of servername directives with the same result.

here is the access.log and the virtualhost part of the .conf file:

10.168.xxx.zzz 80 10.168.xxx.yyy /
10.168.xxx.zzz 80 10.168.xxx.yyy /icons/constructionreading.gif


Listen 80
Listen 1080
Listen 1081

<VirtualHost 10.168.xxx.yyy:1080>
DocumentRoot "/apache/test0/htdocs"
# ServerName testdomain0.com
ErrorDocument 404 /error404.html
</VirtualHost>

<VirtualHost 10.168.xxx.yyy:1081>
DocumentRoot "/apache/test1/htdocs"
# ServerName testdomain1.com
ErrorDocument 404 /error404.html
</VirtualHost>

#<VirtualHost _default_:*>
# DocumentRoot "/apache/default/htdocs"
# ServerName default.com
# ErrorDocument 404 /error404.html
#</VirtualHost>


...don
support@sannotes.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: VirtualHosts in Apache2.0 [ In reply to ]
Are those the real log entries? Where is the status code and the size of the
file in the entry? If you are using a customized log format, can you post it?

Have you tried having Servername 10.168.xx.zzz:1080 inside the virtual host?

You may also want to have UseCanonicalNames off

My reasoning so far is that if you are accessing 1081 but getting 80 content
you are being sent a redirect using the default. Does the URL in the browser
change to 80?

On Sun, Dec 23, 2001 at 05:11:39PM -0500, Don Hughes wrote:
> Daniel,
>
> I did try various combinations of servername directives with the same result.
>
> here is the access.log and the virtualhost part of the .conf file:
>
> 10.168.xxx.zzz 80 10.168.xxx.yyy /
> 10.168.xxx.zzz 80 10.168.xxx.yyy /icons/constructionreading.gif
>
>
> Listen 80
> Listen 1080
> Listen 1081
>
> <VirtualHost 10.168.xxx.yyy:1080>
> DocumentRoot "/apache/test0/htdocs"
> # ServerName testdomain0.com
> ErrorDocument 404 /error404.html
> </VirtualHost>
>
> <VirtualHost 10.168.xxx.yyy:1081>
> DocumentRoot "/apache/test1/htdocs"
> # ServerName testdomain1.com
> ErrorDocument 404 /error404.html
> </VirtualHost>
>
> #<VirtualHost _default_:*>
> # DocumentRoot "/apache/default/htdocs"
> # ServerName default.com
> # ErrorDocument 404 /error404.html
> #</VirtualHost>
>
>
> ...don
> support@sannotes.org
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: VirtualHosts in Apache2.0 [ In reply to ]
Yes, it was a custom log - I wanted to see the port. Here is the more familiar:

10.168.xxx.zzz 80 10.168.xxx.yyy /
10.168.xxx.zzz 80 10.168.xxx.yyy /icons/constructionreading.gif
10.168.xxx.zzz - - [23/Dec/2001:19:22:42 -0500] "GET / HTTP/1.1" 200 285
10.168.xxx.zzz - - [23/Dec/2001:19:22:42 -0500] "GET
/icons/constructionreading.gif HTTP/1.1" 200 3754
10.168.xxx.zzz - - [23/Dec/2001:19:22:49 -0500] "GET / HTTP/1.1" 200 285
10.168.xxx.zzz - - [23/Dec/2001:19:22:49 -0500] "GET
/icons/constructionreading.gif HTTP/1.1" 200 3754
10.168.xxx.zzz - - [23/Dec/2001:19:22:54 -0500] "GET / HTTP/1.1" 200 285
10.168.xxx.zzz - - [23/Dec/2001:19:22:54 -0500] "GET
/icons/constructionreading.gif HTTP/1.1" 200 3754
10.168.xxx.zzz - - [23/Dec/2001:19:23:21 -0500] "GET / HTTP/1.1" 304 0

I had not tried CanonicalNames off. I tried it, and it did not make any difference.

I added a Servername entry with the ip address to the vhost. No change.

Those two tests generated the log above.

The URL does NOT change in the browser.

...don
support@sannotes.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: VirtualHosts in Apache2.0 [ In reply to ]
I tried with Apache 2.0.28 and the following works as expected

# added %p to my log format

Listen 8080
Listen 8081

<virtualhost 10.0.0.1:8081>
</virtualhost>

Request for the virtualhost show up with port 8081
Requests for 8080 show up as port 80 (but that will change if I setup
servername to :8080)

So for some reason you are accessing a virtualhost and still getting port 80
in the log, while you are not receiving a redirect.

Also, you are not receiving the virtualhost content, but the main server
content, no?

If that is the case my guess is that for some reason Apache is not matching
your request to that virtualhost and giving you the content of the main_server

http://httpd.apache.org/docs-2.0/vhosts/details.html:
"The main_server is only used to serve a request if the IP address and port
number to which the client connected is unspecified and does not match any
other vhost (including a _default_ vhost). In other words the main_server
only catches a request for an unspecified address/port combination (unless
there is a _default_ vhost which matches that port"





On Sun, Dec 23, 2001 at 07:39:09PM -0500, Don Hughes wrote:
> Yes, it was a custom log - I wanted to see the port. Here is the more familiar:
>
> 10.168.xxx.zzz 80 10.168.xxx.yyy /
> 10.168.xxx.zzz 80 10.168.xxx.yyy /icons/constructionreading.gif
> 10.168.xxx.zzz - - [23/Dec/2001:19:22:42 -0500] "GET / HTTP/1.1" 200 285
> 10.168.xxx.zzz - - [23/Dec/2001:19:22:42 -0500] "GET
> /icons/constructionreading.gif HTTP/1.1" 200 3754
> 10.168.xxx.zzz - - [23/Dec/2001:19:22:49 -0500] "GET / HTTP/1.1" 200 285
> 10.168.xxx.zzz - - [23/Dec/2001:19:22:49 -0500] "GET
> /icons/constructionreading.gif HTTP/1.1" 200 3754
> 10.168.xxx.zzz - - [23/Dec/2001:19:22:54 -0500] "GET / HTTP/1.1" 200 285
> 10.168.xxx.zzz - - [23/Dec/2001:19:22:54 -0500] "GET
> /icons/constructionreading.gif HTTP/1.1" 200 3754
> 10.168.xxx.zzz - - [23/Dec/2001:19:23:21 -0500] "GET / HTTP/1.1" 304 0
>
> I had not tried CanonicalNames off. I tried it, and it did not make any difference.
>
> I added a Servername entry with the ip address to the vhost. No change.
>
> Those two tests generated the log above.
>
> The URL does NOT change in the browser.
>
> ...don
> support@sannotes.org
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: VirtualHosts in Apache2.0 [ In reply to ]
1) Here is test .conf that does NOT work on my system.
---------- -----------
LockFile /var/lock/httpd/httpd.accept.lock
<IfModule !perchild.c>
ScoreBoardFile /var/log/httpd/apache_runtime_status
</IfModule>
PidFile /var/run/httpd.pid

ErrorLog /var/log/httpd/error.log

User wwwrun
Group wwwrun

Listen 82
Listen 83

ServerAdmin don@localhost

ServerSignature Off

UseCanonicalName Off

HostnameLookups Off

ServerRoot "/www"
DocumentRoot "/www/Default/htdocs"

<Directory />
Allow from all
Options None
AllowOverride None
</Directory>

DirectoryIndex index.html index.htm index.shtml homeindex.html

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

<VirtualHost 10.168.xxx.yyy:82>
DocumentRoot "/www/sample/htdocs"
DocumentRoot "/www/82/htdocs"
</VirtualHost>

<VirtualHost 10.168.xxx.yyy:83>
DocumentRoot "/www/sample/htdocs"
DocumentRoot "/www/83/htdocs"
</VirtualHost>

<VirtualHost _default_:*>
DocumentRoot "/www/sample/htdocs"
DirectoryIndex index.html.en
</VirtualHost>
---------- ----------

However 1)
If I change the addresses to *:82, and *:83, it will work. This leads me to believe
that there is possibly an issue with the IPV6 support ( my kernel has ipv6 support
compiled in); and that although the address reported in the log, and passed in the
environment is 10.168.xxx.yyy, that this is not the address used to build the table.

However 2)
Trying to use configtest with a .conf file that has a line like <VirtualHost 82> gives:
/usr/local/apache2/bin/apachectl: line 187: 2066 Segmentation fault $HTTPD -
t


However 3)
If all of my vhosts are if the form *:nn, and if there is a listen for a port that does
NOT appear then I get:
Mon Dec 24 17:48:45 2001] [notice] SIGHUP received. Attempting to restart
[Mon
Dec 24 17:48:48 2001] [crit] (88)Socket operation on non-socket: make_sock: for
address [::]:81, setsockopt: (SO_REUSEADDR)
[Mon Dec 24 17:48:48 2001]
[alert] no listening sockets available, shutting down






...don
support@sannotes.org
...don
support@sannotes.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org