Extending Swap space on an LVM


Sometimes it is necessary to add more swap space after installation. For example, you may upgrade the amount of RAM in your system from 1 GB to 2 GB, but there is only 2 GB of swap space. It might be advantageous to increase the amount of swap space to 4 GB if you perform memory-intense operations or run applications that require a large amount of memory.

You have three options: create a new swap partition, create a new swap file, or extend swap on an existing LVM2 logical volume. It is recommended that you extend an existing logical volume.

To do so, perform the following procedure (assuming /dev/VolGroup00/LogVol01 is the volume you want to extend by 2 GB):

1.Disable swapping for the associated logical volume:

# swapoff -v /dev/VolGroup00/LogVol01

2.Resize the LVM2 logical volume by 2 GB:

# lvresize /dev/VolGroup00/LogVol01 -L +2G

3.Format the new swap space:

# mkswap /dev/VolGroup00/LogVol01

4.Enable the extended logical volume:

# swapon -v /dev/VolGroup00/LogVol01

To test if the logical volume was successfully extended, use “cat /proc/swaps” or “free -m” to inspect the swap space.

Apache restarting every 2 hours


Issue: In my server, I could see that the apache is restarting gracefully every 2 hour.

#grep Graceful /usr/local/apache/logs/error_log
[Mon Jan 05 18:16:08 2014] [notice] Graceful restart requested, doing restart
[Mon Jan 05 20:12:53 2014] [notice] Graceful restart requested, doing restart
[Mon Jan 05 22:09:39 2014] [notice] Graceful restart requested, doing restart
[Tue Jan 06 00:06:24 2014] [notice] Graceful restart requested, doing restart

Solution:

Make a backup of the Apache configuration file

# cp -rp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_back

*Login to WHM
*Click Service Configuration
*Click Apache Configuration
*Click Piped Log Configuration
*Check the box labeled Enable piped Apache logs
*Click the Save button

Piped logging is extremely powerful when used correctly, and has far more flexibility than what we are using here. The way it is described here, we will be attempting to negate the memory hungry apache processes that creep up when a server is hosting very low traffic websites (less than 1 request per second) with traditional Apache log configurations.

That’s all…….!!!

JFolder::create: Infinite loop detected in Joomla


Issue : I got the above error while installing and updating new module in Joomla.

solution:

1. First go to your joomla administrator > Global Configuration > System

2. check the “Path to Log Folder ” in system and server tabs.

The “Path to Log Folder ” should be set as wrong path.

3. Please change it to correct path and that will resolve the issue.

That’s all…..!!!

Changing eaccelerator cache directory


Issue :

We know that the default directory for eaccelerator cache is “/tmp/eaccelerator”. In most of the cases, this directory causing the /tmp to fill and that will cause many issues. In such cases it’s better to change the cache directory to another large partition.

Solution:

Use the following command to find cache director specified in “php.ini”‘ file.

# grep eaccelerator.cache_dir /usr/local/lib/php.ini

i.e;

root@tricks[~]# grep eaccelerator.cache_dir /usr/local/lib/php.ini
eaccelerator.cache_dir=”/tmp/eaccelerator”
root@tricks[~]#

Then change it to another directory “/var/eaccelerator” and save the file.

i.e; eaccelerator.cache_dir=”/var/eaccelerator”

Then create the folder “/var/eaccelerator”

# mkdir /var/eaccelerator

After that use the following commands.

#service httpd stop

#rm -rf /tmp/eaccelerator

#service httpd start

That’s all….!!!!

Eaccelerator filling up /tmp folder


Issue:

I have found that /tmp is full and the issue was due to eaccelerator cache. You can check whether the eaccelerator is filling your tmp folder using “du -sch” command.

solution:

Fist check the size of eaccelerator using the following command.

root@tricks[~]# du -sch /tmp/eaccelerator

261M /tmp/eaccelerator
261M total
root@tricks [~]#

You can clear it using the following command.

tmpwatch –mtime –all 336 /tmp/eaccelerator

Now check the size of eaccelerator using “du -sch” command.

root@tricks[~]# du -sch /tmp/eaccelerator
40K /tmp/eaccelerator
40K total
root@tricks [~]#

That’s all……..!!!

Openvz “Container already locked”


Issue : When I try to restart a openvz vps , i got the error “Container already locked”

