Installing with Cpanel

Discussion in 'Install/Configuration' started by Suxen, Mar 4, 2006.

  1. Suxen

    Suxen New Member

    After reading the site documentation, FAQ, and searching the forum, I have only come across a few references to those using LiteSpeed Web Server, and Cpanel. What I'm looking for is a more indepth insight into the possible integration - or compatiblity - with webserver control panel software, namely Cpanel, but how it interacts with others could be equally interesting for someone else who may stumble upon this thread wondering the same thing.

    I'll make this a short and sweet post: will installing this on a server with Cpanel cause any problems, or is it relatively painless? Assuming it can be done:

    1) Will it overwrite the existing /usr/local/apache directory? If so, is it easy enough to revert?
    2) Assuming 1) is false, how will newly added subdomains from apache work? They are all saved into /usr/local/apache/conf/httpd.conf
    3) Never end a list on two.

    Thanks for any information you can provide. It looks like an interesting project, and squeezing the last drop out of performance out of a server is always appealing but sadly it seems most of the technologies out there (such as lighttpd) will cause Cpanel to die a nasty and horrible death (supremely break it).

    Thanks for reading,
    -Suxen
  2. mistwang

    mistwang LiteSpeed Staff

    Answers to your questions:

    1. No, you can install LSWS wherever you want, /usr/local/lsws or /opt/lsws is recommended location.

    2. LSWS can watch and automatically reload httpd.conf if you let LSWS to use Apache's httpd.conf directly.

    LSWS is mod_rewrite compatible and has same .htaccess support, so it make migration between Apache and LSWS painless.

    The easiest way for Cpanel integration probably is let LSWS ready httpd.conf directly, but it may not work 100% perfectly, but should be very close. One user reported that it works with Cpanel.
    Other than that, you can try our vhost template feature if it is for mass hosting.

    We'd like to make LSWS Cpanel integration flawlessly, so, feel free to ask for help here if you met any problem. :)
  3. Suxen

    Suxen New Member

    Many thanks for your response, it was very informative and useful! It's great that someone is finally trying to work for both compatibility and optimization of a webserver! Great work guys, long may it continue.

    My LSWS + Cpanel project begins tomorrow, wish me luck :twisted:
  4. pizzaman

    pizzaman New Member

    Suxen,

    I'd also be interesting in your success case. :)

    Recently what I've just done were proxying some heavy php sites
    from cPanel's apache to lsws, and this cuts down server load by
    a good margin. I used to do that with lighttpd earlier but after a day
    I found that lighty couldn't process .htacess and apache's rewrite
    rules so it was a no go. After the switch, things went very smoothly.
  5. Suxen

    Suxen New Member

    I'm going to confess I've been slacking, just this once :D

    I had to move from one server company to another due to various reasons, so I haven't actually gotten around to it as such yet. :roll:

    But I do plan to give it a shot this following week and see how things turn out. Well done on the proxying idea, I've been wanting to find a decent way to cut load on my server for ages but looking at all the available choices when combined with CPanel made it all seem too much hassle until finding LSWS.

    Will be interesting to see how CPanel handles things with Apache is completely replaced for sure.
  6. pizzaman

    pizzaman New Member

    cPanel's setting allow for overriding php.ini (like setting register_global on) in users' home dirs. I'm not sure if this can be done with lsws's php or not.

    Good luck, and please keep us posted. :)
  7. mistwang

    mistwang LiteSpeed Staff

    Yes, php configuration overriding is supported with LSPHP. :)
  8. pizzaman

    pizzaman New Member

    I used php that comes bundled with lsws, and putting php.ini (with register_global on flag as in usual cPanel box) in user's www path but php didn't pick up that override. I've tried that and it didn't work out but perhaps I missed something.
  9. mistwang

    mistwang LiteSpeed Staff

    htacess support has not been properly turned, you need to turn it on at both server and vhost level.
  10. pizzaman

    pizzaman New Member

    Yes it works if I use this in .htaccess

    Code:
    php_value register_globals 1 
    (i know, it shouldn't be that way but some people just don't bother to improve their old codes because they _work_ :( )

    But since we've got quite a few people putting this in user's php.ini file in their www directory:

    Code:
    register_globals = On
    Is there anyway to make user's php.ini being recognized by lsws/php?

    Thanks.
  11. mistwang

    mistwang LiteSpeed Staff

    Sorry, my misunderstanding.

    I wonder if it is a feature in PHP, not really related to Apache or Cpanel, maybe something has been done in Apache.

    But anyway, I think we can do the similar thing if we figured out how this being implemented with Apache/Cpanel. Would you like to help? :)
  12. pizzaman

    pizzaman New Member

    Better, I've found an answer. :)

    http://www.hostmagik.info/phpsuexec.php
    cPanel's installation comes with an option to work with php suExec.
  13. pizzaman

    pizzaman New Member

    I think this problem can be solved by adding .htaccess or appending to existing ones into user's public_html dir with a simple perl command. If you don't think this is worth implementing, then you can safely skip this and working on something else to make lsws compatible with cpanel, or something like /server-status so my cacti (and other people's mrtg) will work again. :)
  14. mistwang

    mistwang LiteSpeed Staff

    We need more feedback to make LSWS/cpanel works better.
    For cacti or mrtg integration, you can write a simple script to parse /tmp/lshttpd/.rtreport to get data displayed in our web real time status report. :)
  15. pizzaman

    pizzaman New Member

    I am willing to help you with that. Just let me know what you're looking forward to.

    Well then I may be able to come up with something later.
  16. Suxen

    Suxen New Member

    Woo, updates

    I finally got around to installing LSWS (nice and painless at least :D ), but I've yet to get happy integration.

    I logged into the LSWS admin interface and set up 'Using Apache Configuration File'. For some reason though, on restarting LSWS I find the changes I apply here disappear, even though I used Save and Apply Changes.

    Alas, I shall keep trying. The other problem is although it does appear to have importead vhosts, etc, I only received file not found errors /or the "Congratulations" installation page for the root of each virtual host domain. :?

    I'll take a more indepth look later and see if I can find the cause(s).

    INteresting problem:

    *file /usr/local/lsws/conf/----------.xml is not writable

    Where those dashes are my host :D

    Only every file in that directory is writable, and belongs to the usergroup nobody.
  17. mistwang

    mistwang LiteSpeed Staff

    Hi Suxen,

    If you let LSWS "Using Aapche Configuration File", then you should not import apache configuration during installation, only pick one.

    I recommend "Using Aapche Configuration File" for Cpanel and you need to add new vhosts for new customers.

    If you looking at port 8088, you probably will get that.
    Because Apache is using port 80, so the imported listeners are not up in LSWS unless you stop Apache.

    That's because "-" is not allowed in the name of a file. :-D
  18. Suxen

    Suxen New Member

    Alright, slight progression :D

    1) I just let it install into the default recommended directory. It seems happier that way, maybe it's just me

    2) I didn't import the configuration during install this time (whoops :oops:).

    Buut there's still something amiss, although things have progressed a bit further this time. What's happening now is each domain (/vhost) gives a "There is no website configured at this address." default mesage, although it does appear to have loaded the Apache configuration fine. I also set it to use Port 8088 during install, as I wasn't sure if setting it to 80 would conflict when loading the apache config. However, I then changed it later in the web interface and it was the same issue.

    So... any ideas this time? :D
  19. mistwang

    mistwang LiteSpeed Staff

    When you run Apache parallel to LSWS to test the "Using Apache configuration" feature, you should use "Apache port offset"
    http://www.litespeedtech.com/docs/ServGeneral_Help.html#apachePortOffset, if you set it to "1", then LSWS will listen on port "81" if apache is on port 80. Make sure you go to the right port. :)

    I think there should not be any problem with serving static files and PHP scripts.

    You should checck the error log to make sure there is nothing wrong during loading Aapche configuration.
  20. Suxen

    Suxen New Member

    Getting there...

    Seems the errors I get is about the Listener not being available from multiple lines of the httpd.conf file (ie, every line a vhost is added, there is a corrisponding error to go with it..).
    (Edited out the IP)

    That would make sense since if the vhost didn't exist, yet the domain points to the server, that would account for all sites giving the default Cpanel no configuration page.

    Asides from that, the rest of the apache configuration file seems to load okay, it's registering port 81 to something at least as anything requested from that gives the Cpanel page error or file not found.

    I guess I'll work it out eventually :D


    Edit: Reworded some stuff. Always proof read, a valuable lesson for today :D

Share This Page