Plesk : FTP error “home directory inaccessible”

Login to domain.com via FTP fails for all users. The following error message is displayed:

Cannot log in, home directory inaccessible

CAUSE

There could be several reasons:

1. This happens if the host name is longer than 15 symbols.

2. Domain resolves to a different IP then the one it has been configured for in Plesk.

3. FTP server configuration is broken.

RESOLUTION

1. To change the host name right-click the My Computer icon, choose Properties. Select Computer Name tab then click Change button. Specify the computer name as desired and click OK. When done, restart your computer.

2. Please check if domain.com resolves to the same IP it has been configured for in Plesk. You can use the following command :

nslookup yourdomain.com

The returned IP should be tha same as the one configured in Plesk for the domain.

3. If the name of your server is shorter than 15 symbols and domain resolves to the proper IP it could mean that something is broken in FTP configuration.

You should follow the steps below to fix the issue:

a. Repair permissions on home folders of problem domains. It can be done using the Control Panel:

Plesk , domains, mark problem domain, Click on Check permissions

b. Re-configure FTP configuration using Plesk command line tool ftpmng.exe as follows:

"%plesk_bin%\ftpmng.exe" --remove-vhost --vhost-name=yourdomain.com
"%plesk_bin%\ftpmng.exe" --reconfigure-vhost --vhost-name=yourdomain.com

c. If this issue happens to every domain you can repair FTP configuration for all domains using commands as below:

"%plesk_bin%\ftpmng.exe" --remove-all "%plesk_bin%\ftpmng.exe" --reconfigure-all

semget: No space left on device

This relates to semaphores on your system (you’ve run out). Run the following to clear them out:

ipcs | grep apache | awk ‘{print $2}’ > sem.txt
for i in `cat sem.txt`; do { ipcrm -s $i; }; done;

For cPanel servers :

ipcs | grep nobody | awk ‘{print $2}’ > sem.txt
for i in `cat sem.txt`; do { ipcrm -s $i; }; done;

 

Finally restart Apache :

/etc/init.d/httpd restart

Or 
service httpd restart

 

 

Plesk domain bakups

Here is the steps to backup individual domain on Plesk. I’ve tested. It works.

1) backup the domain

#pleskbackup -v domains yourdomainname.com backupfilename.bkp

2) Then create a map file

#pleskrestore –create-map backupfilename.bkp -map yourmapfilename

map file should be like that below. if not, edit it.

++++++++++++++++++++++++++++++++++++++++++++++++++ +++++

[thisdomain’sclientname] # Client account name

yourdomainname.com 11.22.33.44 # IP address

mysql::@localhost:3306

++++++++++++++++++++++++++++++++++++++++++++++++++ +++++

Then you can restore it with the following command.

#pleskrestore –restore backupfilename.bkp -level domains -map yourmapfilename

This backup will back up everything including mailboxes and database.

How can I restore the Plesk psa database from a backup?

The following example shows how to restore the mysql.preupgrade.dump.gz backup file.

gunzip /var/lib/psa/dumps/mysql.preupgrade.dump.gz

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e”DROP DATABASE psa;”

mysql -uadmin -p`cat /etc/psa/.psa.shadow` < /var/lib/psa/dumps/mysql.preupgrade.dump

Actually standard daily backup file includes three databases:

* psa

* horde

* mysql

That is why the following error message will appear when you performed the latest command:

ERROR 1050 at line 3165: Table ‘horde_categories’ already exists

This happens because only the “psa” database was restored. However, if you want to restore all

three databases, then you have to delete them using “DROP DATABASE” sql command.

Also, make sure that you are always restoring the latest backup file.

Fatal error: Allowed memory size of 123456 bytes exhausted (tried to allocate 234567 bytes) in /path/file.php

Php is setup is to limit memory usage per process. If you require more, this limit can be increased.
Edit

/usr/local/lib/php.ini

If you are unsure about the php.ini path, You can find your server php.ini using command :

php -i | grep php.ini

Configuration File (php.ini) Path => /usr/local/lib

Loaded Configuration File => /usr/local/lib/php.ini

and set:

memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)

to a higher value, like 20M. Save, exit, then restart apache.