Archive for the ‘Apache’ Category

httpd is not working: Unable to open logs

root@server# /etc/init.d/httpd restart Warning: DocumentRoot does not exist httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Solution :– root@server [~] netstat -lnp | grep ‘0.0.0.0:80’ tcp        0      0 0.0.0.0:80       […]

httpd is not working : semget: No space left on device

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_msql.dll’ – /usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_msql.dll: cannot open shared object file: No such file or directory in Unknown on line 0 semget: No space left on device Solution :– ipcs -s for i in `ipcs -s | awk ‘/nobody/ {print $2}’`; do (ipcrm -s $i); done OR ipcs -s […]

Maximum file limit reach while starting Apache?

Maximum file limit reach error is occur while we are starting the Apache server at that time you can fix the issue by using root login details. root@gunjan[~]#pico /etc/sysctl.conf Add following line as fs.file-max = 22992 Save and exit from the file. You need to run following command from shell to active changes. root@gunjan[~]#sysctl -p […]

Starting Apache HTTPD Failed Cannot Open or No such file mod_bwlimited, mod_log_bytes or mod_bandwidth

On restaring Apache, you may get the following error: Nov 21 09:31:40 web httpd: Cannot load usr/local/apache/libexec/mod_log_bytes.so into server: /usr/local/apache/libexec/mod_log_bytes.so: cannot open shared object file: No such file or directory Nov 21 09:31:40 web rc: Starting httpd: failed Invalid command ‘BytesLog’, perhaps mis-spelled or defined by a module not included in the server configuration This […]

Configure Apache to listen multiple ports

The listen directive in the Apache configuration file can be used to make Apache to listen in a particular port or IP address or port combination. Listen 80 Listen 8000 In this format the Apache server listens on the given ports on all interfaces (IP addresses) which are up in the server. If you mention […]

Apache Error: Unable to open logs

Sometimes apache will fail to start. It will show the following error message in apache error logs: Unable to open logs This is because of the low number of file descriptors. Check the current limit of file descriptors in the file /proc/sys/fs/file-max: $ cat /proc/sys/fs/file-max 1024 If fs.file-max is quite small (several thousands or so), […]

Apache failed to start with the “No space left on device” error.

If you receive the following error while restarting Apache in the server, you need to do the following steps. Error:- [error] (28)No space left on device: Cannot create SSLMutex Configuration Failed These errors means that there is no available IPC (inter-process communication)  resources in the system, such as semaphores or shared memory segments. You need […]

Disable mod_security2 for a single domain

Mod_security is an open source Apache module. This can be considered as firewall for web applications. It secures the system from the attackers. We use mod_security1 for Apache1.x and Apache 2.x uses mod_security2. In case of mod_security1, we can disable it for a domain using the .htaccess file. If you want to disable mod_sec for […]

Bash Script to Check Apache Memory Usage

We might have come across many situation where we need to find the memory usage by apache and which script or from which directory this process is being called. You can use the script given below to find that and log it whenever the load goes beyond a threshold value. Which also help us to […]

Run Apache and lighthttpd on port 80

Lighthttpd is the webserver which will help to increase the speed with a small memory consumption. Now, I assume that you have already installed both apache and lighthttpd in the server. The main thing should be noted here is we need to have 2 IP in the server so that only we can run both […]