Changing Over

akia

New Member
#1
I've been NGINX for quite a while now and everything has been running smooth, but I need to set up SSL and Spdy and move servers, I've used litespeed a few years back and was quite a fan, so have decided now would be a good time to give openlitespeed a try.

Is the any pro/cons I should be aware of? I remember reading a while back, about problems with xenforo and the CSS, has that been resolved now.
 

lsmichael

Active Member
#2
Hi Akia,

At the moment, I don't believe there are any outstanding issues with OpenLiteSpeed 1.2.11 and 1.3.5.

As far as pros over NGINX, our benchmarks have OpenLiteSpeed beating NGINX pretty handily. (These are with small files, though.) We've also got a nice GUI.

Cheers,

Michael
 

akia

New Member
#3
Hi Akia,

At the moment, I don't believe there are any outstanding issues with OpenLiteSpeed 1.2.11 and 1.3.5.

As far as pros over NGINX, our benchmarks have OpenLiteSpeed beating NGINX pretty handily. (These are with small files, though.) We've also got a nice GUI.

Cheers,

Michael
Thanks for the response, I do like the GUI of litespeed, especially the new one. I've just ordered a test VPS to have a play around.
 

akia

New Member
#5
I've had my first run through in getting things set up, there are a few things that confuse me so I'll ask here.

Currently with nginx I've got my files stored under /var/www/ with each site under a different directory, which I manually create. As php runs under www-data, once I've uploaded my files I'll do chown -R www-data:www-data www to change the owership to stop any problems with permisisons etc. Do I need to do the same with litespeed.

Also as its just me on the server do I need to bother with SuExec, will it complicate things or make them easier in the long run?
 
#6
>Do I need to do the same with litespeed.
since this is linux file system permission issue, so there should be no change as before.
or #chmod -R 755 www

>Also as its just me on the server do I need to bother with SuExec
yes, no need. non-suExec is simpler and a bit faster.
 

akia

New Member
#7
I've got my xenforo working fine, but I can't get the rewrite rules on pmd working,

I've got this from the .htaccess file:

#</FilesMatch>

<FilesMatch "\.(htaccess|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>

<IfModule mod_rewrite.c>
RewriteEngine On

#RewriteRule ^([a-zA-Z]+)\.html$ $1.php [L]

#Handle all category links. Static category text followed by ID, followed by path
#The "category" text here needs to be changed if the language variable category is changed
RewriteRule ^category\/(.+/)location/(.+)$ browse_categories.php?id=$1&location=$2 [L,NC,QSA]
RewriteRule ^category\/(.+)$ browse_categories.php?id=$1 [L,NC,QSA]

#Handle all location links. Static location text followed by ID, followed by path
#The "location" text here needs to be changed if the language variable location is changed
RewriteRule ^location\/(.+)$ browse_locations.php?id=$1 [L,NC,QSA]

#Rewrite pages
RewriteRule ^pages\/(.+)\.html$ page.php?id=$1 [L,NC]

#Rewrite Blog
RewriteRule ^blog.html$ blog.php [L,NC,QSA]
RewriteRule ^blog\/([^/]+)-([0-9]+).html$ blog_post.php?id=$2 [L,NC]
RewriteRule ^blog\/category\/(.+)-([0-9]+).html$ blog.php?category_id=$2 [L,NC,QSA]

#Rewrite listing/banner website out
RewriteRule ^out-([0-9]+)\.html$ out.php?listing_id=$1 [L]
RewriteRule ^out-([0-9]+)-([0-9]+)\.html$ out.php?listing_id=$1&banner_id=$2 [L]

#Rewrite listings
#Ignore any physical files
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)\.html$ listing.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/images\.html$ listing_images.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/send-message\.html$ listing_email.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/send-message-friend\.html$ listing_email_friend.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/reviews\.html$ listing_reviews.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/add-review\.html$ listing_reviews_add.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/classifieds\.html$ listing_classifieds.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/documents\.html$ listing_documents.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/suggestion\.html$ listing_suggestion.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/claim\.html$ listing_claim.php?id=$1 [L,NC]

#Rewrite classifieds
RewriteRule ^classified/[^/]+-([0-9]+)\.html$ classified.php?id=$1 [L,NC]
RewriteRule ^classified/[^/]+-([0-9]+)/images\.html$ classified_images.php?id=$1 [L,NC]

