Tag Archives: manage

crontab

NAME
crontab – maintain crontab files for individual users (V3)
SYNOPSIS
crontab [ -u user ] file
crontab [ -u user ] { -l | -r [ -i ] | -e }

EXAMPLE
Stamp output about crontab file:
crontab -l

Modify crontab with default editor:
crontab -e

How to use vhost.conf in Plesk

Maybe you need to do some specific configurations for a domain or subdomain and you tried to do directly in httpd.include file. You saw that it works for the momment but plesk will delete again your specific configurations from this file. So, in this case the answer is vhost.conf file. This file will be placed inside your domain’s conf directory, usually found at /var/www/domain.com/conf. Create a file called vhost.conf in whatever editor you prefer.

Modify Plesk skel for each vhost.conf
If you want modify configuration for all domains, then you must create vhost.conf in .skel directory:
mkdir /var/www/.skel/0/conf/
emacs /var/www/.skel/0/conf/vhost.conf

Modify vhost.conf for one domain
If you want modify configuration for one domain, the you must create vhost.conf:
emacs /var/www/onedomain.net/conf/vhost.conf
Modify vhost.conf for one subdomain
If you want modify configuration for single subdomain, the you must create vhost.conf:
emacs /var/www/onedomain.net/subdomain/siglesubdomain/conf/vhost.conf

Edit vhost.conf
If you want modify safe_mode directive to off in onedomain.net, then you could create vhost.conf into /var/www/onedomain.net/conf/:

<Directory /var/www/onedomain.net/httpdocs>
<IfModule mod_php4.c>
php_admin_flag safe_mode off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag safe_mode off
</IfModule>
</Directory>

Now, you need to tell Plesk to update it’s information.
You have to run:
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=onedomain.net

this will configure plesk only for one single domain, in this case domain.com
If you want to configure it for all sites run:
/usr/local/psa/admin/bin/websrvmng -a

After this command if you look to httpd.include file, will see that your httpd.include will have an include line for your vhost.conf, something like this:
Include /srv/www/onedomain.net/conf/vhost.conf

There is also a vhost.conf file for subdomain in their DocumentRoot directory, if you want to do some specific things for subdomain.

Now, you must restart apache:
apachectl -t
apachectl graceful

Reference: vioan.ro, deec.it

Installing a SSL Certificate in Plesk

Add a SSL Certificate to a website using Plesk it is simple: it is important to know Plesk version because it is different among differente releases.
Plesk 9

  1. we first login to Plesk and navigate to the domain you wish to install the Certificate on to
  2. enter into the configuration of the target domain
  3. click on SSL Certificates
  4. click on Add SSL Certificate
  5. if you already have a SSL Certificate then you can skip this step and go to step 8. Any details:
    1. Name the certificate. This can be named anything that you choose. You could use a descriptive name including a timestamp like YYYYMMDDRR format where RR is the revision number (00 in this case as there are no revisions for the same day)
    2. Make any needed adjustments to the SSL Request. This information will be embedded in the SSL Certificate and should be similar to the domain registration information
    3. The email address should match one of the email addresses in the domain whois information provided by your domain registrar
    4. Falsified information may be rejected by your SSL Certificate Authority.
  6. now enter back into the Certificate configuration
  7. you can now review the CSR and Private Key. Save the Private Key in a safe location. Should anything occur with your server that the certificate must be re-entered you MUST have at least the Certificate and Private Key. Take the CSR and submit it to the Certificate Authority of your choice
  8. once you have received the Certificate from your Certificate Authority you can paste it into the Certificate text area. If your Certificate Authority requires, you may need to paste their own Certificate into the CA certificate text area (often called a CA Bundle)
  9. if the Private Key does not match the Certificate then you will see a page similar to this. You MUST have a matching Private Key and Certificate in order to use a Certificate
  10. once installed you will see CSR, Private Key and Certificate. These three all match up and are ready to be used
  11. now you will navigate back in to the Web Hosting Settings from the Domains configuration
  12. select the corresponding Certificate and click OK at the bottom

Plesk 9.5
Previous steps do not work. Certificate must be adding into Global Configurations and not into single domain configuration.

  1. we first login to Plesk and enter into the Global Configuration
  2. click on SSL Certificates and follow steps (about Plesk 9) from 4 to 10
  3. now you will navigate back in to the IP addresses
  4. you need exclusive IP addresses for domains with SSL certificates. Enter into IP address about your website to apply the SSL Certificate
  5. select SSL Certificate (choose name about certificate newly created)
  6. select domain and save
  7. follow last steps (about Plesk 9) 11 and 12

The new certificate is now being used for the domain. If you have updated the certificate then you may need to completely close out of your browser before the new certificate is used.

Reference: modularmerchant.com, parallels.com

How to insert into plesk new db and user db manually

If you are a maniac of the shell but you need to work with plesk. If you’re not the only one to administer the db and who is not a practical use plesk.
If you created the db via shell are in use and can not stop their use. It is good that the db and db users you entered manually, are also present in plesk.

The process is very simple. Plesk uses three tables:

