Do I need mod_rewrite AND mod_proxy ?

New to mod_rewrite? This is a good place to start.

Do I need mod_rewrite AND mod_proxy ?

Postby oichi_ru » Tue Dec 27, 2005 11:04 pm

Hi everyone,

Don't be scared by the length. It's a simple mod_proxy vs rewrite mod_question and a plea for hand holding from a noob:-)

This all looks terribly confusing to my post XMAS addled head. I think we need header rewrites but I don't want to break a 99% working setup :-P

We use mod_proxy with 1 domain name and 3 subdomain names.
We occassionally get error messages in browsers showing us the LAN address of the webserver serving the pages, not the FQDN.

Eg: ERROR - The requested URL could not be retrieved
While trying to retrieve the URL: http://lan_server:100/src/right_main.php?

The URL should be http://webmail.domain.com/src/right_main.php?

Our setup is 1 domain name, 3 subdomains, 3 webservers and 2 computers.
(winserver) Win2k Adv Server runs Apache2:80 and IIS:90 . All domain.com goes to IIS:90 (localhost), all subdomain goes to http://lan_server (server on LAN) Debian Sarge runs Apache2 and receives all subdomain traffic. The 2 x httpd.conf files are below.

So, what do I do ? Remove all instances of mod_proxy and replace with mod_rewrite ? And what might this break ?

Cheers and thanks for reading this far


###########################################################
####httpd.conf for Apache2:80 win_server (W2k Server)######
###########################################################
NameVirtualHost *

<VirtualHost *>

ServerName domain.com
ServerAlias www.domain.com
ServerAdmin webmaster@domain.com
ProxyPass / http://winserver:90/
ProxyPassReverse / http://winserver:90/
</VirtualHost>

#subdomains redirected to lan_server#
<VirtualHost *>
ServerAdmin webmaster@domain.com
ServerName webmail.domain.com
ProxyPass / http://lan_server:100/
# ProxyPassReverse / http://lan_server:100/
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@domain.com
ServerName staff.domain.com
ProxyPass / http://lan_server:120/
ProxyPassReverse / http://lan_server:120/
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@domain.com
ServerName tags.domain.com
ProxyPass / http://lan_server:200/
ProxyPassReverse / http://lan_server:200/
</VirtualHost>
#########################################################


#########################################################
######http.conf Apache2:* lan_server (Debian Sarge)######
#########################################################
NameVirtualHost 192.168.0.12:100
NameVirtualHost 192.168.0.12:120
NameVirtualHost 192.168.0.12:200

<VirtualHost 192.168.0.12:100>
DocumentRoot /usr/share/squirrelmail/
ServerName webmail.domain.com
TransferLog /var/log/apache2/webmail-access.log
ErrorLog /var/log/apache2/webmail-error.log
</VirtualHost>

<VirtualHost 192.168.0.12:120>
DocumentRoot /usr/share/dokuwiki/
ServerName staff.domain.com
TransferLog /var/log/apache2/staff-access.log
ErrorLog /var/log/apache2/staff-error.log
</VirtualHost>

<VirtualHost 192.168.0.12:200>
DocumentRoot /usr/share/scuttle/
ServerName tags.domain.com
# ProxyPassReverse / http://tags.domain.com/
TransferLog /var/log/apache2/tags-access.log
ErrorLog /var/log/apache2/tags-error.log
</VirtualHost>
######################################################
oichi_ru
 
Posts: 1
Joined: Tue Dec 27, 2005 11:01 pm

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 6 guests

cron