Archive for the “Linux” Category

Apparently there is a bug that affects Plesk versions 9.x to 9.3, however it was addressed in Plesk 9.5. You can identify this bug if you are unable to start or restart your plesk instance. if this happens you will need to view the error log for Plesk, located at “/var/log/sw-cp-server/error_log”.

If you see the following then you are affected by the bug.

2011-11-01 05:03:38: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
2011-11-01 05:03:38: (log.c.75) server started
2011-11-01 05:03:38: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
2011-11-01 05:03:48: (log.c.75) server started
2011-11-01 05:03:48: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
2011-11-01 05:03:48: (log.c.75) server started
2011-11-01 05:03:48: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
2011-11-08 05:00:49: (log.c.75) server started
2011-11-08 05:00:49: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
2011-11-08 05:00:49: (log.c.75) server started
2011-11-08 05:00:49: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
2011-11-08 05:00:58: (log.c.75) server started
2011-11-08 05:00:58: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)
2011-11-08 05:00:58: (log.c.75) server started
2011-11-08 05:00:58: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)

To correct this you will need to download and install a file that is provided by Parallel’s. To do this enter the following on the server that your Plesk instance is located;

wget -c http://kb.parallels.com/Attachments/12669/Attachments/sw-cp-server-1.0-6.201004011105.centos5.i386.rpm

Then you will need to execute the file by running the following command;

rpm -Uhv sw-cp-server-1.0-6.201004011105.centos5.i386.rpm

This will apply the updated files and will allow Plesk to start up again. Please note that the link above is for a 32-bit CentOS 5 OS. If you have different then please refer to the links below to download the correct file for your server.
Once applied you will be able to start Plesk again.

CentOS 5 x86
CentOS 5 x86_64
CentOS 4 x86
CentOS 4 x86_64
RHEL 4 x86
RHEL 4 x86_64
RHEL 5 x86
RHEL 5 x86_64
Fedora 11 x86
Fedora 11 x86_64

Once applied Plesk will be able to be started again.

Comments No Comments »

Swap or Swappiness is the amount of storage that the Linux OS can use as virutal memory, just like how a Windows OS can use storage and use it as virtual memory. This works side by side with your physical memory can comes into play when either the amount of physical memory is exhausted or the percentage of physical memory has hit the swap threshold, which the swap memory can be consumed. However this is also works against the server in the aspect that when swap is used, I/O performance is lowered. This can lead to slower read and writes against the drive, which can impact databases and apache process, and cause your server to halt altogether.

This article will explain how to view the amount of swap that your server can use and how you can adjust this. Please note this article is written for Redhat (Rhel) and Centos OS’s. You will need to make this adjustments using SSH and is recommended for those who are comfortable navigating their server using SSH.

How To View And Adjust Swap

Log into your Linux server using SSH.
Once logged in, run the following command to view the amount of swap that is set to be used. By default, the value of 60 should be returned, memory that swap will take over at 60% of the physical memory being used;

“cat /proc/sys/vm/swappiness”

This tells us that the server will use swap more than the actual physical memory. So what you want to do is change it so the server will use more physical memory than swap. We recommend that this value by changed to 25, which is an optimal value for a server.

Before changing the value, you can test different values on a temporary basis. This way you can see what value gives you a better performance change. To test the values, enter the following;

“sysctl -w vm.swappiness=25″

Once you determine that the following change works for you, you can now make the change permenant.

To change the value, you will need to edit the “/etc/sysctl.conf” file. Since the value is added by default, the entry will not exist in the file, so it iwll need to be added. To do this you will need to open it with a text editor, so for this example we will use VI.

“vi /etc/sysctl.conf”

In the file you will need to add a entry at the end of the file. Add this line;

“vm.swappiness=25″

Be sure to save the change.

Comments No Comments »

Run the following commands to install OpenSSL  on your server:

mkdir /root/setup && cd /root/setup
wget http://www.openssl.org/source/openssl-0.9.8q.tar.gz
tar -xvzf openssl-0.9.8q.tar.gz
cd openssl-0.9.8q
./config
make
make install

*Be  sure you allow all processes to finish gracefully before proceeding.*

Run the following command to verify the installation was successful:

openssl version

This should return the build information for the build you just installed.

Run the following commands to ensure the include files are in the correct place(s):

cd /home/root/openssl/openssl-0.9.8q
cd include/openssl
cp * /usr/include
cp * /usr/local/ssl/include
cp * /usr/local/ssl/include/openssl

Run the following commands to ensure the lib files are in the correct place(s):

