Category Archives: System Administration

Changing Nginx Server Name on its HTTP Header

Nginx by default showing its name and also its version depending the configuration.

To change this name we have to edit the source file and recompile Nginx.

Open the file: <nginx source>/src/http/ngx_http_header_filter_module.c

Look for line 49:

and change it to:

Now you need to compile Nginx and restart it to make the changes take effect.

Searching text on multiple files in Linux

To search for certain text inside multiple files in Linux we can use ‘grep’ command, here is how i do it:

So for example you want to find all .php and .conf files inside the directory “config” that contain the word “mysql” the command should look like this:

 

Disable Munin Without Uninstalling It on Cpanel Server

For some reason I want to disable Munin on my Cpanel server but without uninstalling it since I have made some changes which I don’t want to lose by uninstalling Munin.

Disable Munin service

So I start with disabling Munin service by running command:

Next, disable Munin from running on startup:

 Disable Munin’s Cron

Although the service has been disabled but there is a cron that runs every 5 minutes to do updates. This cron can be disabled by editing cron for user munin:

And then edit the cron line by adding “#” in front of the cron line to disable it

Save the changes and that’s it. Whenever I want to re-activate Munin I just reverse the changes that have been done above.

Virtualbox VT-x is not available error after upgrade to 4.3.4

I just upgraded my Virtualbox from 4.2.18 to 4.3.4 on my Windows 7 host, upgrade went smooth and without problem.

When i tried to start virtual machines i got VT-x is not available. (VERR_VMX_NO_VMX) error on all of my VMs.

My PC’s processor doesn’t have VT-x hence the “Acceleration” tab on VM’s Settings > System is greyed out so there is no way i can change it from GUI. Virtualbox does run well on version 4.2.8 so i find it strange that 4.3.4 give error that VT-x is not available.

To fix this i had to run commands from command prompt:

Change <vmname> with the name of your VMs from the list in Virtualbox.

Installing Debian 7 on HP ProLiant ML350 G5

Today i tried to install Debian 7 64-bit on a HP ProLiant ML350 G5 server and having problem with its network card firmware/driver not included with Debian 7 installation CD.

The driver for bnx2 was not included because it’s a non-free firmware/driver, hence i ended with Debian installation without network connection.

After a search on Google, i found another CD image on Debian website which contains non-free firmware/driver that you can find and download here: http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/

Correcting Wrong CPanel’s Nameservers IPs

On CPanel 11.30+ when you go to “Main >> DNS Functions >> Nameserver IPs” and found that the nameservers listed is wrong (this might happen if you just finished doing server migration), you can fix it by following these steps:

1. Make sure that you already update the child nameservers to the new IPs and its fully propagated.
2. Go to “Main >> Server Configuration >> Basic cPanel & WHM Setup” and click on “Assign IP address” button on each of your nameservers. Make sure that the IP being shown on the pop-up window are the correct IP for your nameserver.
3. Login to your server as root and run the script: /usr/local/cpanel/scripts/updatenameserverips to update CPanel nameservers list.
4. Check “Main >> DNS Functions >> Nameserver IPs” again and it should show the correct settings.

Can’t Create or Write on /tmp With Error: No space left on device

I just got a problem with writing error on /tmp on one of my client server. The strange problem is that df -h command shows that /tmp only 35% used so there should be plenty of space to write on.

After some investigation it seems that the /tmp partition hit the number of files limit due to caching files from nginx filling up /tmp, hence it’s not possible to create new files. This problem cause PHP scripts on Cpanel server to show error regarding session as by default Cpanel installation, PHP session are written in /tmp.

Clearing nginx cache files seems to fix the problem. To prevent this from happening again I setup a cron job to clear nginx cache regularly.

Minimum Install VNC Remote Desktop Server on Centos

I wrote an update for an article that i wrote a couple months ago here It’s a tutorial to install VNC on Linux Centos VPS. On that tutorial I was installing the group package of Gnome Desktop which will install all Gnome’s applications including Open Office. This of course requires a lot of space and RAM resources to be run on a VPS which most of the time we don’t need Open Office etc.

My self only use the VNC server that I installed in a VPS located in US datacenter to access some website which only available for US visitors. For browsing purposes I only need Gnome minimum install and Firefox browser and that is what I installed on this tutorial.

You can read my tutorial here: Minimum Install VNC Remote Desktop Server on Centos