Archive

Archive for August, 2010

MySQL tuning on cpanel servers

August 20th, 2010

MySQL Web Hosting

MySQL Web Hosting

Sometimes we need to tune or optimize mySQL server configuration for better performance.

Before making any changes, I strongly recommend that you back up the file, so that you can restore it in case the service does not restart or any other problem happens:

Use the following Config for my.cnf.

1. Take backup of existing config with
cp /etc/my.cnf my.cnf.bak

2. vi /etc/my.cnf

3. Remove the whatever entry are there.

4. Add the following.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_user_connections=25
max_connections=500
interactive_timeout=10
wait_timeout=10
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
myisam_sort_buffer_size=64M
old-passwords = 1

[mysql.server]
user=mysqlbasedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quickmax_allowed_packet=16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

And restart mysql on server.
# /scripts/restartsrv_mysql

MySQL and databases

Search Engine Friendly URL for Joomla not working with suPHP

August 7th, 2010

Joomla-sites from an old server to my new webserver with suPHP the search engine friendly urls didn’t work anymore.
The main problem was that the layout was disappeared for all sites other than the main site.

In the source code of such a page I found that all CSS files had a wrong referral url:
/index.php/awards/big_awards
instead of
awards/big_awards
for example.
The starting “/index.php” should not be there.
Also in other links in these page a “/index.php” too much is in the links.

The issue was solved by entering a value for the variable
var $live_site = '';
in the configuration.php:
var $live_site = 'http://www.example.com';

Soruce:

http://www.vanachteren.net

Cpanel Basics