Archive

Archive for February, 2009

How To Update Maximum Number Of Mysql Connections On Linux

February 20th, 2009 No comments

There is often necessary to increase the maximum number of MySQL connections in order to prevent “Too Many Connections” error. If you’re on LAMP, you’re welcome to follow one of these ways:

For a temporary solution you might want to execute the following query:

SET GLOBAL max_connections = 500;

This will increase max_connections directive to 500, but will work until MySQL is restarted. If you’re seekining for a permanent solution, the following strings should help you.

First of all, you need to locate my.cnf file. It is usually located at /etc/my.cnf. You’re welcome to create it if it does not exist as there usually are some sample files in the /etc.  Then you need to put the following string:

[mysqld]
max_connections = 500

If you already have a [mysqld] section, then you just need to add the string related to max_connections. Else, if you’re using a blank file, you should copy and paste the code above.

When the file is saved, you’re welcome to restart MySQL in the way you like as these changes will be applied after restart. Acommon command to do this is service mysqld restart.

Hope this helps you to maintain your server with a good number of MySQL connections

How To Find The Version of Linux You Are Using

February 12th, 2009 No comments

Sometimes you need to know what version of the Operating system is installed on your server. This is extremely useful when you order a dedicated server and want to know what is the version of OS on it. A simple command will help you as usual:

cat `ls /etc/*{-,_}{release,version} 2>/dev/null | head -n 1`

This will show you something like

The picture below shows the difference between common commands: one shown above and uname -a. Sometimes you don’t need the kernel version, just the operating system name. This command should help you to do that.

Designing Lampdocs Logo: A Much Better Solution

February 11th, 2009 No comments

Recently I got an e-mail telling me that a logo for my site has been created. I was really surprised when I heard this, and the second surprise was that the logo looks very nice.

This seems to be much better that all previous concepts. WE have already decided to change the strategy of logo creation and I think we’ll show you a completely different solution soon. Bu the way, this logo was created by Ron Goyette. I think he will be glad to talk to you if you contact him for logo design :)

Have a nice day and expect a completely different Lampdocs soon! I won’t tell you much, but I hope I will be able to amaze :)

PHP Deletes Angle Brackets While Parsing HTML: How to Solve

February 7th, 2009 1 comment

Today I’ve faced a problem that was quite strange. One of my WordPress installations refused to understand posted angle brackets. This was especially related to tags and the encoded symbols like > < and so on. I started to think what I did before :) .

The issue is described at PHP Bugs.  There is no exact solution there that’s why I decided to create this guide.

I’ve found that the issue was found after a recent PHP update using Directadmin custombuild script. I’ve got all recent software, but PHP doesn’t recognize simple symbols. My first thought was that the problem is with XML interpretation, that is especially related to libxml2. I’ve followed Directadmin forums and thought the problem is with libxml2 version.  I’ve tried to update it to version 2.7.3. There was no success as the problem still continued to persist.

#cd /usr/local/directadmin/custombuild
#wget http://xmlsoft.org/sources/libxml2-2.7.3.tar.gz
#tar -zxvf libxml2-2.7.3.tar.gz
#cd libxml2-2.7.3
#./configure –with-iconv=/usr/local
#make
#make install

This step itself doesn’t help, but you need to do it in order to fix the entire problem.

The second step you need to make is to build php with libexpat. In order to do this, you will need to perform the following steps:

- install expat-devel by entering  yum install expat-devel.

- add expat support to your PHP build. In order to do this (I assume you’re using custombuild to build PHP), you have to edit /usr/local/directadmin/custombuild/configure/ap2/configure.php5–with-libexpat-dir=/usr is the string you need to end to your current file contents.

expat adding to php

Then you need to update  the PHP version in /usr/local/directadmin/custombuild/versions.txt to 5.2.8 (most current version at the moment). After that you have to build PHP again.

cd /usr/local/directadmin/custombuild
./build php

There is no need to build anything but PHP that’s why I’ve said No to all other proposals (like cURL, Freetype, etc).  As Apache is restarted automatically, you just have to wait while the build process is complete. After that you’re welcome to enjoy your new PHP installation.