mysql> desc accounts;
+----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| type | varchar(32) | NO | | plain | |
| password | text | YES | | NULL | |
+----------+------------------+------+-----+---------+----------------+
mysql> desc db_users;
+------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| login | varchar(16) | NO | | NULL | |
| account_id | int(10) unsigned | NO | MUL | NULL | |
| db_id | int(10) unsigned | NO | MUL | NULL | |
+------------+------------------+------+-----+---------+----------------+
mysql> desc data_bases;
+-----------------+------------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+------------------------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(63) | NO | MUL | NULL | |
| type | enum('mysql','postgresql','mssql') | NO | | mysql | |
| dom_id | int(10) unsigned | NO | MUL | NULL | |
| db_server_id | int(10) unsigned | NO | MUL | NULL | |
| default_user_id | int(10) unsigned | YES | | NULL | |
+-----------------+------------------------------------+------+-----+---------+----------------+

So you can add, for each database, the following lines:
mysql> insert into accounts values(id,'plain','dbUserPassword');
mysql> insert into data_bases values(id,'dbName','mysql',idDomain,idDbServer,idDbUser);
mysql> insert into db_users values(id,'dbUserName',idAccount,idDb);

How to migrate objects from Parallels Plesk Panel version 7.5 or 8.6 to Parallels Plesk Panel 9

Plesk Migration Manager (PMM) does not exist in Parallels Plesk Panel Beta, Plesk 9 Release and the first patch 9.0.1.
The feature is under development now and will be available in the next version of Parallels Plesk Panel 9.2.

However it is still possible to migrate objects from Parallels Plesk Panel versions 7.5, 8.6 manually using Plesk Backup Manager.

You may migrate Parallels Plesk Panel as a whole or separate domains and clients. Below are the instructions.

1. Migrate server

a. Login to a source server with Parallels Plesk Panel 8.6 installed and create a full backup with the pleskbackup utility:

~# /usr/local/psa/bin/pleskbackup all

The utility is included into the psa-backup-manager package for Plesk 8.6, verify that it is installed.

In Parallels Plesk Panel 7.5 the command line backup utility is /usr/local/psa/bin/psadump that is included into psa-bu package.

If not installed you may install Plesk Backup Manager via Autoinstaller in control panel Server -> Updater

b. Copy the dump to the destination server with Parallels Plesk Panel 9 and convert the backup to version 9 with pre9-backup-convert.

~# /usr/local/psa/bin/pre9-backup-convert -v convert -d /var/lib/psa/dumps/

Where /var/lib/psa/dumps/ is Backups directory on the destination server with Parallels Plesk Panel 9.

This will create a number of backup XML files and subdirectories with data under /var/lib/psa/dumps.

c. Login to Parallels Plesk Panel as administrator and change to the server backup repository:

Home -> Backup Manager -> Server Repository

There is a list of backup files in the server repository.

d. Click the backup name to enter the Backup Details page.

e. Select the required restoration options and click Restore to start the restoration process.

Note: you should check the Administrator’s clients option to restore all clients and domains from the backup.

2. Migrate client

a. Login to the source server and create a backup of clients you want to migrate or full server backup with pleskbackup:

~# /usr/local/psa/bin/pleskbackup all

or

~# /usr/local/psa/bin/pleskbackup clients CLIENT.LOGIN

b. Copy the dump to the destination Parallels Plesk Panel 9 server and convert the backup to version 9 with pre9-backup-convert.

~# /usr/local/psa/bin/pre9-backup-convert -v convert -d /var/lib/psa/dumps/

This will create a number of backup XML files and subdirectories with data under /var/lib/psa/dumps.

c. Login to Parallels Plesk Panel as administrator and create a new client with the same login of migrated client.

d. Then access local backup repository of the new client:

Clients -> CLIENT NAME -> Backup Manager

Because the login of newly created client coincides with the login of client from the dump the converted backup should be shown in the repository.

e. Click the backup name to enter the Backup Details page.

f. Select the required restoration options and click Restore to start the restoration process.

3. Migrate domain

a. Login to the source server and create a backup of the domain you want to migrate or full server backup with pleskbackup:

~# /usr/local/psa/bin/pleskbackup all

or

~# /usr/local/psa/bin/pleskbackup domains DOMAIN.NAME

b. Copy the dump to the destination Parallels Plesk Panel 9 and convert the backup to version 9 with pre9-backup-convert.

~# /usr/local/psa/bin/pre9-backup-convert -v convert -d /var/lib/psa/dumps/

This will create a number of backup XML files and subdirectories with data under /var/lib/psa/dumps.

c. Login to Parallels Plesk Panel as administrator and create a new domain name that coincides with name of the migrated domain from backup.

d. Then access the local backup repository of the domain:

Domains -> DOMAIN.NAME -> Backup Manager

Because new domain name coincides with domain from the backup the converted backup should be shown in the repository.

e. Click the backup name to enter the Backup Details page.

f. Select the required restoration options and click Restore to start the restoration process.

Before migrating from Parallels Plesk Panel 8.1, 8.2, 8.3, 8.4 you should upgrade the source Parallels Plesk Panel to the latest version 8.6.

To migrate objects from Parallels Plesk Panel version 7.5 using Plesk Backup Manager you should create a backup on the source server 7.5 with the utility /usr/local/psa/bin/pleskdump, convert it to version 8 with utility backup-convert and then convert to version 9 with pre9-backup-convert.

Refer to the article Is it possible to restore Plesk 7.5 backup on Plesk 8.x system? for details about how to convert backup to version 8.
After that you may restore the backup through Backup Manager in the control panel.

Alternatively you may migrate from 7.5 to 8.6 using Plesk Migration Manager, create a backup via Parallels Plesk Panel 8.6, convert it to 9 with pre9-backup-convert and restore on destination Parallels Plesk Panel 9.

Reference: parallels.com