OpenLiteSpeed is an optimized open source web server that can be used to manage and serve sites. As far as Linux web servers are concerned, OpenLiteSpeed has some interesting features that make it a solid choice for many installations. It features Apache compatible rewrite rules, a web administration interface, and customized PHP processing optimized for the server.
In this guide, we’ll demonstrate how to install and configure OpenLiteSpeed on an Ubuntu 14.04 server. We will also download and install MySQL to complete the conventional setup of a web server, dynamic script processor, and database management system.
Before we begin, you should have a non-root user account configured on your server, complete with sudo
privileges. To learn how to set up an account like this, follow our Ubuntu 14.04 initial server setup guide.
This tutorial will guide you through the process of compiling, installing, and configuring an OpenLiteSpeed instance on your server. We will also install and configure MySQL to facilitate interaction with many common web applications and services. OpenLiteSpeed comes with PHP embedded into the actual server, but we will show you where to go to customize this if you have specific needs.
We will be installing OpenLiteSpeed from source since the project does not provide any pre-built binaries for Ubuntu. Before we can begin the installation process however, we need to take care of some dependencies.
Fortunately, all of the dependencies that we need can be found in Ubuntu’s default repositories. We can update the local package index file and then install all of the components that we need. These will be pieces that are needed to compile the software, as well as the supporting components that OpenLiteSpeed will use to implement certain functionality:
- sudo apt-get update
- sudo apt-get install build-essential libexpat1-dev libgeoip-dev libpng-dev libpcre3-dev libssl-dev libxml2-dev rcs zlib1g-dev
At this point, we have everything we need to compile and install OpenLiteSpeed.
Next, we need to download the current latest version of the OpenLiteSpeed software. You can find the source files on the OpenLiteSpeed download page.
We want to install the latest current stable version of the software. At the time of this writing, that would be version 1.3.10, but it will likely be different for you. Right-click on the link for the latest stable version in your browser and select “Copy link address” or whatever similar option your browser provides.
Back in your terminal, move into your home directory. Type in the wget
command and then paste in the link that you copied from the website (again, your link will likely be different):
- cd ~
- wget http://open.litespeedtech.com/packages/openlitespeed-1.3.10.tgz
Once the archive has been downloaded, extract it and then move into the resulting project directory by typing:
- tar xzvf openlitespeed*
- cd openlitespeed*
Next, we need to configure the software so that it can be properly build for our system. After the configuration has completed, we can compile the software to build our binaries:
- ./configure
- make
Once our software is compiled, we can install it onto our system by typing:
- sudo make install
This will install the entire OpenLiteSpeed system under the /usr/local/lsws
location.
Before we move any further, we will install the MySQL database management system so that our applications have a place to store persistent data.
We can install MySQL from Ubuntu’s repositories by typing:
- sudo apt-get install mysql-server
You will be asked to select and confirm an administrative password for the database system during the installation procedure.
Once the installation is complete, you can initialize the MySQL directory structure by typing:
- sudo mysql_install_db
Next, we need to fix some insecure defaults by running a simple cleanup script. Type:
- sudo mysql_secure_installation
You will be asked to provide the MySQL administrative password that you selected during installation. Afterwards, you will be asked if you want to select a different password. You can choose “N” for “no” here if you are content with your password choice. For the remaining questions, hit ENTER to accept the default suggestions.
With OpenLiteSpeed and MySQL installed, we are now almost ready to start the web server.
Before we begin, we should set an administrative password for OpenLiteSpeed. By default, the password is set to “123456”, so we should change this before ever starting the server. We can do that by running an administrative script. Type:
- sudo /usr/local/lsws/admin/misc/admpass.sh
You will be asked to optionally provide a username for the administrative user. If you just press ENTER, the username “admin” will be selected. Afterwards, you will be asked to select and confirm a new password for the account.
Once the password has been changed, start the web server by typing:
- sudo service lsws start
In your web browser, you can now access the default web page. Navigate to your server’s domain name or IP address, followed by :8088
to specify the port:
http://server_domain_or_IP:8088
You will see a page the default OpenLiteSpeed web page, that looks like this:
If you click through the links, you should notice that many features are already installed and configured correctly. For instance, an example CGI script is available, a customized PHP instance is up and running, custom error pages and authentication gates are configured. Click around to explore a little.
When you are satisfied with the default site, we can move on to the administrative interface. In your web browser, using HTTPS, navigate to your server’s domain name or IP address followed by :7080
to specify the port:
https://server_domain_or_IP:7080
You will likely see a page warning your that the SSL certificate from the server cannot be validated. Since this is a self-signed certificate, this is expected. Click through the options available to proceed to the site (in Chrome, you must click “Advanced” and then “Proceed to…”).
You will be prompted to enter the administrative name and password that you selected with the admpass.sh
script a moment ago:
Once you correctly authenticate, you will be presented with the OpenLiteSpeed administration interface:
This is where the majority of your configuration for the web server will take place.
To demonstrate the basic idea behind configuring options through the web interface, we will change the port that the default site is using from “8088” to the conventional port 80.
To accomplish this, you can use the “Configuration” menu item in the menu bar and select “Listeners”:
In the list of listeners, you can click the “View/Edit” button for the “Default” listener:
You can click the edit button in the top-right corner of the “Address Settings” table to modify its values:
On the next screen, change port “8088” to port “80” and click “Save”.
After the modification, you will need to restart the server, which can be accomplished through the “Actions” menu by selecting “Graceful Restart”:
The default web page should now be accessible in your browser on port “80” instead of port “8088”. Visiting your server’s domain name or IP address without providing a port will now display the site.
OpenLiteSpeed is a fully-featured web server that is primarily managed through the administrative web interface. A full run through of how to configure your site through this interface is outside of the scope of this guide.
However, to get you started, we’ll touch on a few important points below:
/usr/local/lsws
directory./usr/local/lsws/DEFAULT/html
. The configuration and logs for this virtual host can be found under the /usr/local/lsws/DEFAULT
directory.At this point, you should have OpenLiteSpeed (with PHP included) and MySQL installed and running on an Ubuntu 14.04 server. OpenLiteSpeed offers great performance, an easy-to-use interface, and pre-configured options for script handling. Dive in and learn the ropes to start leveraging these capabilities to serve your sites.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I dont like OLS, but when I configured it ~1 year ago - there were almost no tutorials in the Web. Thx for this. You may also need add here some words about PHP (hot to rebuld the version and include it on the website) - it is very useful if we say about OLS as alternative to LAMP or LNMP.