howto: turn off safe_mode in Plesk?

October 10, 2009    |   Posted by admin   |    Category: Plesk Management

How to turn of safe_mode in Plesk? There are 2 ways to turn off safe_mode for a domain in Plesk.

1) From the Plesk control panel.  Login to Plesk >> click “Domains” >> click “domainname.tld”  >> click “WebSite Settings” >> make sure PHP support is checked, but “safe_mode” is  unchecked >> click Save.

2) The second way is to turn off sqfe_mode using vhost.conf file. Create a vhost.conf file under “/var/www/vhosts/domainname.tld/conf/” directory and place the following lines:

<Directory /home/httpd/vhosts/<domain.com>/httpdocs>
php_admin_flag safe_mode off
</Directory>

Now, in order for Plesk to read these changes, execute

/usr/local/psa/admin/bin/websrvmng -a
service httpd restart

You can enable “register_globals” for a domain the same way mentioned in the 2nd step but make sure to execute the 2 commands for the changes to take effect.

Comments Off on howto: turn off safe_mode in Plesk?

-bash: locate: command not found

October 6, 2009    |   Posted by admin   |    Category: Linux Administration

“locate” command is use to index and quickly search for files on your system. If you receive the error message

-bash: locate: command not found

which indicates that the package “slocate” isn’t installed on your server. First check the output of

rpm -qa | grep slocate

if you don’t see any output it states that “slocate” is not installed on your server. You should be able to install slocate using

yum install slocate

as root. Once installed, execute “updatedb” to keep the database up-to-date.

Comments Off on -bash: locate: command not found

pure-ftpd: [ERROR] Configuration error: Illegal load limit: 0

October 6, 2009    |   Posted by admin   |    Category: cPanel Management

If you receive the following error message in the /var/log/messages file while restarting the pure-ftpd service, the problem is in the ftp configuration file at /etc/pure-ftpd.conf

pure-ftpd: (?@?) [ERROR] Configuration error: Illegal load limit: 0

Edit the pure-ftp configuration file and search for

MaxLoad = 0

change it to

MaxLoad = 4    (value should be above 0)

Save the file and restart the service: /etc/init.d/pure-ftpd restart

Comments Off on pure-ftpd: [ERROR] Configuration error: Illegal load limit: 0

Howto: Backup and Restore a database

October 5, 2009    |   Posted by admin   |    Category: Mysql & PostGres SQL

You need to use the “mysqldump” command to backup a Mysql database.

Backup/Dump a Mysql database on a Linux Or Linux/cPanel server:

root@host [~]# mysqldump /var/lib/mysql/dbname > dbname.sql

Restore the .sql file in a database:

root@host [~]# mysql /var/lib/mysql/dbname < /path/to/filename.sql

Backup/Dump a Mysql database on a Linux/Plesk server:

root@host [~]# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` /var/lib/mysql/dbname > dbname.sql

Restore the .sql file on a Plesk server :

root@host [~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` /var/lib/mysql/dbname < /path/to/filename.sql

Howto: repair a mysql table

October 4, 2009    |   Posted by admin   |    Category: Mysql & PostGres SQL

If you receive the following error message on your website, which means the table is crashed.

“Table “tablename” is marked as crashed and should be repaired”

The Mysql table consists of 3 files, .MYI, .MYD and .frm. The .MYI file contains the structure and results in the error message if something goes wrong with it. There are 3 ways to repair the table:

1)  Login to your cPanel, goto “Mysql Databases” option and click “Repair DB” in front of the databases.

2) Login to your server, goto mysql directory /var/lib/mysql and execute the command:              myisamchk -r dbname/tablename.MYI

3) Login to your server, goto Mysql prompt and execute the Mysql query:                                                         repair table tablename;

Anyone of the above 3 steps will repair the table and site will be back online.

Comments Off on Howto: repair a mysql table