Howto: enable HTTP Compression

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

How to enable HTTP Compression? In order to enable compression, you will need compression modules compiled with Apache. Apache 1.x needs mod_gzip and Apache 2.x need mod_deflate compiled with it.

If  you have these module installed, you need to edit your Apache configuration file locate at “/etc/httpd/conf/httpd.conf” file and add the following lines to it:

<Location />
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI  \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
</Location>

Save the file and restart the httpd service. This will compress all the files except the .gif, .jpe, .jpeg and .png files.

Related URLs:
How to enable http compression on a Plesk server?

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