Do you ever wonder that how to setup CentOS (RedHat) Linux server startup service and how the services running?
With CentOS, you may use the command named chkconfig to configure your startup services.
First of all, you need to understand what is Linux runlevels, for more information, you may refer to the URL below,
In this example, let say we could like to set the runlevel at 2, 3, and 5 with httpd (Apache).
To enable the services in startup,
# chkconfig httpd --add
# chkconfig httpd on --level 235
To check which runlevel you have set,
# chkconfig --list httpd
To disable the startup,
# chkconfig httpd off
Linux Operating System that powered by Linux kernel have an advanced disk cache algorithm that used to store frequently access data from Hard disk.
This is to explain why some Linux server’s RAM still getting high memory usage even you upgrade your RAM.
To find out how much memory using by the Linux-based server, you may use the linux command “free” to track it. To get the detailed/actual memory usage, you may run the following command from your Linux box.
You should get some result as below,
total used free shared buffers cached
Mem: 15905 2879 13026 0 384 900
-/+ buffers/cache: 1593 14311
Swap: 3999 0 3999
With the result above, you may see that the used memory is 2879MB and free memory is 13026MB. However, the cached memory is 1593MB while the actual free memory will be 14311MB.
If you get your web hosting services from foreign country and you might want to change the server time zone to your location in Linux server, use the following script.
To set your time zone to LA, US time zone, use the following command,
rm -f /etc/localtime
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
It is not my first time to install PHP to the Linux server, but I am always not remember the error and which packages should install to get away the error.
So I am sharing some error code with the packages needed as below.
Error: Configure: error: xml2-config not found. Please check your libxml2 installation.
yum install libxml2-devel
Error: Checking for pkg-config… /usr/bin/pkg-config configure: error: Cannot find OpenSSL’s
yum install openssl-devel
Error: Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
yum install mysql-devel
Error: Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
yum install unixODBC-devel
Error: Configure: error: Cannot find pspell
yum install pspell-devel
If you still remember Mick Genie ever post on how to monitor RAM/Memory on Linux earlier from http://www.mickgenie.com/monitor-rammemory-on-linux/, you should have an idea on the basic command to monitor Linux server.
Today I would like to share some useful monitoring tools from Linux box. With Linux monitoring tools, it uses to analysis and debugging the Linux box.
1. Top Process
– Top process is the most used by the Linux user as it come with many useful information such as it’s server load, memory, iostat, etc.
With top command, it do comes with some hotkey.
t – Displays summary information off and on.
m – Displays memory information off and on.
A – Sorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a system.
f – Enters an interactive configuration screen for top. Helpful for setting up top for a specific task.
o – Enables you to interactively select the ordering within top.
r – Issues renice command.
k – Issues kill command.
z – Turn on or off color/mono Continue reading Useful Linux Monitoring Tools
When you are using cPanel cron services, you might found out the cPanel services down without any clue.
With this article, Mick Genie will guide you how to check your crond services by using cPanel chkservd services.
cPanel offer chkservd services to automatically monitor daemon services from the Linux server.
To done this, follow the step as below.
1. Open the file /etc/chkserv.d/crond, pico /etc/chkserv.d/crond
2. Add the command as below to the file.
3. Open the file /etc/chkserv.d/chkservd.conf, pico /etc/chkserv.d/chkservd.conf
4. Add command below to last line of the above file.
5. Restart chkservd services, /scripts/restartsrv chkservd
With Apache Linux box, sometimes you might get lots of file named core.xxxx where xxxx is some number. You might wonder what is these file.
Normally core.xxxx file was generated from Linux box and holds the current state of a process working memory when a process is crashed. To read the file, run the command as below from your shell.
From the strings reading, each line represent different state of a process.