#Rewrite sitemap
RewriteRule ^sitemap.xml$ xml.php?type=sitemap [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ 404.php?id=$1 [L,NC]

</IfModule>

But it dosn't seem to be working properly.
 

lsmichael

Active Member
#8
I will quote @lswave from another thread:

openlitespeed support per-server rewriterule but not per-directory. for the difference please refer the official document:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

so put these rules in vhost configuration file but not .htaccess. and need some slight change, for example:
Code:
RewriteRule ^([a-zA-Z0-9_-]+)$ http://m.domain.com/$1/ [R=301,L]
==>
Code:
RewriteRule ^/([a-zA-Z0-9_-]+)$ http://m.domain.com/$1/ [R=301,L]
it's equal to nginx rule:
Code:
rewrite ^/([a-zA-Z0-9_-]+)$ http://m.domain.com/$1/ redirect;
This is one of the most frequently asked questions about OpenLiteSpeed: OpenLiteSpeed rewrite rules use vhost config mod_rewrite syntax, not .htaccess syntax. We will most likely need to find a more efficient way to deal with it.

For now, though, you'll have to update your rewrite rules as though they are in a httpd.conf file.

Cheers,

Michael
 

akia

New Member
#9
I will quote @lswave from another thread:



This is one of the most frequently asked questions about OpenLiteSpeed: OpenLiteSpeed rewrite rules use vhost config mod_rewrite syntax, not .htaccess syntax. We will most likely need to find a more efficient way to deal with it.

For now, though, you'll have to update your rewrite rules as though they are in a httpd.conf file.

Cheers,

Michael
That's fixed it.

I've finally got a test site up and running. And also good results speed wise. You can't tell the difference on a fixed line broadband connection but it seems to make a world of difference on a mobile. Seems so much quicker.


Only thing I'd comment on is things seem to seem a little more complex in getting set up. I've never had to change much in the php.ini file before apart from a few tweaks but with ols I've had to set things like the MySQL server socket path etc.


Oh well. I'll run though setting things up a few more times till I've mastered it then I'll look at getting my production server moved over.
 

lsmichael

Active Member
#10
Thanks for the feedback. What, specifically, are you comparing OpenLiteSpeed to (both for speed and ease of setup)? NGINX? Apache?

We definitely have to make OpenLiteSpeed easier to set up. That's going to be one of the big focuses next year.

Cheers,

Michael
 

akia

New Member
#11
Thanks for the feedback. What, specifically, are you comparing OpenLiteSpeed to (both for speed and ease of setup)? NGINX? Apache?
NGINX and using the dotdeb repository. I make it harder for myself in using debian as I know if I used centos then you've got the prebuilt packages. I did ask if dotdeb had any plans of including OLS in their repository on twitter but they said no unfortunately.
We definitely have to make OpenLiteSpeed easier to set up. That's going to be one of the big focuses next year.
It would be helpful to have a section about the rewrite rules on your wiki as thats the first place I looked when I had the problem and couldn't find anything. I mean you guys do a brilliant job with the documentation that's there already but as hopefully as OLS grows there will be more How Tos and guides around the internet. When I was first getting to grips with nginx which in reality has a steeper learning curve than OLS if I hit a stumbling block a quick google search would find me loads of other people that had had that problem and how to solve it, OLS isn't at that stage yet.
 

lsmichael

Active Member
#12
Ah. That was you asking dotdeb? I saw that tweet and it brought dotdeb to my attention. At some point, I'd like to talk to them about including PHP packages for LiteSpeed. Unfortunately, I can't see having time for that in the near future.

We can definitely add a wiki explaining the rewrite rule difference, but, yes, it will really be another level when there are many guides on third party sites telling you how to configure OpenLiteSpeed for different uses.

m
 

lsmichael

Active Member
#14
Nope. You can have both on one listener. If you're stipulating particular IPs (i.e. not just listening for [ANY]), you should write the IPv4 IPs as an IPv4-mapped IPv6 address (i.e. [::FFFF:x.x.x.x]).

m
 

akia

New Member
#15
Only thing I'd comment on is things seem to seem a little more complex in getting set up. I've never had to change much in the php.ini file before apart from a few tweaks but with ols I've had to set things like the MySQL server socket path etc.
I take this back, it was down to user error, when compling php, I'd set '--with-mysql-sock=/var/run/mysqld/mysqld.sock' with the wrong path, which is why I'd then needed to set it in php.ini. Suppose thats what happens when I'm using a how to for centos and tryingto make it work on debian.

My current config for php is:

Code:
'--prefix=/usr/local/lsws/lsphp5' '--with-mysql' '--with-mysqli' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--with-iconv' '--with-libdir=lib64' '--with-litespeed' '--with-curl' '--enable-zip' '--with-bz2' '--with-jpeg-dir=lib64' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-exif' '--with-openssl' '--with-xmlrpc' '--with-freetype-dir=lib64' '--with-png-dir=lib64' '--enable-inline-optimization' '--enable-xml' '--with-pdo-mysql'
For those in the know, am I missing anything or got stuff I don't need? for a general webserver.
 
#17
Well I've now fully transferred over and everything's running well and I've finally got IPv6 working which is a bonus.


I've got a few more questions though.

Firstly with ssl is it preferable to set it in the listeners or vhost. Each site has its own dedicated ip and its own listener.

Secondly with the file memory cache option. What are the recommend settings I've got loads of memory spare so could I set these to a really high amount to make sure everything's cacache where possible
 
#18
And I've just thought of another question.

Is it a performance problem to have too many listeners. I've got 7 sites hosted on my server and because each one has a dedicated ipv4 and IPv6 and has ssl and non ssl. That's 4 listners per site so 28 in total. Which seems a bit excessive to me.
 
#19
>Firstly with ssl is it preferable to set it in the listeners or vhost. Each site has its own dedicated ip and its own listener.
I think no difference

>Secondly with the file memory cache option.
keep the default settings. no need tune them at all if no issue encountered. linux kernel will cache the static files in memory if it's frequently accessed.

>Is it a performance problem to have too many listeners.
28 listeners still small number. should not a problem at all.

the bottle neck should be at php/mysql side.
for ols, just watch the real-time stats in web admin will be fine.
 
Top