Installing with Cpanel

#1
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
 

mistwang

LiteSpeed Staff
#2
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
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:
 

pizzaman

Active Member
#4
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
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.
 

pizzaman

Active Member
#6
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. :)
 

pizzaman

Active Member
#8
mistwang said:
Yes, php configuration overriding is supported with LSPHP. :)
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.
 
#10
mistwang said:
htacess support has not been properly turned, you need to turn it on at both server and vhost level.
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.
 

mistwang

LiteSpeed Staff
#11
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
mistwang said:
... 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? :)
Better, I've found an answer. :)

http://www.hostmagik.info/phpsuexec.php
.htaccess

When PHP runs as an Apache module you are able to manipulate PHP using .htaccess - since .htaccess is an Apache feature. When PHP runs as a CGI, you can no longer do this because Apache no longer understand the PHP flags and values. Instead, when PHP runs as a CGI, you will need to create your own PHP initialization file, this file is called php.ini -- php.ini works almost the same as .htaccess -- it is simply a text file with directives that will be used instead of the servers default directives.

To give you a better understanding about how both work in regards to PHP, we have listed a .htaccess file and a php.ini file below.

.htaccess
php_value magic_quotes_gpc on

php.ini
magic_quotes_gpc = on
cPanel's installation comes with an option to work with php suExec.
 
#13
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. :)
 

mistwang

LiteSpeed Staff
#14
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
mistwang said:
We need more feedback to make LSWS/cpanel works better.
I am willing to help you with that. Just let me know what you're looking forward to.

mistwang said:
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. :)
Well then I may be able to come up with something later.
 
#16
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.
 

mistwang

LiteSpeed Staff
#17
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.

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.
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.

*file /usr/local/lsws/conf/----------.xml is not writable
That's because "-" is not allowed in the name of a file. :-D
 
#18
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
 

mistwang

LiteSpeed Staff
#19
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
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..).
[/usr/local/apache/conf/httpd.conf:3066] Listener for xx.xx.xxx.xx is not available!
(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
 
Top