Archive

Archive for the ‘Apache’ Category

Command to check mod_pagespeed

December 21st, 2012 No comments

Command to check mod_pagespeed is installed in server.

curl -D http://127.0.0.1

You will get below output.

 

Date: Fri, 07 Sep 2012 21:51:06 GMT
Server: Apache/2.2.3 (CentOS)
X-Mod-Pagespeed: 0.10.22.4-1633

 

Categories: Apache, CPanel / WHM, Installation Tags:

How to: Install mod_pagespeed in cpanel

December 21st, 2012 No comments

How to: Install mod_pagespeed in cpanel

Login to the server via SSH

Go to below folder

cd /usr/local/src

create directory

mkdir mod_pagespeed

Download pagespeed rpm

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm

Extract the rpm

rpm2cpio mod-pagespeed-beta_current_i386.rpm | cpio -idmv

Copy the modules to apache modules folder

cp /usr/local/src/mod-pagespeed/usr/lib/httpd/modules/mod_pagespeed.so /usr/local/apache/modules/

cp /usr/local/src/mod-pagespeed/etc/httpd/conf.d/pagespeed.conf /usr/local/apache/conf/

Provide execute permission

chmod 755 /usr/local/apache/modules/mod_pagespeed.so

Create below folders

mkdir /var/mod_pagespeed/{cache,files} -p

Provide correct ownership

chown nobody:nobody /var/mod_pagespeed/*

mod_pagespeed has a dependency that you’ll want to enable: mod_deflate (the httpd source directory (2.2.16) may vary depending on your install):

/usr/local/apache/bin/apxs -c -i /home/cpeasyapache/src/httpd-2.2.16/modules/filters/mod_deflate.c

We have to edit mod_pagespeed configuration file located at /usr/local/apache/conf/pagespeed.conf to reflect the correct paths, the LoadModule directives should fetch the modules in “modules/module_name.so”

LoadModule pagespeed_module modules/mod_pagespeed.so
LoadModule deflate_module modules/mod_deflate.so
ModPagespeedFileCachePath "/var/mod_pagespeed/cache/"
ModPagespeedGeneratedFilePrefix "/var/mod_pagespeed/files/"

After that, we’ll need to include the mod_pagespeed configuration in Apache’s configuration file (/usr/local/apache/conf/httpd.conf):

Include conf/pagespeed.conf

In order to keep the changes permanant run the command below.

/usr/local/cpanel/bin/apache_conf_distiller –update

Now restart apache service.

 

 

Categories: Apache, CPanel / WHM, Installation Tags:

How to install ioncube on direct admin server

August 5th, 2012 No comments

How to install ioncube on direct admin server

Go to the below path

cd /usr/local/src

Download the tar file using the below link

wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Extract that file using the below command.

tar xvf ioncube_loaders_lin_x86-64.tar.gz

Move the file

mv ioncube /usr/local

Open php.ini file.

/usr/local/lib/php.ini

Add the below link into it

zend_extension = /usr/local/ioncube/ioncube_loader_lin_xxxx.so

Restart apache

/etc/init.d/httpd restart

 

Categories: Apache, Control Panel, Installation Tags:

Site is working fine with apache but giving 403 error with litespeed

July 5th, 2012 No comments

Site is working fine with apache but giving 403 error with litespeed

=================================
Error 403: Forbidden

You don’t have permissions to access this page. This usually means one of the following:
===================================

Go to the clients account for which you are getting the error message.

Create a .htaccess file and enter the below lines into it.

SecFilterEngine Off

SecFilterScanPOST Off

save and quit

 

Categories: Apache, Control Panel, Uncategorized Tags:

How to uninstall nginx from linux cpanel server

June 2nd, 2012 No comments

How to uninstall nginx from linux cpanel server

Go to the path where you have downloaded the tar file on nginx. I have downloaded that file in the below path.

cd /usr/local/src

Go inside nginx folder

cd publicnginx

run the below command to unsinstall it.

./nginxinstaller uninstall

 

How to install nginx on cpanel server

June 2nd, 2012 No comments

How to install nginx on cpanel server

Go to the below path

cd /usr/local/src

Download the nginx admin file.

wget http://nginxcp.com/nginxadmin2.6-stable.tar

Untar that file using below command

tar -xvf nginxadmin2.6-stable.tar

go to that folder

cd publicnginx

Install nginx using the below steps

./nginxinstaller install

 

 

 

 

Categories: Apache, CPanel / WHM, Installation Tags:

How to install mod security plugin in WHM

May 27th, 2012 No comments

How to install mod security plugin in WHM

Go to the below path.

cd /usr/local/src

Download the below file.

wget http://www.configserver.com/free/cmc.tgz

Extract that file.

tar -xzf cmc.tgz

Go into that folder.

cd cmc

Run the file using the below command.

sh install.sh

Once done, then access the mod security using WHM.

 

How to uninstall mod security plugin from WHM server

Run the below commands to uninstall mod security plugin from WHM server.

rm -fv /usr/local/cpanel/whostmgr/docroot/cgi/addon_cmc.cgi

rm -fv /usr/local/cpanel/whostmgr/docroot/cgi/cmcversion.txt

rm -Rfv /usr/local/cpanel/whostmgr/docroot/cgi/cmc/

 

 

Categories: Apache, Control Panel, CPanel / WHM, Security Tags:

How to install mod_limitipconn on linux server

May 10th, 2012 No comments

How to install mod_limitipconn on server

To set per IP connections limit on  server we are using mod_limitipconn. This can be a very useful tool, as it could help in lowering the load on your server due to someone connecting too many times from the same IP.

 

To set the IP limit on the server using mod_security.

Check apache version first on server.

httpd -v

Go to the below path

cd /usr/local/src/

Download the mod_limitpconn using the below link. I am having apache version 2.2.22. As per your apache version download the file.

wget http://dominia.org/djao/limit/mod_limitipconn-0.24.tar.bz2


Untar the file

tar -xvf mod_limitipconn-0.24.tar.bz2

Go to that folder

cd mod_limitipconn-0.24

Compile it with apache

make
make install

Check the apache syntax and restart the apache service if it is Ok

httpd -t
/etc/init.d/httpd restart

Add the below lines in httpd.conf

vi /usr/local/apache/conf/httpd.conf

 

# This command is always needed
ExtendedStatus On

# Only needed if the module is compiled as a DSO
LoadModule limitipconn_module lib/apache/mod_limitipconn.so

<IfModule mod_limitipconn.c>

# Set a server-wide limit of 10 simultaneous downloads per IP,
# no matter what.
MaxConnPerIP 10
<Location /somewhere>
# This section affects all files under http://your.server/somewhere
MaxConnPerIP 3
# exempting images from the connection limit is often a good
# idea if your web page has lots of inline images, since these
# pages often generate a flurry of concurrent image requests
NoIPLimit image/*
</Location>

<Directory /home/*/public_html>
# This section affects all files under /home/*/public_html
MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video
</Directory>
</IfModule>

