Apache: service httpd does not support chkconfig

As you know, when you installed your Apache service to your Centos/Redhat server manually (make & make install but not yum) and could like to run the service automatically, you should copy the apachectl from the Apache bin folder to /etc/init.d/ folder as named httpd.

Then you might want to set the chkconfig and facing the error as below,

service httpd does not support chkconfig

To fix this issue, you may simply add the following line to your file at /etc/init.d/httpd.

#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf

Then you may chkconfig again,

chkconfig --level 235 httpd on

And now restart your httpd service.

cPanel exim: The server has reached its limit for processing requests from your host

If you get the error like,

451-The server has reached its limit for processing requests from your host.n451 Please try again later.

You may easily fix it by changing your exim configuration.

First of all, log into the WHM and look for Exim configuration Editor. Then look for Advance Editor.

Then you should find something like,

smtp_accept_max = 100

Change it to higher value like 200 and save it.

In case the setting is hide and not able to change from WHM, you may change it from SSH with path as below,

/etc/exim.conf

Howto: Password protected a folder from Apache .htaccess

To protect a folder from your website, you may actually use the htpasswd feature available from the server.

To create a password protected folder to /home/user/public_html/important with user named admin, run the following command.

[root@server ~]# htpasswd -c /home/user/public_html/.htpasswd admin
New password:
Re-type new password:
Adding password for user admin
[root@server ~]#

Then, add the following code to your .htaccess file located at /home/user/public_html folder.

AuthUserFile /home/user/public_html/.htpasswd
AuthName "important"
AuthType Basic
Require valid-user

Now, access to your folder with the credential created.

WordPress Plugin: P3 (Plugin Performance Profiler)

Feeling your WordPress apps slower and slower? As using too much plugin from your WordPress is actually reducing the website performance, you may now use WordPress plugin named P3 which stand for Plugin Performance Profiler.

To install P3, it is simply easy,

  1. Log into your WordPress admin.
  2. Click Plugins.
  3. Click Add New.
  4. Search for P3.
  5. Click Install Now under “P3 (Plugin Performance Profiler)”.
  6. Activate the plugin.
To start profile your website, you may start scanning the website.
And it will just take less than a minute to calculate the performance from your WordPress website.
Next, you could understand the statistic from the result.
P3 do support email the report of your performance test where you may forward the result to your webmaster.

Understand Linux-based RAM and it’s cache

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.

free -m

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.

Redirect domain without www to www with web.config

Aside

It is been long time user keep on asking how to redirect the domain name with www only from their website.

To get this fixed from IIS web.config file, you may copy the following script to your web.config file to redirect them from without www to www.

<rule name="www redirect" enabled="true" stopProcessing="true">
    <match url=".*" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^[^\.]+\.[^\.]+$" />
        <add input="{HTTPS}" pattern="off" />
    </conditions>
    <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" />
</rule>
<rule name="www redirect https" enabled="true" stopProcessing="true">
    <match url=".*" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^[^\.]+\.[^\.]+$" />
        <add input="{HTTPS}" pattern="on" />
    </conditions>
    <action type="Redirect" url="https://www.{HTTP_HOST}/{R:0}" />
</rule>

With the above code, it will redirect you without www to www even you have https configured.

/dev/null is not a character device

If you get error like “/dev/null is not a character device!”, do not panic. It is because you have set  the value /dev/null set to a folder/file or anything else.

To overcome this issue, remove the /dev/null first.

rm -f /dev/null

Next, create the /dev/null as character device.

mknod /dev/null c 1 3

Now, you have done and you may check if it is created correctly.

root@server [~]# ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 Dec  6 15:59 /dev/null

 

Understand Linux runlevels

runlevels is the term that the mode of operation running in one of the computer operating system that running with Unix box.

With runlevels, it determine what should be running from the system boot or operation. runlevel is typically come with level 0-6 though it do have 0-9 or 0-10 and even S as a level.

Typical Linux runlevel come with code below,
0 – Halt
1 – Single-User mode
2 – Multi-User mode
3 – Multi-User mode with networking
4 – Not used/user definable
5 – Start from system normally with appropriate display manager
6 –  Reboot

Apps Sharing: Cut The Rope Web Version

After sharing about the Angry Bird Web Version, today I discovered Cut the Rope Web Version as well.

It is free to play!!

Basically, it come with 18 games with this browser for all of the browser, if you are using Windows 7 with IE browser, you may drag om nom to your taskbar to allow you get extra seven games.

Enjoy the game!