Archive | cpanel

Restore multiply Cpanel/WHM backups shell script

#!/bin/bash

BACKUPS=$(ls -al /home/*.gz |awk '{print $9}')

for i in $BACKUPS
do
echo "Restoring $i now...."
/scripts/restorepkg $i
done

Posted in cpanel0 Comments

How to have Custom VirtualHost configurations without being overwritten with cpanel?

Cpanel virtualhost Function

Cpanel will always create apache configration and virtual host by its own template and every domian creation or susspenssion or termination or any thing else related to virtualhost configration of apache if being done will resultin cpanel to recreate apache virtualhost configration that will overwrite other custom modified settings.

Solution to have custom virtualhost configration

so that the cpanel will recreat virtualhost from its template how to have custom virtualhost of some domains configrations?

there is an answer to that question that is to have modified configration on elsewhere and then include it in to that virtual host but there maybe a question came to your mind that as the Cpanel will recreate the virtualhost from its template so that the include will also become overwritten.

Cpanel builtin scripts for including customized virtualhost configration

for this problem cpanle has created a ready made script that will verify your configration that should be inclueded that is

/scripts/ensure_vhost_includes

the step by step to how to do so is in the following

creating custom virtualhost configration step by step

1- create the commented include section directory such as this# Include “/usr/local/apache/conf/userdata/std/2/woshka/woshka.com/*.conf”

to create run

mkdir -p /usr/local/apache/conf/userdata/std/2/woshka/woshka.com/

2-go to that directory

cd /usr/local/apache/conf/userdata/std/2/woshka/woshka.com/

3-creat a config file than should be end by .conf

nano config.conf

4-put your custom config in that config file config.conf

5-run this

/scripts/ensure_vhost_includes --all-users

or with jsut that user

/scripts/ensure_vhost_includes username

you are now finished

for confirmation that everything is fine go to that virtualhost and verify that the included section is uncommented with that custom config name

hope you enjoyed this training

have fun

voshka

# Include “/usr/local/apache/conf/userdata/std/2/woshka/woshka.com/*.conf”

Posted in Apache, cpanel0 Comments

backup and restore Cpanel accounts with command line usnig ssh

Cpanel has ready made scripts that will make your works so easier

such are pkgacct for backing up and restorepkg for restoring individual accounts through command in ssh

First you need to login to the ssh as root

Create Backup of Individual Account

Then use the following command to backup that spicific account:

/scripts/pkgacct username

Notice that the directory that you are in will be used to create backup of that account in there

Restore Backup of Individual Account

To restore

/scripts/restorepkg USERNAME

Please notice that in order to restoreĀ  you need to be on the directory where the backup is located

Posted in cpanel0 Comments

How to have both fantastico running and shell_exec disabled on cpanel?

For security resons not to allow php shells to be able to run on your server you must disable the shell_exec function in the php.ini using disable_functions

but when you do so on the time you want to autoinstall a cms with fantastico within your cpanel as a customer, you will be promted with so manny php errors that are caused because of disabling shell_exec

so how to have both the shell_exec disabled on the server and also be able to run fantastico delux?
there is an answer to that question
you must have a php sepreated for cpanel and have a seprated php.ini for cpanel php functions and php for your websites
in that way you can have both the php.ini containing shell_exec as a disabled function and also not to have any problem with fantastico as it is running on the cpalne with seprated php and php.ini that has shell_exec not disabled(it is enabled)
so to have your cpanel its own php, there is a predefiend scripts comming with cpanel that you can run to make the php jsut for cpanel
first run the following to update cpanel to latest version, making sure you have the lastest apckages available

/scripts/upcp

then run the following to make seprated cpanel php:

/scripts/makecpphp

please be pationt that it will take some times to complete according your server configration and setup.

so you are almost finisshed
the last step is to find out that you do not have shell_exec disabled in your cpanel php.ini
so check the following php.ini files

/usr/local/cpanel/3rdparty/etc/php.ini
/usr/local/cpanel/3rdparty/lib/php.ini

you are done
good luck

Posted in cpanel0 Comments

Free Hosting Manager

about 13 month ago i was looking for a free Hosting manager to manage my accounts, and do the actions such as creating invoices, susspending, terminating accounts in automated mode.

I searched in google and I found “fhm-script.com” which was so cool but was in a bad shape and bad design but was so good for a small company

Description

Free Hosting Manager V2.0 features a new client CP and a forced ads module!
Updated: 13th February 2009

New Features for V2.0

  • Client Control Panel
  • Forced Ads Module (More info)
  • Admin CP – Client Management
  • Support Tickets
  • Manual Install Feature
  • Language Files
  • Template Files
  • Accounting file included
  • Several Bugs Fixed from V2.0

there were also some other free and open-source hsoting manager as I remember such as coin

but lasly I had to buy a billing system rather than geting free open-source systems that may harm my server as they will grant access to the server to do the auotomation things.

so I encourage you to buy a license to use one of the paid version of billing systems.

voshka

Posted in cpanel0 Comments

How to secure tmp the easy way if you have WHM/Cpanel

if you have WHM/Cpanel already installd as a WebHost manager then you will gain this great feture of secureing temp by just running a simple command
just run the following command:

/scripts/securetmp

result:

root@box01 [~]# /scripts/securetmp
Would you like to secure /tmp & /var/tmp at boot time? (y/n) y
Would you like to secure /tmp & /var/tmp now? (y/n) y
Securing /tmp & /var/tmp
/tmp is already secure
/var/tmp is already secure
Checking fstab for entries ...Added fstab entry (/var/tmp)....Done
Logrotate TMPDIR already configured
Process Complete

Posted in cpanel0 Comments

How to install Fantastico on WHM/CPanel using CentOS 5.x or Fedora Core 5.x or 6.x

type the folowing command into ssh

cd /usr/local/cpanel/whostmgr/docroot/cgi
wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz

Posted in cpanel0 Comments

creating backup of accounts in cpanel

It is so much important to have backup at least of a month ago

As no server is 100% secure and even your server may became hacked someday or maybe your server would crashed or even the hard may burned up without any speaking reasons, Having a backup will gelp you in these such situations.

How to Backup Using ssh with WHM/Cpanel Installed

After telling the importance of backup, lets say how to accomplish this in WHM/CPanel

If you want to create backups of the whole accounts go too the backup>configure backups

then set the backup to enable and then set the Date you want to have backup for exmaple daily.

Click on the days that you want the backup to be executed.

after that go to ssh and then run this command

/scripts/cpbackup

or if you are in a case that want to create backup of individual accounts there is no need for those steps I provided earlier

just go to ssh and run this command

/scripts/pkgacct USERNAME

and the USERNAME is should be vary depends on the account you want to create backup for .

for more info about creating backup for individual accounts click the link bellow:

http://woshka.com/blog/cpanel/backup-and-restore-cpanel-accounts-with-command-line-usnig-ssh.html

Posted in cpanel0 Comments


Plese subscribe to my newsletter

Please subscribe via your email to follow me

E-mail:

Subscribe
Unsubscribe