LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > Problem with lshttp and Apache Reverse Proxy

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2008, 06:00 PM
hofred929 hofred929 is offline
New Member
 
Join Date: May 2008
Posts: 6
Default Problem with lshttp and Apache Reverse Proxy

Hi,
I have configured litespeed 3.3.11 with php4 4.4.8 (recompiled) on an internal Linux RHEL4-U2 box and the Horde/IMP mail application worked fine.
However, when I try to access the domain via the external IP address serviced by the Apache with Reverse Proxy, I got error 404:
404 Not Found
The resource requested could not be found on this server!

Note that in the test I have shutdown the internal Apache webserver on port 80 and activated LiteSpeed on port 80.

Looking at the Virtual host domain log, the only message was:
202.64.220.xx - - [19/May/2008:00:12:48 +0800] "GET / HTTP/1.1" 404 390 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"

The lsws VHOST configuration is:
<?xml version="1.0" encoding="UTF-8"?>
<virtualHostConfig>
<docRoot>$SERVER_ROOT/MyWWW/html/horde-312</docRoot>
<enableGzip>1</enableGzip>
<enableIpGeo>0</enableIpGeo>
<logging>
<log>
<useServer>0</useServer>
<fileName>$VH_ROOT/logs/error.log</fileName>
<logLevel>DEBUG</logLevel>
<rollingSize>5M</rollingSize>
</log>
<accessLog>
<useServer>0</useServer>
<fileName>$VH_ROOT/logs/access.log</fileName>
<pipedLogger></pipedLogger>
<logFormat></logFormat>
<logHeaders>7</logHeaders>
<rollingSize>5M</rollingSize>
<keepDays>30</keepDays>
<bytesLog></bytesLog>
<compressArchive>1</compressArchive>
</accessLog>
</logging>
<index>
<useServer>0</useServer>
<indexFiles></indexFiles>
<autoIndex>0</autoIndex>
<autoIndexURI></autoIndexURI>
</index>
<scriptHandlerList>
<scriptHandler>
<suffix>php</suffix>
<type>lsapi</type>
<handler>phpLsapi</handler>
<note></note>
</scriptHandler>
</scriptHandlerList>
<htAccess>
<allowOverride>15</allowOverride>
<accessFileName>.htaccess</accessFileName>
</htAccess>
<expires>
<enableExpires>1</enableExpires>
<expiresDefault>A4800</expiresDefault>
<expiresByType></expiresByType>
</expires>
<security>
<hotlinkCtrl>
<enableHotlinkCtrl>0</enableHotlinkCtrl>
<suffixes>jpeg, png, jpg, gif</suffixes>
<redirectUri></redirectUri>
<allowDirectAccess>1</allowDirectAccess>
<onlySelf>1</onlySelf>
<allowedHosts></allowedHosts>
<matchedHosts></matchedHosts>
</hotlinkCtrl>
</security>
</virtualHostConfig>

The external Apache (outside the Firewall) configure is:
<VirtualHost 202.64.220.xx:80>
ServerName mail.fredho.net
LogLevel warn
ErrorLog logs/error.log
TransferLog logs/access.log
<IfModule mod_proxy.c>
ProxyPass / http://192.168.1.215/
ProxyPassReverse / http://192.168.1.215/
</IfModule>
</VirtualHost>

There're no errors on the external Apache log in reviewing any problem on the proxy.

Note also that I am not enable Apache config in the lsws setup.

Any ideas what I did wrong in the setup for Reverse Proxy?
Thanks.
Reply With Quote
  #2  
Old 05-19-2008, 10:43 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
You need to add a listener to virtual host mapping on "192.168.1.215" for that vhost.
http://www.litespeedtech.com/docs/we...rs/#domainName
Reply With Quote
  #3  
Old 05-19-2008, 07:21 PM
hofred929 hofred929 is offline
New Member
 
Join Date: May 2008
Posts: 6
Hi, the listener is set to *:80 for all IP addresses on the machine already. I have other VHOSTs defined on this machine as well, all on port 80 but using different IP addresses.

I can access the web sites okay within the 192.168.1 network. The only problem is through the external IPs proxy, it failed with 404 errors. The trouble is I couldn't find any error messages on Apache nor LSWS telling me exactly what's wrong. Stopping LSWS and restarted Apache on the host the web sites can be access with no problem via the proxy.

Attached is the httpd_config.xml.

Please help.
Thanks.
Attached Files
File Type: txt http_config.xml.txt (11.5 KB, 1 views)
Reply With Quote
  #4  
Old 05-20-2008, 07:05 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Code:
    <listener>
      <name>MAILX2</name>
      <address>*:80</address>
      <secure>0</secure>
      <note></note>
      <vhostMapList>
        <vhostMap>
          <vhost>FREDHO</vhost>
          <domain>mail.fredho.net</domain>
        </vhostMap>
        <vhostMap>
          <vhost>CITYUP</vhost>
          <domain>mail.city-up.com</domain>
        </vhostMap>
        <vhostMap>
          <vhost>BUHRD</vhost>
          <domain>mail.buhrd.com</domain>
        </vhostMap>
      </vhostMapList>
    </listener>
add "192.168.1.215" to the "domain" section of the vhost associated with that IP.
Reply With Quote
  #5  
Old 05-20-2008, 08:44 AM
hofred929 hofred929 is offline
New Member
 
Join Date: May 2008
Posts: 6
Hi,
So the <domain> part is actually an IP address, it won't do a DNS lookup?
Reply With Quote
  #6  
Old 05-20-2008, 09:01 AM
hofred929 hofred929 is offline
New Member
 
Join Date: May 2008
Posts: 6
Thanks. By changing the domain name to IP address 192.168.1.215 it fixed the problem and Apache reverse proxy worked. But then, the URL showed http://192.168.1.215/... instead of http://mail.fredho.net/... as in Apache.
Is there anyway to use the domain name in the URL instead of the internal IP which will failed outside the firewall?

Apache has the UseCanonicalName setting which will set the IP address to the ServerName as specified in the httpd.conf. How can LSWS miminc this?

PS. I have an internal DNS which will resolve the domain to the internal IP address if inside the internal network, and to the external IP when outside the Firewall through the ISP's DNS.

Fred
Reply With Quote
  #7  
Old 05-20-2008, 09:26 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
You can use both

<domain>mail.fredho.net,192.168.1.215</domain>
Reply With Quote
  #8  
Old 05-20-2008, 07:06 PM
hofred929 hofred929 is offline
New Member
 
Join Date: May 2008
Posts: 6
Hi,
It worked the URL page showed domain name mail.fredho.net.
But the PHP application Horde/IMP makes use of the PHP _SERVER[] array settings and I found that LSWS did not set the variable _SERVER['SERVER_NAME'] to the domain name but the IP address instead. The Horde PHP application will redirect the URL using the PHP system variable _SERVER['SERVER_NAME'] and rendered the web page failure.

I am including the phpinfo() output on "PHP Variables" from the Apache (4311phpinfo.html) and from the LSWS (448phpinfo.html) for your information. Is there anyway to set the SERVER_NAME to mail.fredho.net in LSWS?

Fred
Attached Files
File Type: zip phpinfos.zip (2.2 KB, 0 views)
Reply With Quote
  #9  
Old 05-20-2008, 08:40 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Try "ProxyPreserveHost" directive if you use Apache 2.x
Reply With Quote
  #10  
Old 05-20-2008, 10:45 PM
hofred929 hofred929 is offline
New Member
 
Join Date: May 2008
Posts: 6
That fix it. Many Thanks.

As a side question, does LSWS support Reverse Proxy? If so, how do I configure it?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:13 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.