How to move an account from one Cpanel server to another Cpanel server via Backend (Shell)
Basic steps
1. Create a .tar file (backup) of the account in the old server.
2. Copy it to the new server using scp.
3. Untar (restore) in the new server.
1. Create a .tar file (backup) of the account in the old server.
To create a tar package of the account you have a Cpanel script.
/scripts/pkgacct ‘username’
Executing this script will create a username.tar.gz file in your /home directory. You can copy this to the new server.
2. Copy it to the new server using SCP
scp user@IP:/home/username.tar.gz user@IP:/home/
3. Untar (restore) in the new server
Login to the new server using ssh and execute the script.
$ cd /home ; /scripts/restorepkg ‘username’
Apache failed to start with the “No space left on device” error.
If you receive the following error while restarting Apache in the server, you need to do the following steps.
These errors means that there is no available IPC (inter-process communication) resources in the system, such as semaphores or shared memory segments. You need to check IPC resources which are used in the server using ‘ipcs’ command:
$ ipcs -a
…
—— Semaphore Arrays ——–
key semid owner perms nsems
0×00000000 201293824 apache 600 1
You will be able to see a lot of semaphores under Apache . You need to kill those processes using the following script and restart apache.
$ ipcs -s | grep apache | perl -e ‘while (<STDIN>) {@a=split(/\s+/); print `ipcrm sem $a[1]`}’
Run Apache and lighttpd on same port 80
In a short description, lighttpd is a *ligthy* webserver which helps to increase the site load speed with a small memory consumption.
Now, I assume that you have already installed both apache and lighttpd in the server.
The main thing should be noted here is we need to have 2 IP’s in the server so that we can run both apache and lighttpd in the same port but on specific and dedicated IP addresses.
Go to apache configuration (CentOS/Fedora/RHEL: /etc/httpd/conf/httpd.conf) and locate the “Listen” directive.
Once you are there, you will probably see “Listen :80″ which tells apache to listen on ALL the interfaces. You will need to change this to make apache listen on just one of your IP addresses ie:
Pick one for apache and do the same for the lighttpd configuration(CentOS/Fedora/RHEL: /etc/lighttpd/lighttpd.conf) but in this case use the other free IP address.
Now, restart apache and then lighttpd. You can try to access IP in browser and make sure both are listening on port 80.
How to increase the MaxClients value greater than the current HARD_SERVER_LIMIT set for Apache.
1. Check if there is any hard server limit.
/usr/local/apache/bin/httpd -V | grep HARD_SERVER_LIMIT
2. Look for this directive in the Apache’s header file /usr/local/apache/include/httpd.h
3. Edit this file and increase the HARD_SERVER_LIMIT as per your requirement.
4. Recompile Apache using
5. There you will have an option to increase the Apache HARD_SERVER_LIMIT, since easyapache looks for the header files and sees the new value while build. By default the MaxClients value will be 256.
Once the build completes, you can see the new HARD_SERVER_LIMIT.
How to Install DDoS Deflate
When you run this Perl script, it will then run an netstat command check how many times each IP is connected and if there are more then the number of connections you specified then it will automatically run a command in APF for the IP to be banned.
Installing:
wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh
Uninstalling:
wget http://www.inetbase.com/scripts/ddos/uninstall.ddos
chmod 0700 uninstall.ddos
./uninstall.ddos