Move Data from Slaved Drive – Plesk

First you will want to set up subscriptions for the domains in the plesk panel. Once they are created you can run the commands below:

Here are a few commands that should help.

1.) rsync example. This will move the data from one drive to the other.


rsync -avz /mnt/slave/var/www/vhosts/"domain name"/httpdocs /var/www/vhosts/"domain name"/httpdocs

You will want to change the “domain name” to the one you are working on at the time.

2.) Changing ownership:


chown -R "ftpusername":psacln /var/www/vhosts/"domain name"/httpdocs/*

You will want to change the “ftpusername” to what you set up for each domain when creating the subscription.

If the sites are simple, these are the only 3 steps you should need to take for each domain.

Update:

I would use the rsync command rather than cp. Rsync will keep permissions the same. The command would look something like:


rsync -aPSv /mnt/olddrive/var/www/vhosts/domain.com/httpdocs/somedirectory/ /var/www/vhosts/domain.com/httpdocs/restoredirectory/

You can also preview what will be synced by adding –dry-run to the command. This doesn’t actually copy anything, just shows you what’s going to happen e.g.


rsync -aPSv /mnt/olddrive/var/www/vhosts/domain.com/httpdocs/somedirectory/ /var/www/vhosts/domain.com/httpdocs/restoredirectory/ --dry-run

The databases are in /mnt/olddrive/var/lib/mysql

One thing you might try is to stop mysql, change datadir in /etc/my.cnf to /mnt/olddrive/var/lib/mysql, then restart mysql and dump your databases. Then stop mysql, revert datadir back and restart mysql again.

When MySQL is running using the slaved drive as the datadir, you can use this to log in to MySQL:


mysql -uadmin -p`cat /mnt/olddrive/etc/psa/.psa.shadow

alternately you can set skip-grant-tables in the /etc/my.cnf file until you have things running again.

You can either dump your databases as one file or as separate files for each DB – http://www.commandlinefu.com/commands/view/2916/backup-all-mysql-databases-to-individual-files

Plesk Configuration Error

I get this message in plesk. I’m not sure how to fix the errors

New files of configuration for Apache web server were not built due to errors in configuration templates: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf:

Sometimes this has something to do with the config generation and it can give you more info if you try running the reconfiguration from the commend line.

You can do this by running

/usr/local/psa/bootstrapper/pp11.0.9-bootstrapper/bootstrapper.sh repair

And


/usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Plesk 10 and later versions:


# /usr/local/psa/admin/bin/httpdmng --reconfigure-domain <domain_name>

Plesk 9 and earlier versions:


# /usr/local/psa/admin/bin/websrvmng --reconfigure-vhost --vhost-name=<domain_name>

Note: Replace with the actual domain name.

If the issue occurs for all domains, you could run this command:

Plesk 10 and later versions:


# /usr/local/psa/admin/bin/httpdmng --reconfigure-all

Plesk 9 and earlier versions:


# /usr/local/psa/admin/bin/websrvmng --reconfigure-all

Plesk Failed Upgrade

Failed to update Panel. To solve this problem, you can send the update log to Parallels support. View the update logs (June 18, 2014). View the update logs (June 19, 2014). Copy the logs to your computer before you close this message. To close this message, click here.

Plesk log shows:

ERROR: Failed to run the Yum utility.
The Yum utility failed to install the required packages.
Attention! Your software might be inoperable.
Please, contact product technical support.

Resolution:

Check for the atomic repo and disable it.

cd /etc/yum.repos.d/
nano atomic.repo
# Name: Atomic Rocket Turtle RPM Repository for CentOS / Red Hat Enterprise Lin$
# URL: http://www.atomicrocketturtle.com/
# Note: This isn't covered by ASL support. -Scott
[atomic]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com
mirrorlist = http://www.atomicorp.com/mirrorlist/atomic/centos-6-$basearch
#mirrorlist = http://www.atomicorp.com/channels/atomic/centos/6/mirrors-atomic
enabled = 1
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
gpgcheck = 1

Set enabled = 1 to enabled = 0
Then run:


yum update --enablerepo=atomic atomic-release

This should resolve the error.

Or…

/usr/local/psa/admin/sbin/autoinstaller --select-release-current --reinstall-patch --install-component base

or…


yum upgrade atomic-release 

Other resources: http://kb.odin.com/en/116189

public_html directory not showing in ftp

A user could not show the public_html directory on a cpanel server. Run the following to see how many files are listed in the directory.

cd /home/username
ls|wc -l
10050

This folder has 10500 files. The settings for ftp do not allow a full directory listing. We removed the files that were not needed and ftp worked.

Also this is a setting in /etc/pure-ftpd.conf

nano /etc/pure-ftpd.conf
# 'ls' recursion limits. The first argument is the maximum number of
# files to be displayed. The second one is the max subdirectories depth

LimitRecursion 10000 8

To change this – change the line amount in the first number and restart ftp

LimitRecursion 11000 8
service pure-ftpd restart

To change the ftp maximum number of files on plesk.

nano /etc/proftpd.conf
ListOptions -a maxfiles 2000 maxdepth 3

Restart xinetd

 service xinetd restart

This configures the -a option by default, and limits the maximum files in the generated listing to 2000. If the client uses the -R option, proftpd will not recurse into directories more than 3 levels deep when generating the listing.

Change Ownership of Files and Folders

To change the ownership of files and folders in a directory. For a plesk httpdocs directory that runs fastcgi. For apache – you will want to change this to apache:apache.

Change directory

cd /var/www/vhosts/domain.com/httpdocs

Find who owns the files and folders.


ls -la
[root@austin httpdocs]# ls -la
total 20
drwxr-xr-x  3 mungoadmin psacln 4096 Jun 11 14:16 .
drwxr-xr-x 22 mungoadmin psacln 4096 Jun 11 14:13 ..
drwxr-xr-x  2 root       root   4096 Jun 11 14:16 anotherdir
-rw-r--r--  1 root       root      6 Jun 11 14:14 test1.txt
-rw-r--r--  1 root       root     10 Jun 11 14:15 test2.php

You see that some files/directories are owned by root:root an some by mungoadmin:psacln. We will want to change this to be the ftp user in plesk – which is mungoadmin:psacln.

To change this run the following (Warning – make sure you are in the directory you want to change all the files/directories in):

[root@austin httpdocs]# chown -R mungoadmin:psacln *

Now – look at the changes

[root@austin test]# ls -la
total 20
drwxr-xr-x  3 mungoadmin psacln 4096 Jun 11 14:16 .
drwxr-xr-x 22 mungoadmin psacln 4096 Jun 11 14:13 ..
drwxr-xr-x  2 mungoadmin psacln 4096 Jun 11 14:17 anotherdir
-rw-r--r--  1 mungoadmin psacln    6 Jun 11 14:14 test1.txt
-rw-r--r--  1 mungoadmin psacln   10 Jun 11 14:15 test2.php


Plesk Email Size Error

When changing the email from 100MB to 500 for the emails in the domain the following error:


Incorrect limit value was specified. 

Under the subscription settings, you would need to increase the maximum size for the mailbox. If you attempt to make the limit for a mailbox higher than the current max mailbox setting for the subscription you will encounter that error. If the subscription is owned by a reseller, the reseller limit must also be increased.

Fast CGI Upload Error

[stextbox id=”warning”]mod_fcgid: HTTP request length 16779013 (so far) exceeds MaxRequestLen (16777216), referer[/stextbox]

Getting an error on a plesk server witht he site running fastcgi and the upload times out or you get an error:

mod_fcgid: HTTP request length 16779013 (so far) exceeds MaxRequestLen (16777216), referer:

Source: http://kb.parallels.com/en/114842

Cause

The FcgidMaxRequestLen directive was changed from 1GB to 128KB in the mod_fcgid package, causing the limit to be triggered in many cases (source).

Resolution

The issue has been fixed since version 10.4.4, patch version = “43.”
It is fixed by setting MaxRequestLen to 15MB.
Consider upgrading your Parallels Plesk Panel installation.

Workaround

1. Change the value of MaxRequestLen in domainVirtualHost.php template.

Important: Do not change the default template. To introduce your changes to the configuration, copy the  /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php file to the /usr/local/psa/admin/conf/templates/custom/domain directory and then modify the copied file. See KB #115277 for more information.

2. Reconfigure domains:

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Remove SSL default Cert on Plesk 11.0.9

Log into mysql.

mysql -uadmin -p`cat /etc/psa/.psa.shadow`


mysql> select dom_id,certificate_id from hosting where dom_id=13;
+--------+----------------+
| dom_id | certificate_id |
+--------+----------------+
| 13 | 0 |
+--------+----------------+
1 row in set (0.00 sec)


mysql> SELECT * FROM IP_Addresses;
+----+---------------+-------------+---------------+-------+--------------------+-------------------+-------+------+--------+
| id | serviceNodeId | ip_address | mask | iface | ssl_certificate_id | default_domain_id | ftps | main | status |
+----+---------------+-------------+---------------+-------+--------------------+-------------------+-------+------+--------+
| 1 | 1 | 192.168.0.3 | 255.255.255.0 | eth0 | 2 | 0 | false | true | 0 |
+----+---------------+-------------+---------------+-------+--------------------+-------------------+-------+------+--------+
1 row in set (0.00 sec)


mysql> UPDATE IP_Addresses SET ssl_certificate_id = 0;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0


mysql> SELECT id, name FROM certificates;
+----+---------------------+
| id | name |
+----+---------------------+
| 1 | |
| 2 | default certificate |
| 3 | default certificate |
+----+---------------------+
3 rows in set (0.00 sec)


mysql> quit
Bye

Reconfigure


[root@DS29440 ~]# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Restart Apache


[root@DS29440 ~]# service httpd restart

Generate and Install SSL in Plesk

You can generate the CSR and Private Key in Plesk itself by following the steps listed below, after that is done you will follow the second set of steps to upload the SSL and CA bundle provided to you from your SSL provider.

For Plesk 11.5

How to request a CSR in Plesk
1. Log into your Plesk control panel.
2. Click on “Domains” on the left hand side.
3. Find the domain in the list you wish to generate the CSR for, then click on “Manage Hosting” on the right hand side of the domain.
4. Click on the domain name in big bolded letters ( it should say “Hosting Settings” right next to the place you want to click).
5. Click on “Secure Your Sites”.
6. Click the “Add SSL Certificate” button.
7. Once there, fill out the information for “Certificate Name” (typically this is the name of the domain and the year/month the SSL has been issued, so that it makes it easier to figure out when the SSL will need to be renewed and how long it is good for) and under “Settings” (This would be your company’s information).
8. Once that is all filled out, click the “Request” button, this will generate the CSR and private key for that specific domain.
9. After the CSR is generated it should appear underneath the text boxes that you can use to upload a certificate, you will copy all of this and provide it to the SSL provider.

How to install a SSL Certificate in Plesk.
1. Log into your Plesk control panel.
2. Click on “Domains” on the left hand side.
3. Find the domain in the list you wish to install the SSL for, then click “Manage Hosting” on the right hand side of the domain.
4. Click on your domain name that you are trying to generate the CSR for, it will be in larger bolder letters with “Hosting Settings” right next to it, however you will want to click on the domain name itself.
5. Click on “Secure Your Sites”.
6. Find the SSL in the list that you added to generate the CSR so that you could get the SSL.
7. Once there, either upload the certificate documents that the SSL provider has given you, or if you have the text (which you can get by opening the files provided to you in a text editor) you can copy and paste them into the text boxes. After doing so you would either click “Send Text” or “Send File”.
8. Next you will need to ensure the new SSL is active for the domain, you will go back to click on the domain name in big bolded letters ( it should say “Hosting Settings” right next to the place you want to click), and click the “Hosting Settings” that were next to the domain.
9. On this page towards the middle of it you should see a “Security” section, if the “SSL Support” box is not checked you will need to check here, and then from the certificate dropdown menu you would select the new SSL that you uploaded and then select “OK” at the bottom of the page.

For Plesk Onyx:

Or follow these plesk articles:
What you would want to do is first generate a CSR in Plesk and provide that to your SSL provider. To do that you would follow this article first:
https://support.plesk.com/hc/en-us/articles/213939845-How-to-generate-certificate-signing-request-CSR-for-a-domain-in-Plesk

Then they would give you the SSL to install on the server. For that you follow this article:
https://support.plesk.com/hc/en-us/articles/213946825-How-to-install-SSL-certificate-for-a-domain-in-Plesk

Domain Masking

Domain Masking (a.k.a. Blind Forwarding) is using a domain name to display a different domain, but still shows the original domain’s name in the address bar.

Generally, this is considered a bad idea and not good for SEO, but it is possible.
Plesk
(Applies to 10 – 11.0)

In order to forward a domain blindly, you will create it in Plesk as you would any other domain, only select the Hosting Type as Forwarding, then select “Frame Forwarding” to spoof the domain name to your your domain name.

Domains > domainname.com > Websites & Domains
Scroll to the bottom of the page and click the domain name
Locate the Hosting type and click ‘Change’
Now select Forwarding and Frame Forwarding.