Wednesday 3 December 2014

Invalid Mutex directory in argument file:/var/lock/apache2

Invalid Mutex directory in argument file:/var/lock/apache2

I am using Ubuntu 14.04 TLS. When I change the owner of a web application from my user to user running apache then, I got the following error. AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf: Invalid Mutex directory in argument file:/var/lock/apache2 One of the reason why this happens is that when the user is changed then the apache could not reload the environment variables. Technically, apache is unable to source the environment variables again. So, we have to source the environment variables for apache. source /etc/apache2/envvars After you have sourced the environment variables for apache, stop AND start apache; do not reload/restart. sudo /etc/init.d/apache2 stop sudo /etc/init.d/apache2 start Then check as described below: sudo apachectl -t This should give output as Syntax OK. The problem is then solved.


Problem with 2 config files for same virtual host

Error 500 in .htaccess: php_value not allowed here in Ubuntu 14.4TLS

I added the following 2 lines in my .htaccess file. Suddenly, my site started showing HTTP error 500 Internal Server Error. php_value max_input_vars 2000 php_value post_max_size 20M

After browsing through internet, I specified AllowOverride All to the VirtualHost I was using for the site. Actual setting specifically for this purpose is AllowOverride FileInfo. Since the distribution of LINUX that I was using is Ubuntu 14.4 TLS, the apache build had 2 directories namely-
1. conf-available 2. sites-available Both had .conf files for my VirtualHost folder; my mistake. I unlinked the .conf file in the conf-available folder. Executed the following commands. sudo a2disconf ..../conf-enabled/vhost_config_80.conf sudo unlink ..../conf-enabled/vhost_http_config_80.conf sudo a2dissite ..../sites-available/vhost_http_config_80.conf sudo a2ensite ..../sites-available/vhost_http_config_80.conf sudo /etc/init.d/apache2 stop sudo /etc/init.d/apache2 start This solved the problem. The site was up and 500 Internal Server Error was solved. Moral of the story: Never keep 2 configuration files for the same purpose on a web server.