You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Fernando Correia Martins <fc...@epo.org> on 2003/06/05 12:13:51 UTC

[users@httpd] VirtualHost problem

I've setup a VirtualHost in Apache to rewrite requests like
http://ckt.internal.epo.org/*
as http://localhost:8080/CKT/* (these are served by Zope, the extra
stuff on the rewrite rule is to teach Zope how to process and return
URLs).

However, I get the Apache welcome page rather than Zope's (and errors
for sub-pages).

This is what I added to httpd.conf:

NameVirtualHost *

<VirtualHost *>
    ServerName ckt.internal.epo.org
    RewriteEngine on
    RewriteLog "/var/log/httpd/rewrite.log"
    RewriteLogLevel 9
    RewriteRule ^(.*)
   
http://127.0.0.1:8080/VirtualHostBase/http/ckt.internal.epo.org:80/CKT/VirtualHostRoot$1
[L,P]
    ProxyVia on
</VirtualHost>

After reloading, running httpd -S gives:

*:80                   is a NameVirtualHost
                       default server ckt.internal.epo.org
(/etc/httpd/httpd.conf:1363)
                       port 80 namevhost ckt.internal.epo.org
(/etc/httpd/httpd.conf:1363)


The rewrite and proxy modules are loaded dynamicaly. I'm running Apache
1.3.27 on Suse 8.2, with an Apache/Suse default configuration.

rewrite.log is empty. In error_log I've

[Thu Jun  5 11:31:44 2003] [crit] (98)Address already in use: make_sock:
could not bind to port 80
[Thu Jun  5 11:32:08 2003] [error] [client 10.3.8.62] File does not
exist: /srv/www/htdocs/Actions/

The last one is the result of requesting
http://ckt.internal.epo.org/Actions/ (an existing folder in Zope).

It seems like Apache is ignoring the VirtualHost section or the
RewriteRule is not being matched??

I've run out of options. Mind you, I'm not experienced with Apache so I
could easily be missing the obvious.

Regards,
Fernando

PS: could you please cc me as I'm subscribed only for the digest.

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] VirtualHost problem

Posted by Fernando Correia Martins <fc...@epo.org>.
Many thanks, you got it! I was about to quit (after hours experimenting
at the wrong places)!

There were 3 httpd processes, the root one and 2 children. Could it be
that when I was doing 'httpd reload' only one of the processes was
reloading the configuration and another one was answering the requests??
This is hard to believe! Any better explanation?

I killed all of them and then started httpd again. Now it works (not
really, but the new problem is probably Zope related).

Thanks again,
Fernando

Klavs Klavsen wrote:
> 
> On tor, 2003-06-05 at 12:13, Fernando Correia Martins wrote:
> [SNIP]
> > The rewrite and proxy modules are loaded dynamicaly. I'm running Apache
> > 1.3.27 on Suse 8.2, with an Apache/Suse default configuration.
> >
> > rewrite.log is empty.
> 
> At level 9, it should never be. ie. it would seem apache is not choosing
> your virtualhost to serve the request.
> 
> > In error_log I've
> >
> > [Thu Jun  5 11:31:44 2003] [crit] (98)Address already in use: make_sock:
> > could not bind to port 80
> 
> This means it didn't start apache. You sure you actually restarted
> apache after adding your config?
> 
> try checking with ps fauxw | grep httpd
> remember the PID.
> then restart your apache service and check the PID. It should not be the
> same Number. if it is it isn't restarted. you can kill it with a kill -9
> PID and then start it again as normal.
> --
> Regards,
> Klavs Klavsen, GSEC - kl@vsen.dk - http://www.vsen.dk
> 
> Working with Unix is like wrestling a worthy opponent.
> Working with windows is like attacking a small whining child
> who is carrying a .38.
> 
>   ------------------------------------------------------------------------
>                        Name: signature.asc
>    signature.asc       Type: application/pgp-signature
>                 Description: This is a digitally signed message part

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] VirtualHost problem

Posted by Klavs Klavsen <kl...@vsen.dk>.
On tor, 2003-06-05 at 12:13, Fernando Correia Martins wrote:
[SNIP]
> The rewrite and proxy modules are loaded dynamicaly. I'm running Apache
> 1.3.27 on Suse 8.2, with an Apache/Suse default configuration.
> 
> rewrite.log is empty. 

At level 9, it should never be. ie. it would seem apache is not choosing
your virtualhost to serve the request.

> In error_log I've
> 
> [Thu Jun  5 11:31:44 2003] [crit] (98)Address already in use: make_sock:
> could not bind to port 80

This means it didn't start apache. You sure you actually restarted
apache after adding your config?

try checking with ps fauxw | grep httpd
remember the PID.
then restart your apache service and check the PID. It should not be the
same Number. if it is it isn't restarted. you can kill it with a kill -9
PID and then start it again as normal.
-- 
Regards,
Klavs Klavsen, GSEC - kl@vsen.dk - http://www.vsen.dk

Working with Unix is like wrestling a worthy opponent. 
Working with windows is like attacking a small whining child 
who is carrying a .38.