Lets open our mind with another web server, which is 6x faster than Apache in handling static files and 50% faster in processing PHP, called LiteSpeed Web Server (LSWS). Variable as below:
OS: CentOS 6 64bit
LiteSpeed version: Standard Edition – Version 4.1.9
Domain/Website: mydear.org
IP: 192.168.0.222
Root path: /usr/local/lsws/mydear
Web path: /usr/local/lsws/mydear/public_html
1. Download the installer at http://litespeedtech.com/litespeed-web-server-downloads.html . As for this case, I will use Linux (x86) version:
$ cd /usr/local/src
$ wget http://litespeedtech.com/packages/4.0/lsws-4.0.20-std-i386-linux.tar.gz
|
2. Install the requirement to be run in 64 bit environment:
3. Extract the installer and install:
$ tar -xzf lsws-4.0.20-std-i386-linux.tar.gz
$ cd lsws-4*
$ ./install.sh
|
The installation wizard will guide us on how to install as below:
Please specify the destination directory. You must have permissions to
create and manage the directory. It is recommended to install the web server
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.
ATTENTION: The user 'nobody' must be able to access the destination
directory.
Destination [/usr/local/lsws]:
Please specify the user name of the administrator.
This is the user name required to log into the administration web interface.
User name [admin]: admin
Please specify the administrator's password.
This is the password required to log into the administration web interface.
Password:
Retype password:
Please specify administrators' email addresses.
It is recommended to specify a real email address,
Multiple email addresses can be set by a comma
delimited list of email addresses. Whenever something
abnormal happened, a notificiation will be sent to
emails listed here.
Email addresses [root@localhost]: serveradmin@mydear.org
As you are the root user, you must choose the user and group
whom the web server will be running as. For security reason, you should choose
a non-system user who does not have login shell and home directory such as
'nobody'.
User [nobody]:
Please choose the group that the web server running as.
User 'nobody' is the member of following group(s): nobody
Group [nobody]:
Please specify the port for normal HTTP service.
Port 80 is the standard HTTP port, only 'root' user is allowed to use
port 80, if you have another web server running on port 80, you need to
specify another port or stop the other web server before starting LiteSpeed
Web Server.
You can access the normal web page at http://:/
HTTP port [8088]: 80
Please specify the HTTP port for the administration web interface,
which can be accessed through http://:/
Admin HTTP port [7080]:
Cannot find RUBY installation, remember to fix up the ruby path configuration
before you can use our easy RubyOnRails setup.
You can setup a global script handler for PHP with the pre-built PHP engine
shipped with this package now. The PHP engine runs as Fast CGI which
outperforms Apache's mod_php.
You can always replace the pre-built PHP engine with your customized PHP
engine.
Setup up PHP [Y/n]: Y
Suffix for PHP script(comma separated list) [php]:
Installing, please wait...
Generating key pair for web console login page, please wait ...
Generating RSA private key, 512 bit long modulus
...............++++++++++++
...............................++++++++++++
e is 65537 (0x10001)
AWStats Integration
AWStats is a popular log analyzer that generates advanced web server
statistics. LiteSpeed web server seamlessly integrates AWStats into
its Web Admin Interface. AWStats configuration and statistics update
have been taken care of by LiteSpeed web server.
Note: If AWStats has been installed already, you do not need to
install again unless a new version of AWStats is available.
Would you like to install AWStats Add-on module [y/N]? y
[INFO] Creating a symbolic link from './awstats-7.0' to './awstats'
[OK] AWStats 7.0 has been successfully installed as a litespeed
add-on module.
Congratulations! The LiteSpeed Web Server has been successfully installed.
Command line script - "/usr/local/lsws/bin/lswsctrl"
can be used to start or stop the server.
It is recommended to limit access to the web administration interface.
Right now the interface can be accessed from anywhere where this
machine can be reached over the network.
Three options are available:
1. If the interface needs to be accessed only from this machine, just
change the listener for the interface to only listen on the loopback
interface - localhost(127.0.0.1).
2. If the interface needs to be accessible from limited IP addresses or sub
networks, then set up access control rules for the interface accordingly.
3. If the interface has to be accessible via internet, SSL (Secure Sockets
Layer) should be used. Please read respective HOW-TOs on SSL configuration.
To change configurations of the interface, login and click
"Interface Configuration" button on the main page.
The administration interface is located at http://localhost:/
or http://:/
Would you like to have LiteSpeed Web Server started automatically
when the server restarts [Y/n]? Y
[OK] The startup script has been successfully installed!
Would you like to start it right now [Y/n]? Y
[OK] litespeed: pid=3314.
LiteSpeed Web Server started successfully! Have fun!
|
The sequence I press on the keyboard is:
Enter > Enter > mypassword > mypassword > serveradmin@mydear.org > Enter > Enter > 80 > Enter > Y > y > Y > Y
4. Lets check whether LSWS is running:
$ netstat -tulpn | grep lite
tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 3314/litespeed (lsh
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3314/litespeed (lsh
|
5. Allow the LSWS ports in IPtables:
$ iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
$ iptables -A INPUT -p tcp -m tcp --dport 7080 -j ACCEPT
$ service iptables save
$ service iptables restart
|
6. Open web browser and go to http://192.168.0.222:7080 to access the administration console. Before we configure the virtual host, we need to configure the listeners so it learn to the correct IP:
Web administration > Configuration > Listeners > Default > General > Edit > Select the IP Address of the pointed website, in this case I will use 192.168.0.222 > Save
Restart the LSWS:
Web administration > Action > Graceful Restart > OK
7. Lets configure our website to run. Create the directory via SSH and then configure the virtual host:
$ mkdir -p /usr/local/lsws/mydear/public_html
|
Web administration > Configuration > Virtual Host Templates > PHP_SuEXEC > Add and insert the website details as screenshot below:
8. Next we need to instantiate the domain from the template. Refer to screenshot below:
Click Instantiate > Yes.
9. Restart LSWS:
Web administration > Action > Graceful Restart > OK
Done!