By default deflate module is already compiled on Plesk based Linux servers(new versions). You just need to add the rules in Apache to enable/load the deflate module.

You can test if your website already has mod_deflate enabled using the following tool.

http://www.whatsmyip.org/mod_gzip_test/

Check the main httpd.conf file

# grep 'mod_deflate' /etc/httpd/conf/httpd.conf

If the result was LoadModule deflate_module modules/mod_deflate.so, you can continue. If the result was #LoadModule deflate_module modules/mod_deflate.so, please run the following command:

# perl -pi -e 's/# LoadModule mod_deflate/LoadModule mod_deflate/g' /etc/httpd/conf/httpd.conf

Then add this to the httpd.conf file for the site

#
# Deflate output configuration
#
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

Restart Apache and test from online tools to see if deflate is enabled.

Other configuration

Include this in the conf.d directory. Make sure that the conf.d directory is included in httpd.conf.


# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI 
.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

Restart Apache and test from online tools to see if deflate is enabled.

Easy

On a Plesk server, the mod_deflate module is installed by default, however it may be disabled in the Apache configuration file. To enable the mod_deflate module in Plesk edit the Apache configuration file

# vi /etc/httpd/conf/httpd.conf

Search the line that says,

#LoadModule deflate_module modules/mod_deflate.so

and uncomment it i.e. remove the ‘#’ mark

LoadModule deflate_module modules/mod_deflate.so

Now, create a /etc/httpd/conf.d/deflate.conf file. Apache reads all the .conf files from the /etc/httpd/conf.d directory on a Plesk server.


# vi /etc/httpd/conf.d/deflate.conf

and place the following code in it

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI  \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

Save the file and restart Apache.

# service httpd restart

Source: http://linuxhostingsupport.net/blog/how-to-enable-http-compression-on-a-plesk-server

Check the settings and add/adjust as follows:

Find the configuration file:

root@serv [~]# /usr/local/apache/bin/httpd -V
Server version: Apache/2.2.27 (Unix)
Server built:   Jun 12 2014 01:44:45
Cpanel::Easy::Apache v3.24.19 rev9999
Server's Module Magic Number: 20051115:33
Server loaded:  APR 1.5.0, APR-Util 1.5.3
Compiled using: APR 1.5.0, APR-Util 1.5.3
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr/local/apache"
 -D SUEXEC_BIN="/usr/local/apache/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

The config file is usually at:
/usr/local/apache/conf/httpd.conf

Add/Edit the config:

Start Servers 32
Minimum Spare Servers 32
Maximum Spare Servers 256
Server Limit 2000
Max Clients 1500
Keep-Alive On

Keep it mind that http is a stateless protocol. Each line can represent one client opening multiple sockets to grab different files (css, images, etc) that will hang out for awhile in a timewait state.

To display only active Internet connections to the server at port 80 and sort the results, allow to recognize many connections coming from one IP

# netstat -an | grep :80 | sort

To display the list of the all IP addresses involved instead of just count.

# netstat -n -p | grep SYN_REC | sort -u

Slow Server

# netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n 

# netstat -nat | grep :80 | grep ESTAB | wc -l

# netstat -nat | grep :80 | gawk '{ print $5; }' | gawk -F: '{ print $1 }' | sort | uniq -c | sort -n

# netstat -an|grep ":80"|awk '/tcp/ {print $6}'|sort -nr| uniq -c | sort -n

# netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1

For Java?

# netstat -nat | grep :1935 | gawk '{ print $5; }' | gawk -F: '{ print $1 }' | sort | uniq -c | sort -n

Need to optimize?

http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
http://blog.monitis.com/2011/07/05/25-apache-performance-tuning-tips/
http://stackoverflow.com/questions/8902103/is-there-an-apache-tuner-script-like-mysqltuner-pl

http://httpd.apache.org/docs/2.2/programs/ab.html

http://www.cyberciti.biz/tips/howto-performance-benchmarks-a-web-server.html


ab -c 50 -n 10000 URL_TO_THE_SITE

-n 10000: ab will send 1000 number of requests to server 202.54.200.1 in order to perform for the benchmarking session
-c 50 : 50 is concurrency number i.e. ab will send 50 number of multiple requests to perform at a time to server 202.54.200.1

Login to Linux/bsd desktop computer and type following command:


$ ab -n 1000 -c 5 http://202.54.200.1/snkpage.html

Where,

-n 1000: ab will send 1000 number of requests to server 202.54.200.1 in order to perform for the benchmarking session
-c 5 : 5 is concurrency number i.e. ab will send 5 number of multiple requests to perform at a time to server 202.54.200.1
For example if you want to send 10 request, type following command:

[stextbox id=”warning”]Connection reset by peer: mod_fcgid: error reading data from FastCGI server[/stextbox]

Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Jul 31 13:05:21 2014] [error] [client 99.xxx.xx.xx] Premature end of script headers: cron.php

Edit fastcgi.conf and add the following:

nano /etc/nginx/fastcgi.conf
FcgidBusyTimeout 3600

For directories

[root@server]# find /var/www/vhosts/domain.com/httpdocs -type d -perm 777 -print

Set to 755:

root@server ]# find /var/www/vhosts/domain.com/httpdocs/ -type d -perm 777 -exec chmod 755 {} \;


For Files

[root@server]# find /var/www/vhosts/domain.com/httpdocs -type f -perm 777 -print

Set to 644:

[root@server]# find /var/www/vhosts/domain.com/httpdocs -type f -perm 777 -exec chmod 644 {} \;

Domain Masking (a.k.a. Blind Forwarding) is using a domain name to display a different domain, but still shows the original domain’s name in the address bar.

Generally, this is considered a bad idea and not good for SEO, but it is possible.
Plesk
(Applies to 10 – 11.0)

In order to forward a domain blindly, you will create it in Plesk as you would any other domain, only select the Hosting Type as Forwarding, then select “Frame Forwarding” to spoof the domain name to your your domain name.

Domains > domainname.com > Websites & Domains
Scroll to the bottom of the page and click the domain name
Locate the Hosting type and click ‘Change’
Now select Forwarding and Frame Forwarding.

About Virtual Hosts
Virtual Hosts are used to run more than one domain off of a single IP address. This is especially useful to people who need to run several sites off of one virtual private server. The sites display different information to the visitors, depending on with which the users accessed the site.There is no limit to the number of virtual hosts that can be added to a VPS.
Set Up
The steps in this tutorial require the user to have root privileges. You can see how to set that up in the here Initial Server Setup. You can implement whatever username suits you.

Read More

About Virtual Hosts
Virtual Hosts are used to run more than one domain off of a single IP address. This is especially useful to people who need to run several sites off of one virtual private server. The sites display different information to the visitors, depending on with which the users accessed the site.There is no limit to the number of virtual hosts that can be added to a VPS.

Read More