Archive for the “Technology Related” Category

So I’ve taken upon myself to learn PowerShell, seeing that I deal more and more with Vmware’s ESX/ESXi and that I want to get better at it. Now I’ll admit, I was never one for scripting, let’s face it.. I hate it! I’m a system administrator who dislikes scripting. Surely there are more of people like me out there, or at least I hope so.

That said I’m working on it, I know I’m going to be losing my mind on it, but such is progress. So I’d appreciate it if any who is well versed in PowerShell scripting and wouldn’t mind tossing a few links or resources to me.

I’ll need it ;)

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 »

If you are getting the following message, this basically means that your cPanel server’s Hostname is not properly setup and the server is failing to look it up;

IMPORTANT: Do not ignore this email.

The hostname (hostname.server.com) resolves to . It should resolve to xx.xx.xx.xx. Please be sure to correct /etc/hosts as well as the ‘A’ entry in zone file for the domain.

Some are all of these problems can be caused by
/etc/resolv.conf being setup incorrectly. Please check this file if you
believe everything else is correct.

You may be able to automaticly correct this problem by using the
‘Add an A entry for your hostname’ under ‘Dns Functions’
in your Web Host Manager

Until you correct this, you will constantly be bombarded with messages, so it’s probably best if you resolve this. But how you ask? Simple.

The first thing you need to do is log into your cPanel server and make sure the Hostname is a FQDN. By default its likely some random computer name or hosting account number if you rent / lease from a webhost provider. To this check this scroll down the left hand Functions Menu until you find the heading ‘DNS Functions’. Click on ‘Add an A entry for your hostname’. WHM will try to analyze your hostname and then present you with a button to click that says Add the entry, go ahead and click on that. WHM should automatically try to add the relevant A record for your hostname to the DNS zone present on your system. Best practice is to make the Hostname a subdomain of your FQDN, so for example if I wanted to do this for Keithdmitchell.com, I would make my Hostname cpanel.keithdmitchell.com or something to that affect. Then I would add an “A” record to my DNS zone pointing back to the server with the same IP address.

Once you have done this, log into your server via SSH / Shell and run the following command;

“/scripts/ipcheck”

If the hostname change was either incorrect or did not address the issue, you will receive an email stating that the hostname is still resolving incorrectly. This usually corrects the issue, but in the event it does not, you will want to also make sure that your name servers are also correct. To check your name servers, you will need to check your “/etc/resolv.conf” file. Open this up in a text editor such as Nano, Pico or VI and make sure that they have entries in them. They should look like the following;

search myserver (this should be your domain name, also may not be present in your config)

nameserver 98.59.5.1
nameserver 56.51.96.1
If you aren’t sure what you name server’s IP’s are, ask your webhost / ISP. If you are running your own name servers, they would be what ever IP address you assigned them and they must be external accessible IP’s and not internal. If they look like this, then they are incorrect;
search myserver (this should be your domain name, also may not be present in your config)
nameserver 127.0.0.1
nameserver 192.168.0.1
If you still aren’t sure about your name servers, simply do a DNS lookup on your domain to find out what they are. I recommend using Http://www.network-tools.com.
Assuming you added a correct hostname and your name servers are correct, your issue will be resolved!
Tags: , ,

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 »

I can’t stress this point enough and it’s good to see that this was published in an article. Bluelock has published an article entitled, “Common Myths When Architecting Distributed Systems” and it address several well known myths in the computer hosting industry, including one point that I agree with 100%;

“Myth #2: If you need to speed up your application, just add more machines
There is a big difference between speed and throughput. Speed is how fast an operation can be executed, while throughput deals with how many operations you can perform in a given time.

If you have a stored procedure that takes 30 seconds, adding two servers won’t change a thing. You can add RAM to prevent disk access, attempt to add cores and multi-thread the process or increase the speed of your storage tier, but unless you break the stored procedure into several smaller procs you cannot spread the workload effectively across a farm.

A great use case of horizontal scalability is raw HTTP traffic. When it comes down to the number of simultaneous worker threads that need to be available a sea of HTTP servers behind a nice, robust load balancer that performs MAC re-writing can make a huge difference.”

YES YES YES! If you are having a application / software issues, throwing more resources at the issues is likely not going to help! Of course there are always exceptions to this, but for the most part this is 100% correct.

You can read the entire article by going here.

Comments No Comments »