cd /home/root/openssl/openssl-0.9.8q
cp lib* /usr/local/ssl/lib/
cp lib* /usr/lib/ ldconfig

You will need to halt the version of OpenSSL your running so WHM doesn’t write over it while compiling Apache. This requires you to exclude it from the yum updates, by altering /etc/yum.conf. The first line of which will read something a long the lines of:

exclude=mod_ssl* httpd* perl mysql* php* spamassassin* kernel* exim* courier* apache*

You need to add OpenSSL to this, which should get it to end up looking more like this:

exclude=mod_ssl* httpd* perl mysql* php* spamassassin* kernel* exim* courier* apache* openssl*

*Do not revert this! If you do, when cPanel runs it’s update, it will overwrite your version of OpenSSL and revert it back to an older instance*

You will then need to rebuild Apache in the normal manor (you can use Easy Apache in WHM or do it manually) using the ‘Apache Update’ link in WHM.

Thanks to Linux.com

Comments No Comments »

Let’s face it, giving out your root password to your Linux server isn’t very smart or security minded. Still there are many of us who provide our root user and before we know it, we’re either looking at a compromise or a permissions issue or worse. Though it doesn’t need to be this way. No… We can create a new user and give them root access or we can edit the abilities of this user.

How does one do this you ask? Simple. In this instance, we’ll setup a new user to have root access, but this works out as we can add the user to the sudoers file, meaning we know who we are giving access to. Heck, you may want to do this for your main user and disable the root user for security reasons, but that’s your call.

Any how, on to the fun stuff!

1. First we need to login to the server, so don’t disable the root user yet, and create a new user. For this example, I’ll make a new user called madtech. So we SSH into the server and type the following;

“useradd madtech”

2. Next we need to add a password for the user, to do this we need to type the following;

“passwd madtech”

It will then ask for us to enter the password and then again to confirm the password.

3. Now that we created the user, we need to edit the sudoers file. Take note we don’t want to edit this with or standard text editors.. no, thats bad. We need to use visudo. Visudo should already be installed on the server. So what we need to do now is goto the following line;

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
We need to add our new user to this file by typing;
madtech  ALL=(ALL)  ALL
And then we press CRTL+X and then Y to save the changes.
4. We’ve just added the user, so know when you log into the server with this new user you can type the following to sudo in and gain admin access;
“sudo -l” or “sudo su -”
This will give the suer root access for the logged in session. If you log out and back in, you need to sudo again.
*******Issues you may encounter*********
So you added the user but when you sudo in, you get the following error:
sudo: must be setuid root
This means there is an issue with the changes to the sudoers file and you need to fix it. But its an easy fix, so relax. All you need to do is log back into the server as the root user again and run the following commands;
“chown root:root /usr/bin/sudo”
“chmod 4111 /usr/bin/sudo”
Now logout as root and login as the new user and then sudo in.  You should now get the default sudo message like the one below or similar, depending on what the MOTD on the server is set to.
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.”

That’s it. Now you can disable that root user, if you choose to!
Tags: ,

Comments No Comments »

If you use cPanel, Plesk or any Linux control panel or Distro, you may notice that your Proftpd connection is either slow or takes some time before it becomes responsive. This is likely due to the Proftpd instance doing a Reverse DNS Lookup and it is having issues doing so. However it is possible to disable this option to help speed up the negotiation. This will not help with slow upload speeds if you have a slow upstream however, please make a note of this.

To disable the DNS Lookups you need to do the following;

1. Log into the server that is running Proftpd. You will need to do so by using SSH.

2. Once you have logged into the server you will now need to edit the Proftpd configuration file. This is called the Proftpd.conf file. You can simply type the following to do so;

“vi /etc/proftpd.conf”

Please note this is the default Proftpd configuration location. If your’s is in a different directory, you will need to adjust the command to your location. In this example we are using VI to make the changes. You are free to also use either Nano or Pico, which ever you feel comfortable using.

3. Once you are in the file, you will need to look for the following lines;

“IdentLookups on”
“UseReverseDNS on”

You will need to turn off the lookup by changing them to the following;

“IdentLookups off”
“UseReverseDNS off”

4. Once you make the changes, save the file. You will then need to restart the proftpd instance.

5. You then will need to restart Proftp. Take note, if you are using Plesk you will need to restart the xinetd service as Proftp runs under this service.

To restart in Plesk, type “service xinetd restart”

To restart in everything else, type /etc/init.d/proftpd restart or service proftpd restart

Tags: ,

Comments No Comments »