[root@server ~]# vzctl restart 1005

Container already locked

Solution:

Delete the /vz/lock/VEID.lck file

i.e;

#rm  /vz/lock/1005.lck

Then kill the check point.

#vzctl checkpoint 1005 –kill

Try to restart it now.

If the above solution doesn’t help,please use the following steps.

#vzquota off 1005

Or

#vzqouta drop 1005

Try to restart it now.

That’s all……!!!

 

sh: /usr/local/bin/sendmail-logger: No such file or directory


Issue: I got the above error while trying to send mail from a test php file after enabling mail() function on the server.

sh: /usr/local/bin/sendmail-logger: No such file or directory

Solution:

1.copy /usr/local/lib/php.ini to the user’s document root and change the ownership.

# cp  /usr/local/lib/php.ini /home/username/public_html

#chown username.username /home/username/public_html/php.ini

2.Then edit /home/username/public_html/php.ini

# vi /home/username/public_html/php.ini

Now change the php.ini as described below.

sendmail_path = “/usr/sbin/sendmail -t -i” –> enable this
;sendmail_path = /usr/local/bin/sendmail-logger—> comment this

That’s all………!!!

 

MySQL: Can’t create/write to file ‘/backup/tmp/#sql_3c6_0.MYI’ (Errcode: 2)


Issue: I got this error when accessing the certain pages of drupal website.

MySQL: Can’t create/write to file ‘/backup/tmp/#sql_3c6_0.MYI’ (Errcode: 2)

Solution:

Check the location of tmp directory inside my.cnf and change it to /tmp

1.check mysql config : my.cnf

cat /etc/my.cnf | grep tmpdir

2.If the tmpdir is missing or /tmp is not mentioned there, please add it.

i.e; tmpdir=/tmp to my.cnf under [mysqld]

3.Restart the mysql server

/etc/init.d/mysql restart

That’s all……..!!!!

/usr/sbin/mysqld: Table ‘./cphulkd/logins’ is marked as crashed and should be repaired


Issue : I got the above error from mysql log file and the Innodb on the server is not working.

Solution:

There are several potential reasons why the “cphulkd” database can become corrupted. It’s possible the database was not shut down successfully, or MySQL was killed during a write. The best way to resolve this issue is to simply repair the database.

First check if the cphulkd databse is corrupted using the following command.

#mysqlcheck cphulkd

If the check shows errors, please repair it

# mysqlcheck -r cphulkd

Now try to start mysql on the server with Innodb

That’s all….!!!

Zpanel Insatllation on centos server


zPanel is a php-based free control panel ( free alternative to CPanel) for windows, mac, and linux servers. The program runs on top of an Apache, MySQL, PHP stack on whichever platform is used.

First we need to install pre-required packages:

# yum install wget ld-linux.so.2 curl -y

Then, Download zPanel installer:

64 bit installer

# wget http://www.zvps.co.uk/downloads/centos/10-1-0/installer-10-1-0-centos-64.sh.x.tar.gz

32 bit installer

# wget http://www.zvps.co.uk/downloads/centos/10-1-0/installer-10-1-0-centos-32.sh.x.tar.gz

Then Unzip installer:
64 Bit Installer

# tar -xvf installer-10-1-0-centos-64.sh.x.tar.gz

Or
32 Bit Installer

# tar -xvf installer-10-1-0-centos-32.sh.x.tar.gz

Then, Change the script to be executable:

64 Bit Installer

# chmod +x installer-10-1-0-centos-64.sh.x

Or
32 Bit Installer

# chmod +x installer-10-1-0-centos-32.sh.x

Run the ZPanelX installer:
64 Bit Installer

# ./installer-10-1-0-centos-64.sh.x

Or
32 Bit Installer

# ./installer-10-1-0-centos-32.sh.x

You have to answer few simple questions. The process should take few minutes, so sit tight and wait till it finishes.

At the end of the process you’ll see all generated passwords displayed, write that down. Also, the process requires restarting your server hence you’ll automatically be logged out from your server.

Now open up your favorite web browser then access your server by typing server’s Ip address. The username and Password will generate and display at the final stage of installation

The zadmin, MySQL root & postfix passwords are all stored in /root/passwords.txt after installation.

Blog Stats

  • 37,402 hits