Check the syntax if everything is ok then restart the apache.

httpd -t
/etc/init.d/httpd restart
/etc/init.d/httpd status

Confirm that domains are working on the server. You can select the domain from the below file and try randomly accessing it.

cat /etc/userdomains.

 

Notes:

This module will not function unless mod_status is loaded and the “ExtendedStatus On” directive is set.

Make sure mod security is already installed on the server using easyapache.

 


Categories: Apache, CPanel / WHM, Security Tags:

How to add domain manually in Raw Linux Server

May 8th, 2012 No comments

How to add domain in Raw Server

First, add the user on server.

useradd example

Then go to the home folder and search the user.

cd /home/

ls -ld example

Then go to the user by giving the below command.

cd example

Create the public_html folder under that user.

mkdir public_html

Provide proper ownership and permission to public_html folder.

chown example. public_html

chmod 750 public_html

 

Now, add manual entries of virtual host at the end of httpd.conf. Before that take the copy of httpd.conf

cd /etc/httpd/conf/

cp httpd.conf httpd.conf-bak

vi /etc/httpd.conf

ex
—————————-
<VirtualHost 31.193.133.175:80>
ServerAdmin [email protected]
DocumentRoot /home/example/public_html
ServerName example.com
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common
</VirtualHost>

change the document root path, server name, error logs and custom logs
save the files and restart the apache. First, check the apache syntax is correct.

httpd -t

/etc/init.d/httpd restart

Then create the DNS entry of the domain

Go to named path

cd /var/named/

Copy the entry of another domain

cp example1.com.db example.com.db-bak

mv example.com.db-bak example.com.db

Open that file now.

vi example.com.db

Accept name server replace the domain name with your main domain name.

$TTL 14400
example.com. 86400 IN SOA ns1.nameserver.com. abcd.gmail.com. (
2010020703 ;Serial Number
86400 ;refresh
7200 ;retry
3600000 ;expire
86400 ;minimum
)
example.com. 86400 IN NS ns1.nameserver.com.
example.com. 86400 IN NS ns2.nameserver.com.
example.com. 14400 IN A 31.193.133.175
example.com. 14400 IN MX 0 example.com.
mail 14400 IN CNAME example.com.
www 14400 IN CNAME example.com.
ftp 14400 IN A 31.193.133.175

save and quit the file.

Open named.conf file and the entery of that domain, First create the backup file of named.conf

cd /etc/

cp named.con named.conf-bak

vi /etc/named.conf

Copy the entry of another domain and replace the other domain with your domain name.

zone “example.com” {
type master;
notify no;
file “example.com.db”;

};

Once done then restart the named service.

/etc/init.d/named restart

Restart the ftp service to connect to the server via FTP now.

Categories: Apache, Uncategorized Tags:

How to install mod_evasive on Linux server

May 8th, 2012 No comments

How to install mod_evasive on Linux server

Go to the below path.

cd /usr/local/src

Download the file using the below link:

wget wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz

Untar the file.

tar xzf mod_evasive_1.10.1.tar.gz

Go to the folder.

cd mod_evasive

Run the below command for the installation.

apxs -cia mod_evasive20.c

 

You’ll then need to add the mod_evasive configuration to your Apache configuration file. First, find this section:

File:/etc/httpd/conf/httpd.conf (CentOS / Fedora)

LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so

Below those sections, add the mod_evasive configuration:

File excerpt:mod_evasive configuration

<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 60
DOSEmailNotify [email protected]
</IfModule>

————————————————————

File:/etc/apache2/apache2.conf (Debian / Ubuntu)

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf
————————————————————-

You’ll then need to restart Apache for your changes to take effect:

Debian / Ubuntu:

/etc/init.d/apache2 restart

CentOS / Fedora:

/etc/init.d/httpd restart