First Install cPanel on the new server
1 2 3 | root@server [~]# mkdir /home/cpins root@server [~]#cd /home/cpins root@server [~]#wget http://layer1.cpanel.net/latest |
after this give screen command
1 | root@server [~]#screen |
If it works then OK ,but if did’nt work use
1 | root@server [~]#yum install screen (Install all the dependencies with it ) |
now give screen command
1 | root@server [~]#screen |
after that give ‘ll’ or ls and you will see the file as ‘latest’
1 2 3 | root@server [~]# ls latest |
change permission to 755
1 | root@server [~]#chmod 755 latest |
and then after give this command
1 | #sh latest |
After Installation you need to configure your WHM by login to http://yourip:2086
Now Harden/Secure the server :-
Steps to Harden server :-
Install csf as almost 80 % of your server can be secured by installing csf :-
Steps to install csf :-
Download CSF script from
1 | root@server [~]http://www.configserver.com/free/csf.tgz |
Untar File
1 | root@server [~]tar -xzxf csf.tar.gz |
Install using following command
1 | root@server [~]sh /csf/install.sh |
That’s it! Wait for installation to finish.
Once you finish with the installation login to WHM by http://yourip:2086
WHM >> Plugins >>Config Server Security and Firewall >> Click on “Check Server Security” and from here you can increase the rating which will secure your server.
Further you can optimize your httpd and mysql by adding some manual entried in httpd.conf and my.cnf file respectively
Go to /etc/httpd/conf/httpd.conf file by your favorite editor but before that do take the backup of your files
1 | root@server [~]# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf-bk |
Now Go to /etc/httpd/conf/httpd.conf file
1 | root@server [~]# nano /etc/httpd/conf/httpd.conf |
and add the following entries :-
1 2 3 4 5 6 7 8 9 | Timeout 90 KeepAlive On MaxKeepAliveRequests 200 KeepAliveTimeout 5 StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 1200 MaxClients 1200 |
Save and exit and restart apache service
1 | root@server [~]# /etc/init.d/httpd restart |
Now go to /etc/my.cnf but before that take a backup of it
1 | root@server [~] cp /etc/my.cnf /etc/my.cnf-bk |
1 | root@server [~] nano /etc/my.cnf |
Add the following entries :-
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-locking max_connections=500 query_cache_limit=1M query_cache_size=16M query_cache_type=1 max_user_connections=25 interactive_timeout=10 wait_timeout=10 connect_timeout=10 thread_cache_size=128 key_buffer=16M join_buffer=1M max_allowed_packet=16M table_cache=1024 record_buffer=1M sort_buffer_size=2M read_buffer_size=1M max_connect_errors=10 thread_concurrency=8 myisam_sort_buffer_size=32M server-id=1 local-infile=0 [mysqld_safe] open_files_limit = 8192 [mysqldump] quick max_allowed_packet=16M [mysql] no-auto-rehash [isamchk] key_buffer=32M sort_buffer=32M read_buffer=16M write_buffer=16M [myisamchk] key_buffer=32M sort_buffer=32M read_buffer=16M write_buffer=16M [mysqlhotcopy] interactive-timeout |
Save and Exit and restart mysql service
1 | root@server [~] # /etc/init.d/mysql restart |
Thats it.