Tutorials For Servers and Server Management

I made this thread for releasing my ebooks regarding server tutorials and their guides regarding most of the known problems .

Notice : The book may contain the data from other authors too , but its only added to get merged all together at one place , and can be easier for lots of server handlers or starters .

Edition 1 : (20 Random Tutorials)

Edition 2 : (cPanel/WHM Installation and Security) 

Edition 3 : (Configuring a CentOS Postfix Email Server )

Part 1 : (Postfix Email Server Configuration)

Part 2 : (Configuring the mail client like Evolution)

Edition 4 : (All About Nginx in Ubuntu )

Edition 5 : (How to manage a DDoS Attack On Linux Servers )

Edition 6 : (Installing Nginx on Kloxo Panel )

Edition 7 : (How to Setup a VPS with rTorrent and libTorrent)

Edition 8 : (How to install Lighttpd on a VPS with php)

Edition 15 : (Set Up DKIM Working With Postfix)

Edition 16 : (Kloxoptization | Take Kloxo To Next Level)

Edition 17 : (DDoSIFY | Ignore Useless People Being Part Of Your Site)

Install NGINX on cPanel

If your looking for a free way to speed up for web server I’d suggest giving nginxcp a try. It acts as a super fast web server to serve up static content such as images and static html but passes php and other dynamic content back to Apache. This will speed up content and lower processor usage on your server.

This application adds all the correct settings into WHM and also adds an application into the WHM control panel so you can stop or start the service and also make configuration changes without having to drop to command line.

[code]cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./nginxinstaller install[/code]


You may needed to run pythonfix script if you are installing it in first time.
As Its a major release so if you have previously installed the any version of the nginx, please uninstall and then perform the installation.

Uninstall Instructions:


[code]cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./nginxinstaller uninstall

How to Enable TUN/TAP Module in OpenVZ

OpenVZ supports VPN inside a container via kernel TUN/TAP module and device. To allow VPS #101 to use the TUN/TAP device the following should be done:
#101 – VPS  id. Replace #101 with your VPS id.
Make sure the tun module has already loaded on the Node.
[[email protected] /]#  lsmod | grep tun
If not listed, then load the tun module with the below command
[[email protected] /]# modprobe tun [[email protected] /]#  lsmod | grep tun
  tun                    82432  6

Run the following command in Node:
[[email protected] /]#  vzctl set 101 --devnodes net/tun:rw --save
[[email protected] /]#  vzctl set 101 --devices c:10:200:rw --save 
[[email protected] /]#  vzctl stop 101 
[[email protected] /]#  vzctl set 101 --capability net_admin:on --save
[[email protected] /]#  vzctl start 101 
[[email protected] /]#  vzctl exec 101 mkdir -p /dev/net
[[email protected] /]#  vzctl exec 101 chmod 600 /dev/net/tun 

To check TUN/TAP is enabled or not :
[[email protected] /]# vzctl enter 101
Inside the VPS: 
[[email protected] /]# cat /dev/net/tun
cat: /dev/net/tun: File descriptor in bad state     

# It means the TUN/TAP is enabled on your VPS.
 cat: /dev/net/tun: No such device     

#  If you receive like this, then the TUN/TAP has not enabled on your VPS . Try to enable TUN/TAP again and check.

Quick Install Owncloud in Centos 6.x 64 bit

With owncloud you can have drive storage like dropbox or google drive with your own server and your own infrastructure. Owncloud made by PHP and backend database MySQL, SQLLite or PostgreSQL. Owncloud is Opensource.

OwnCloud gives you universal access to your files through a web interface or WebDAV. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web. Installation has minimal server requirements, doesn’t need special permissions and is quick. ownCloud is extendable via a simple but powerful API for applications and plugins.

ownCloud started with a keynote by Frank Karlitschek at Camp KDE’10 where he talked about the need of a self-controlled free and open source cloud.

For more :- http://owncloud.org/

This chapter will introduce you to the installation of ownCloud in Centos 6 64bit.

Clean Fresh Minimal Installed Centos 6 64Bit .

Lets start with getting latest update for your installed system .

yum update -y

Using above command , the system will automatically detect and install latest updates available . Once its finished it’ll be something like this

Lets install the Prerequisites needed to install Owncloud .

To run ownCloud, your webserver must have the following installed:

yum -y install mysql-server httpd php php-mysql unzip wget php-json php-xml php-mbstring php-zip php-gd curl php-curl php-pdo

The system will then start installation of the above packages . After install it should be something like this :






chkconfig httpd on 
chkconfig mysqld on

Starting Apache & MySQL

service mysqld start

service httpd start

Install the MYSQL user and database.





[B]Lets create an database :[/B]

echo ‘CREATE DATABASE owncloud;’ | mysql -p [/code]
echo “GRANT ALL PRIVILEGES ON owncloud.* TO ‘owncloud’@’localhost’ IDENTIFIED BY ‘your_password’;” | mysql -p

echo “FLUSH PRIVILEGES;” | mysql -p

Change Directory to /var/www/html

cd /var/www/html

Download Owncloud :

wget http://download.owncloud.org/community/owncloud-4.5.10.tar.bz2

Lets extract it :

tar xvf owncloud-4.5.10.tar.bz2

It will then extract every file to owncloud folder .

OwnCloud needs these to be writable by the Webserver .

chown -R apache:apache owncloud

Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance. If you are installing ownCloud on the same machine as you will access the install wizard from, the url will be: http://IP/owncloud . Click on the Advanced options to show the configuration options. You may enter admin credentials and let ownCloud create its own database user, or enter a preconfigured user. If you are not using apache as the webserver, please set the data directory to a location outside of the document root. See the advanced install settings.



Click on Finish Setup to finish up the installation . You will then have your own Cloud Server for your files .

You can also add as many users or admin in this cloud for uploading the files .

This cloud server can be used for many purposes likewise saving your documents that you can access from anywhere using cloud and if its personal then its the best .

Let me know if anyone is facing any issues in the installation or need this to be installed . Just PM me with your questions , i’ll get back to you asap .

Enable “Update now” link in AwStats on cPanel server

To enable the manual statistics update (“Update now” link) in Awstats, you should edit the following configuration file:

1. Open the following file:

tmp/awstats/awstats.yourdomain.com.conf (substitute yourdomain.com with your actual domain name)

2. Look for the following line:


Change the above value to 1:


3. Save your configuration file.