Forwards all requests to Litespeed from Apache, setup

Discussion in 'Apache Migration/Compatibility' started by sid137, Sep 27, 2006.

  1. sid137

    sid137 New Member


    I'm not sure if this is the best place to ask or not.. But I'm installing a rails app for a client, and would like to use Litespeed to serve everything. However, the people that manage their server don't want to get rid of Apache because its integrated with all of their monitoring processes and everything. Is there anyway to set up Apache to forward all requests from a particular domain name, to the Litespeed server, so that it serves all of the pages? (apache) -> localhost:8088 (litespeed) -> localhost:8088 (litespeed)

    Both servers are running on the same machine, and Litespeed is running on :8088 with the ruby-lsapi

  2. mistwang

    mistwang LiteSpeed Staff

    Yes, you can configure Apache with it reverse-proxy feature to forward everything to LiteSpeed on that domain. It is pretty easy to do, please consult Apache's manual.

    However, it is not a optimal solution and you will get much less benefit than using LiteSpeed directly. With LiteSpeed's built-in watch-dog feature, there is not much need for additional monitoring work.

    If that server has multiple IP addresses and that domain got its dedicated IP, you can let LiteSpeed bind to that IP on port 80 to serve that domain directly, the other sites can still be served by Apache. If the site owner is happy with the results, more sites can be converted later on. :)
  3. shanx24

    shanx24 Member

    On Cpanel, how to do this?


    I thought I'd start a new thread but my question is related to this one.

    I have a Cpanel/WHM setup as common. I set up LSWS as root user, and it works when I do http://localhost:81 from the command prompt, but from the browser does not work.

    What step have I missed? How can I make sure that first the port 81 works, and then the port 80 works on my website (I will perhaps change the HTTPD.CONF port of Apache from 80 to something else at that point?)

    Also, few other questions --

    1. If I install as root, I want to be able to use this server for EVERY other domain registered under Cpanel.

    2. Given that PHP5 and MySQL5 are unrelated to the server, if I simply copy all my directories will they work? Which begs the other question -- will my other domains (non root) have to move the files somewhere else?

    3. What are the recommended settings for a very high traffic PHP based site that includes lots of reporting and graph generation with Flash. Should I use keep-alive? How many concurrent users should I set it up to be? How can I use anti-DOS features, security, etc? Would appreciate some pointers.

    Many thanks,
  4. mistwang

    mistwang LiteSpeed Staff

    When you install LiteSpeed, make sure you let LiteSpeed run as the same user as that of Apache.
    Then use our "Use Apache Configuration feature"

    You can use the "port offset" to try LiteSpeed along side with Apache, make sure NOT to use the same port 81 that LSWS is using.

    You don't need to do anything else, all domains registered under Cpanel shoud work properly.

    For anti-DoS feature please read the "Howto" section in doucment comes with the server package.
  5. shanx24

    shanx24 Member

    Thanks. Questions:

    1. Excuse my ignorance but how do I find out what user is running Apache? If I have already installed LS, and followed default commands (installed with user 'nobody') then what can I do now?

    2. Also, isn't this the less optimal way of running LS -- through Apache config?

    3. I did not get your point about port offset at all. Should I use port 81 for LSWS, or not? Is LiteSpeed different from LSWS (so it would seem from your post). Presuming I need to change the port, where should I go to change this, is there a lshttpd.conf file or something?

  6. mistwang

    mistwang LiteSpeed Staff

    "ps -ef | grep httpd" or check /usr/local/apache/conf/httpd.conf, it is nobody, you don't need to do anything, otherwise, remove the lsws directory, run again.

    If you want to manage your sites through Cpanel, it is the way to go.

    There are two ports you need to specify during installation, amdin port and service port, admin port is default to 7080, service port is default to 8088. you probably changed service port to 81.
    When port offset is specified, LSWS will use port "80 + <port offset>" for sites configured in httpd.conf, if you set "port offset" to "1", the port to be used is 81, which is the same as the service port specified during installation, it may or may not work, to avoid the possible confliction, you should not set "port offset" to "1", but use something else.

    Hope this helps. :)

    After everything has been verified to be working properly with Litespeed, you can stop Apache, set "port offset" to "0", restart LSWS, then LiteSpeed will replace Apache by taking over traffic on port 80.
  7. shanx24

    shanx24 Member


    I installed it again. It never asked me anything like Port Offset. I am trying the Enterprise version as I have two CPUs. I used default 7080 for admin, and 8088 for regular. Now when I type for admin, the browser times out. The user is nobody, which is what I used, and which is what is used in Apache's httpd.conf. What's up?

    Thanks for your help.
  8. mistwang

    mistwang LiteSpeed Staff

    I think port 7080 is blocked by firewall.
  9. shanx24

    shanx24 Member

    Thanks, may be. But you mean firewalkl on the server or the PC I use? I am using zonealarm and am pretty sure 7080 is not blocked. How can I check what my firewall is blocking on the server side (CentOS server)? Cheers!
  10. mistwang

    mistwang LiteSpeed Staff

    That's the firewall on the server side, depends on what kind of iptables management software is used, you may found iptable rules in /etc/sysconfig/iptables, just add a similar line for port 7080 like that of port 80. then do "service iptables restart", if /etc/sysconfig/iptables is not there, you are on your own to figure it out, Google is your friend. ;)
  11. shanx24

    shanx24 Member

    Thanks this worked!

    Now I have litespeed working as port 80 and I would like it to see the same paths etc that Apache used to ( / usr/mydomain/public_html) -- how should I enable it to do this?

  12. mistwang

    mistwang LiteSpeed Staff

    You can set "Apache Configuration File" to "/usr/local/apache/conf/httpd.conf"

    and "Apache port offset" to something like "1" or "2", restart server, you should be able to access your Apache sites at port "81" or "82", make sure that port is open on firewall.

    All of your sites is still managed by Cpanel, you don't need to add any thing in LiteSpeed's web admin interface.
  13. shanx24

    shanx24 Member

    Thanks, but now it gives me 404!

    404 Not Found
    The resource requested could not be found on this server! Powered By LiteSpeed Web Server
    Lite Speed Technologies is not responsible for administration and contents of this web site!
  14. mistwang

    mistwang LiteSpeed Staff

    Please check lsws/logs/error.log, it should tell you which file is not found.

Share This Page