Posts Tagged ‘Apache/Httpd’

If your account is hosted on suexec server then you need to add this code in http.conf file otherwise you can enable it by using .htaccess file.

By using  http.conf file

You need to

# Roll your own Rewrite log
# Log details via scale of 1 to 9
# 1 = few details, 5 = enough details, 9 = too much detail

RewriteEngine On
RewriteLog “/home/username/public_html/rewrite.log”
RewriteLogLevel 5

By using  .htaccess file

# Roll your own Rewrite log
# Log details via scale of 1 to 9
# 1 = few details, 5 = enough details, 9 = too much detail
RewriteEngine On
RewriteLog “/home/username/public_html/rewrite.log”
RewriteLogLevel 5

Note : Replace the absolute path for rewrite.log file.

You may come across core files which gets generated within your accounts . The possible reason for the core files getting generated is when a php process is killed, apache creates core files under your account .

On phpSuexec servers this may cause due to incorrect php.ini file placed in your account and if it is caused due to php/apache then you can get rid off those core files by editing the httpd startup file on the server end. Following are the steps to edit httpd startup file.

========================================================
root@server [~]#which httpd
/usr/sbin/httpd
root@server [~]# nano /usr/sbin/httpd

Search for ulimit lines .For eg : you can see these lines

ulimit -n 1024
ulimit -n 4096
ulimit -n 8192
ulimit -n 16384

You need to add ulimit -c 0 at the end .Which will look like :

ulimit -n 1024
ulimit -n 4096
ulimit -n 8192
ulimit -n 16384
ulimit -c 0


Save File
Restart httpd
root@server [~] /etc/init.d/httpd restart

======================================================

Sometimes apache is crashing and all or some PHP pages are showing blank when you browse it. Also apache error logs shows following errors.

====================================
[Thu Dec 24 09:12:03 2009] [notice] child pid 8877 exit signal Segmentation fault (11)
[Thu Dec 24 09:12:38 2009] [notice] child pid 8466 exit signal Segmentation fault (11)
[Thu Dec 24 09:12:38 2009] [notice] child pid 8883 exit signal Segmentation fault (11)

====================================

Solution:

Edit httpd.conf file and add following line in the main config.

===========================
CoreDumpDirectory /tmp/apache2-gdb-dump
===========================

Then create following folder in /tmp and change the permisssion

===========================
root@server [~] mkdir -p /tmp/apache2-gdb-dump
root@server [~] chmod 0777 /tmp/apache2-gdb-dump
===========================

Also make changes in to following file.

root@server [~] nano /usr/sbin/httpd

Search for ulimit lines .For eg : you can see these lines

ulimit -n 1024
ulimit -n 4096
ulimit -n 8192
ulimit -n 16384

You need to add ulimit -c 0 at the end .Which will look like :

ulimit -n 1024
ulimit -n 4096
ulimit -n 8192
ulimit -n 16384
ulimit -c 0

====================================

Stop and start apache server

root@server [~] /etc/init.d/httpd stop

root@server [~] /etc/init.d/httpd start