Setting Litespeed up on port 80

Discussion in 'Install/Configuration' started by Renuplex, Apr 17, 2007.

  1. Renuplex

    Renuplex New Member

    Hi all!

    I've just installed Litespeed on ports 8088 / 7080 and realized my firewall policy only lets port 80 open. Since it is an institution policy I cannot change it and therefore have to configure Litespeed to use port 80.
    Now, I can't access the admin page since I can only ssh to the server hosting the website.

    So here are my few questions:
    - How can I change the listening ports of my Litespeed?
    - Can I setup both the website and the admin page on the same port?
    - Is there a way of setting up the Litespeed server to use port 80 and still have it running using an unprivileged user?

    Thanks alot!
    Laurent
  2. aemadrid

    aemadrid New Member

    I don't think I can give you authoritative answers to your questions but I'll tell you that the admin interface is a fancy GUI to a few XML files sitting in /opt/lsws/conf/ (for all the forward facing stuff) and /opt/lsws/admin/conf/ (for the backend admin). Check it out, make backup copies, try changing stuff and restarting lsws (/opt/lsws/bin/lswsctrl restart) and see if you can get at least the front sites going on port 80.

    Hope it helps,

    AEM
  3. mistwang

    mistwang LiteSpeed Staff

    You can modify lsws/conf/httpd_config.xml and lsws/admin/conf/admin_config.xml in an editor. the syntax is pretty simple.
    No, at this point. How about using 443 for the admin console? It is a standard HTTPS port.
    If you want to use port 80, you have to start LSWS as root user, and LSWS will change to a non-privileged user after the initialization, LSWS will not serve any request as root user. Pretty much all web servers do that.
  4. Renuplex

    Renuplex New Member

    Thanks for your answers!

    About using the port 443 for the admin console
    My problem is I would like to keep my apache running in parallel for comparison purpose (at least for now) and I only have 2 ports I can reach (80, 443).

    I am going to try to prefix all my website dirs ans setup a redirection then.
  5. mistwang

    mistwang LiteSpeed Staff

    You can setup a proxy on port 80 or 443, forward requests to admin console on port 7080.
  6. Renuplex

    Renuplex New Member

    well...I'm having some troubles...
    so what I've done so far is:

    - Setup admin console port to 80
    - Created a virtualhost with my rails app on port 8088
    - Created an Apache Proxy to access the rails app

    My problem, is that I'd need to somehow prefix all addresses from my webapp.
    The Apache conf I have looks like:

    ProxyPass /litespeed http://xxx.xxx.xx:8088
    ProxyPassReverse /litespeed http://xxx.xxx.xx:8088

    and I'd like to have it as:

    ProxyPass /litespeed http://xxx.xxx.xx:8088/litespeed
    ProxyPassReverse /litespeed http://xxx.xxx.xx:8088/litespeed

    so that all the pages would be re-routed successfully..

    I feel like this is something trivial but can't find it...
    Last edited: Apr 18, 2007
  7. Renuplex

    Renuplex New Member

    Ok, or I could, as you propose if understand you right setup a Litespeed proxy to access the admin console.

    But anyway I'd have to prefix either the admin or the rails app address somehow, right?
  8. mistwang

    mistwang LiteSpeed Staff

    I think you'd better not proxying through Apache if you want to comapre something. Everything can be done via LiteSpeed.

    You need to use name based vhost, for example, using IP address for admin, domain name for your rails app.

    First, setup admin on port 80, setup rails app on port 8088 or whatever the port, let the listener map the domain name to the rails app vhost.

    Then add another vhost for the admin, create a web server app pointing to localhost:7080, create a Proxy context "/" using the web server app, add another mapping to listener 8088, map the IP address to the admin proxy vhost just created.

    Then change the admin port from 80 to 7080, change listener 8088 from port 8088 to 80. Restart the server. Admin console is available by accessing http://<ip>/, rails app is available via http://<domain_name>/.

    No need to prefix admin console or your rails app.
    Last edited: Apr 18, 2007
  9. Renuplex

    Renuplex New Member

    thanks for your help...

    I've tried what you proposed but to be honest I'm fairly unsure of each step I'm taking. So the result is that I can reach my rails app but not the console. I get an error at server startup:


    2007-04-18 18:47:41.766 [ERROR] HttpListener::start(): Can't listen at address admin: Address already in use!
    2007-04-18 18:47:41.766 [ERROR] HttpServer::addListener(admin) failed to create new listener
    2007-04-18 18:47:41.766 [ERROR] [config:server:listener:admin] failed to start listener on address 128.178.156.236:8088!

    Here's the httpd_conf.xml file I have:

    <virtualHostList>
    <virtualHost>
    <name>routerank</name>
    <vhRoot>/var/www/routerank_test/</vhRoot>
    <configFile>$SERVER_ROOT/conf/routerank.xml</configFile>
    <note></note>
    <allowSymbolLink>1</allowSymbolLink>
    <enableScript>1</enableScript>
    <restrained>1</restrained>
    <maxKeepAliveReq></maxKeepAliveReq>
    <smartKeepAlive></smartKeepAlive>
    <setUIDMode>0</setUIDMode>
    <chrootMode>0</chrootMode>
    <chrootPath></chrootPath>
    <staticReqPerSec></staticReqPerSec>
    <dynReqPerSec></dynReqPerSec>
    <outBandwidth></outBandwidth>
    <inBandwidth></inBandwidth>
    </virtualHost>
    <virtualHost>
    <name>admin</name>
    <vhRoot>/usr/local/lsws/admin/html</vhRoot>
    <configFile>/usr/local/lsws/conf/admin.xml</configFile>
    <note></note>
    <allowSymbolLink>1</allowSymbolLink>
    <enableScript>1</enableScript>
    <restrained>0</restrained>
    <maxKeepAliveReq></maxKeepAliveReq>
    <smartKeepAlive></smartKeepAlive>
    <setUIDMode>0</setUIDMode>
    <chrootMode>0</chrootMode>
    <chrootPath></chrootPath>
    <staticReqPerSec></staticReqPerSec>
    <dynReqPerSec></dynReqPerSec>
    <outBandwidth></outBandwidth>
    <inBandwidth></inBandwidth>
    </virtualHost>
    </virtualHostList>
    <listenerList>
    <listener>
    <name>Default</name>
    <address>rrg.epfl.ch:80</address>
    <secure>0</secure>
    <vhostMapList>
    <vhostMap>
    <vhost>routerank</vhost>
    <domain>rrg.epfl.ch</domain>
    </vhostMap>
    </vhostMapList>
    </listener>
    <listener>
    <name>admin</name>
    <address>128.178.156.236:80</address>
    <secure>0</secure>
    <note></note>
    </listener>
    </listenerList>
    <address>rrg.epfl.ch:80</address>
    <secure>0</secure>
    <vhostMapList>
    <vhostMap>
    <vhost>routerank</vhost>
    <domain>rrg.epfl.ch</domain>
    </vhostMap>
    </vhostMapList>
    </listener>
    <listener>
    <name>admin</name>
    <address>128.178.156.236:80</address>
    <secure>0</secure>
    <note></note>
    </listener>
    </listenerList>
  10. Renuplex

    Renuplex New Member

    My bad, I apparently wrongly copied the listener part from my file...sorry...

    <listenerList>
    <listener>
    <name>Default</name>
    <address>rrg.epfl.ch:80</address>
    <secure>0</secure>
    <vhostMapList>
    <vhostMap>
    <vhost>routerank</vhost>
    <domain>rrg.epfl.ch</domain>
    </vhostMap>
    </vhostMapList>
    </listener>
    <listener>
    <name>admin</name>
    <address>128.178.156.236:80</address>
    <secure>0</secure>
    <note></note>
    </listener>
    </listenerList>
  11. mistwang

    mistwang LiteSpeed Staff

    does not work, should change it to "128.178.156.236:80", and remove the other listener.
    Change <vhostMapList> section to
    <vhostMapList>
    <vhostMap>
    <vhost>routerank</vhost>
    <domain>rrg.epfl.ch</domain>
    </vhostMap>
    <vhostMap>
    <vhost>admin</vhost>
    <domain>128.178.156.236</domain>
    </vhostMap>
    </vhostMapList>

    restart you server, it should work.
  12. Renuplex

    Renuplex New Member

    amazing! It does work! Thanks! :)
  13. Renuplex

    Renuplex New Member

    ok, so one listener but 2 mappings....makes alot of sense actually!

Share This Page