httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krisztian Gyoerffy" <krisztian.gyoer...@selecktra.com>
Subject RE: [users@httpd] Problems with virtual hosting
Date Tue, 04 Mar 2003 16:11:34 GMT
Hi,


with the httpd -l command I get the following:

# httpd -l
Compiled-in modules:
  http_core.c
  mod_so.c
suexec: enabled; valid wrapper /usr/sbin/suexec

This I also checked before, and I saw that the mod_proxy is not compiled in, but then I checked
in the httpd.conf file and there it is loaded as a module (and now I checked the mod_rewrite
too, and it is also there):

LoadModule rewrite_module     /usr/lib/apache/mod_rewrite.so
.
.
LoadModule proxy_module       /usr/lib/apache/libproxy.so
.
.
.
.
AddModule mod_rewrite.c
.
.
AddModule mod_proxy.c

So they are loaded dynamically if I am right?
Are the LoadModule and AddModule directives for loading a module dynamically? Why I need them
both to define, and why are they different e.g. for mod_proxy (libproxy.so, mod_proxy.c) while
for mod_rewrite just the extension is different?


Now I also tried to include the  "ProxyRequests On" into the config, no success. There is
basically no special error message, just my common web page is displayed, the same like for
www.test.com. That's why it seems not to do anything. Or I get part of the start page of the
webmail service, but nothing is working on it, and some objects are incomplete (e.g. pics
are not loaded). And if in such case I click on the "Refresh" button in Internet Explorer
I get my common web page is displayed, the same like for www.test.com.

My log files contain information like this:

Error_Log:

[Tue Mar  4 13:52:54 2003] [notice] caught SIGTERM, shutting down
[Tue Mar  4 13:52:59 2003] [notice] Apache/1.3.19 (Unix)  (SuSE/Linux) mod_throttle/3.0 mod_layout/1.0
mod_fastcgi/2.2.2 configured -- resuming normal operations
[Tue Mar  4 13:52:59 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Mar  4 16:31:52 2003] [notice] caught SIGTERM, shutting down
[Tue Mar  4 16:31:58 2003] [notice] Apache/1.3.19 (Unix)  (SuSE/Linux) mod_throttle/3.0 mod_layout/1.0
mod_fastcgi/2.2.2 configured -- resuming normal operations
[Tue Mar  4 16:31:58 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

So it seems to be clean.

access_log (here you can see the example I described above):

a.b.c.d - - [04/Mar/2003:16:32:15 +0100] "GET / HTTP/1.0" 200 2097
a.b.c.d - - [04/Mar/2003:16:32:15 +0100] "GET /DomainFiles/*/SampleLogo.gif HTTP/1.0" 200
6194
a.b.c.d - - [04/Mar/2003:16:32:18 +0100] "GET / HTTP/1.0" 200 2097
a.b.c.d - - [04/Mar/2003:16:32:18 +0100] "GET /DomainFiles/*/Logo.gif HTTP/1.0" 200 1877
a.b.c.d - - [04/Mar/2003:16:32:20 +0100] "GET /DomainFiles/*/Logo.gif HTTP/1.0" 200 1877
a.b.c.d - - [04/Mar/2003:16:32:21 +0100] "GET /con1.gif HTTP/1.0" 404 240        <--- here
I got the start page of webmail service, and this gif was not loaded
a.b.c.d - - [04/Mar/2003:16:32:24 +0100] "GET /spain.gif HTTP/1.0" 404 240       <--- here
I pressed the Refresh button, and I got my common web page from www.test.com
a.b.c.d - - [04/Mar/2003:16:32:24 +0100] "GET /hungary.gif HTTP/1.0" 404 240
a.b.c.d - - [04/Mar/2003:16:32:25 +0100] "GET /hungary.gif HTTP/1.0" 404 240
a.b.c.d - - [04/Mar/2003:16:32:25 +0100] "GET /spain.gif HTTP/1.0" 404 240
a.b.c.d - - [04/Mar/2003:16:32:25 +0100] "GET /hungary.gif HTTP/1.0" 404 240
a.b.c.d - - [04/Mar/2003:16:32:38 +0100] "GET /con1.gif HTTP/1.0" 404 240
a.b.c.d - - [04/Mar/2003:16:32:38 +0100] "GET /hungary.gif HTTP/1.0" 404 240
a.b.c.d - - [04/Mar/2003:16:32:39 +0100] "GET /hungary.gif HTTP/1.0" 404 240


Thanks for more advices


Regards

Krisztian

-----Original Message-----
From: Nikunj Virani [mailto:nikunj@netsurf.co.in]
Sent: Dienstag, 04. März 2003 14:48
To: users@httpd.apache.org
Subject: Re: [users@httpd] Problems with virtual hosting


Hi,

>>Anyway still I have a minor problem. In both cases where it is working,
after I am connected to the webmail service I get in >>Internet Explorer in
the address bar the http://yourExternalIP:3000, so it replaces me the alias.
Instead I would like to keep >> the alias in the address bar, so that
http://yourExternalIP:3000 is hid from the users.

Unforunately, you need the second one of the three given to work for you to
hide from the customers yourExternalIP:3000. I am not sure why the second
one did not work for you. Can you send me what errors do u get while trying
to use the second one ?

Note: Just make sure you have both mod_rewrite and mod_proxy module enabled
while using the second VirtualHost configurations.

Try this one. Confirm again you need both mod_rewrite module and mod_proxy
module to work for this.

<VirtualHost yourexternalIP:80>
 Servername              webmail.test.com
 ProxyRequests On
 RewriteEngine On
 RewriteRule (.*) http://yourExternalIP:3000$1 [P]
</VirtualHost>

>On the other hand, I am still courius, why it is not working with ProxyPass
and ProxyPassReverse?

I am not sure what errors you get while using ProxyPass. can you cross check
your Proxy module ? It could be a problem with your proxy module as if
"RewriteRule (.*) http://yourExternalIP:3000$1 [R]" works for you, most
often then not mod_rewrite is compiled and working.

>And I also would like to know, why it is not working also with rewrite [P]?
What do u get on apache logs ? rewrite [P] needs both mod_proxy as well as
mod_rewrite to work properly. It seems you have problem with mod_proxy.

>BTW what is the difference between the rewrite [P] and [R] and simple
redirect?

Courtesy : http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html

'redirect|R [=code]' (force redirect)
Prefix Substitution with http://thishost[:thisport]/ (which makes the new
URL a URI) to force a external redirection. If no code is given a HTTP
response of 302 (MOVED TEMPORARILY) is used.

proxy|P' (force proxy)
This flag forces the substitution part to be internally forced as a proxy
request and immediately (i.e., rewriting rule processing stops here) put
through the proxy module. You have to make sure that the substitution string
is a valid URI (e.g., typically starting with http://hostname) which can be
handled by the Apache proxy module. If not you get an error from the proxy
module. Use this flag to achieve a more powerful implementation of the
ProxyPass directive, to map some remote stuff into the namespace of the
local server.
Notice: To use this functionality make sure you have the proxy module
compiled into your Apache server program. If you don't know please check
whether mod_proxy.c is part of the ``httpd -l'' output. If yes, this
functionality is available to mod_rewrite. If not, then you first have to
rebuild the ``httpd'' program with mod_proxy enabled.

RedirectPermanent:
This directive makes the client know that the Redirect is permanent (status
301). Exactly equivalent to Redirect permanent.


Hope this helps!!

Regards,
Nikunj Virani
Senior System Administrator
NCPL



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





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


Mime
View raw message