Compile/Install OpenLiteSpeed on Debian

Compile/Install OpenLiteSpeed on Debian

TPerry

Well-known member
Tracy Perry submitted a new resource:

Compile/Install OpenLiteSpeed on Debian - Base instructions on compiling and installing OpenLiteSpeed on Debian

This is for basic installation and compilation of OLS 1.2.9 (I have had problems with 1.3 and don't suggest using it currently) on a Debian Wheezy server.

If you are running a minimal install of Debian and want to use OpenLiteSpeed and compile from source (and use the standard PHP options for a forum) then you will need to install some additional packages.
At a minimum you will need to run
Code:
apt-get install libssl-dev make automake build-essential g++ libpcre3...

Read more about this resource...
 
Tracy Perry updated Compile/Install OpenLiteSpeed on Debian with a new update entry:

Compiling on Debian & (now) Ubuntu 14.04

Even though Ubuntu uses base Debian code, I found that OpenLiteSpeed would NOT compile on it. Even with the correct libraries installed (which the Debian listed are correct) I ended up getting
Code:
ollect2: error: ld returned 1 exit status
make[3]: *** [openlitespeed] Error 1
make[3]: Leaving directory `/home/tracy/work/openlitespeed-1.2.9/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/tracy/work/openlitespeed-1.2.9/src'
make[1]: *** [all] Error 2
make[1]:...

Read the rest of this update entry...
 
You've skipped a few steps, eh? :p

/usr/local/lsws/lsphp5/bin/pecl install imagick
-bash: /usr/local/lsws/lsphp5/bin/pecl: No such file or directory
 
You've skipped a few steps, eh? :p

/usr/local/lsws/lsphp5/bin/pecl install imagick
-bash: /usr/local/lsws/lsphp5/bin/pecl: No such file or directory
Not really... if you follow the instructions outlined before for Debian it should work. The basic change is the makefile option.
AND, it would be assumed by most folks you would compile a custom PHP since the default is sorely missing options.
Of course, it also assumes that have installed the necessary libraries. :D

EDIT:
And you didn't see the
(after compiling your custom PHP)
I just added? :ROFLMAO:
 
Not really... if you follow the instructions outlined before for Debian it should work. The basic change is the makefile option.
AND, it would be assumed by most folks you would compile a custom PHP since the default is sorely missing options.
Of course, it also assumes that have installed the necessary libraries. :D
Blah !

I dislike compiling php from source.

apt-get install php ... Done :P
 
Blah !

I dislike compiling php from source.

apt-get install php ... Done :p
But OpenLiteSpeed doesn't use PHP that way. It compiles it's own php handler (lsphp5). OLS pulls the source in for you, uses the options you give it and you compile. Some ways I like it better.
 
But OpenLiteSpeed doesn't use PHP that way. It compiles it's own php handler (lsphp5). OLS pulls the source in for you, uses the options you give it and you compile. Some ways I like it better.

PHP:
'--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-opcache' '- '--with-mcrypt=mcrypt'
Well your code is missing just a few tad bits that I would have included

php5-fpm
php5-intl
php-pear
php5-imagick
php5-imap
php5-mcrypt
php5-ming
php5-ps
php5-pspell
php5-recode
php5-snmp
php5-sqlite
php5-tidy
php5-xsl

I hate source.... Trying to figure out the correct code to include these.
 
PHP:
'--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-opcache' '- '--with-mcrypt=mcrypt'
Well your code is missing just a few tad bits that I would have included

I hate source.... Trying to figure out the correct code to include these.
FPM is not needed - that's lsphp5 ....
imagemagick is done via the PECL command outlined
imap (for me) is not needed as none of my sites utilize any php that connects via/to imap to read mail
mcrypt I thought was in there.... and it is, at the end '--with-mcrypt=mcrypt
pspell is as simple as adding the library for it and adding '--with-pspell' to the compile area
xsl is (again) as simple as '--with-xsl' to the compile area.

and do you actually use most of those modules? Most people don't but they are shoved on you via a standard install of PHP.

Those that are detailed are the common for use with XenForo that are needed. All the rest are NOT needed for standard use.
Screen Shot 2014-05-01 at 6.12.11 PM.webp
 
Last edited:
OpenLiteSpeed 1.3.1 resolved the special requirement it had for compilation on Ubuntu so there is no longer a need to modify the makefile.
 
OpenLiteSpeed 1.3.1 resolved the special requirement it had for compilation on Ubuntu so there is no longer a need to modify the makefile.
My issue with Open Lite Speed was that it would not play nicely with my rewrite rules (ignoring my htaccess files) and not applying the ones I added into Open Lite Speed's control panel. Of course that was v1.2.9

Maybe one day I'll revisit it, but for now I'll stick with my Apache / nginx combination
 
My issue with Open Lite Speed was that it would not play nicely with my rewrite rules (ignoring my htaccess files) and not applying the ones I added into Open Lite Speed's control panel. Of course that was v1.2.9

Maybe one day I'll revisit it, but for now I'll stick with my Apache / nginx combination
OLS does not use the htaccess directly. Only LiteSpeed can read the .htaccess files in each directory. If you have to have that ability then you have to go with either the free one (with the connection limits) or pay for a license for the appropriate type of LS needed.
One thing that gets a LOT of people when they are first setting it up (and it got me also) on the rewrites is forgetting to check the option to enable the rewrites.
Screen Shot 2014-05-07 at 6.59.24 PM.webp
 
OLS does not use the htaccess directly. Only LiteSpeed can read the .htaccess files in each directory. If you have to have that ability then you have to go with either the free one (with the connection limits) or pay for a license for the appropriate type of LS needed.
One thing that gets a LOT of people when they are first setting it up (and it got me also) on the rewrites is forgetting to check the option to enable the rewrites.
View attachment 73299
Nope, you'd be wrong if you think I forgot to check that box. I did indeed turn it on, but friendly urls would not function regardless.
 
Nope, you'd be wrong if you think I forgot to check that box. I did indeed turn it on, but friendly urls would not function regardless.
They do... just hit any of my sites and you will see that they do. ;)

Code:
RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml) - [NC,L]
        RewriteRule (robots\.txt)$ robots.php [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
works just fine on all my XenForo sites (and includes the rewrite for the Sitemap add-on),
Code:
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
works fine on my WordPress blogs. :D
 
They do... just hit any of my sites and you will see that they do. ;)

Code:
RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml) - [NC,L]
        RewriteRule (robots\.txt)$ robots.php [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
works just fine on all my XenForo sites (and includes the rewrite for the Sitemap add-on),
Code:
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
works fine on my WordPress blogs. :D
No idea to the cause then .... Bad install then maybe... If you recall we both had one hell of a time trying to get things to work under that user account (didn't matter if it was nogroup or lsws or www).

In the end I ran out of time. Needed the new server up and running by midnight tonight... Was not going to be paying for more than one hosting provider.
 
Didn't you have the same issue with nginx rewrites? They worked for everybody but you?
No, nginx works fine.

Just found that the configuration (not the rewrites) needed to be tweaked with each new update. It reminded me of IP.Board, every version update broke something....

Of course from what I gather nginx has changed and nginx is a lot more stable (or compatible) and new versions do not necessarily imply having to reconfigure.
 
@Tracy Perry Are you using PHP 5.6.4 and ZendOpcache?
I can't compile PHP 5.6.4 with ZendOpcache using the web based console.
Ayep.. this is with OLS 1.4.3
Screen Shot 2015-01-19 at 5.37.20 PM.webp Screen Shot 2015-01-19 at 5.30.53 PM.webp

Just don't choose the Zend OpCache option in the compile options. It compiles it automatically during a normal compile of PHP (in fact, I think you have to specifically tell it NOT to). I do add an
Code:
 --with-opcache
in the compile options though.
Then to enable it, in your /usr/local/lsws/php/php.ini place (this is for 1.4.3 - the no-debug-non-zts-20131226 is different in 1.3.6). You need to make sure that you do a symlink of the /usr/local/lsws/php/php.ini to /usr/local/lsws/lsphp5/lib/php.ini

Code:
zend_extension=/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20131226/opcache.so
opcache.enable=1
opcache.memory_consumption=1024
opcache.interned_strings_buffer=8
opcache.max_wasted_percentage=5
opcache.max_accelerated_files=8000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=0
opcache.save_comments=1
opcache.enable_file_override=1
opcache.validate_timestamps=1
 
  • Like
Reactions: rdn
With your Configure Parameters I got this error on compilation:
Code:
checking for FreeType 2... lib64
checking for T1lib support... no
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.
**ERROR** Could not configure PHP build

This is on CentOS 6 by the way.
 
Top Bottom