Posts

Showing posts with the label apache

500 Internal Server error with codeigniter mysql connection

I was trying out CodeIgniter  today. I found it quite lightweight and easy to get started with. MVC was fine until I came across a strange issue. Every time I tried to connect to the database, I would end up getting the infamous "500 Internal server error". Unfortunately, even after checking through all http logs, I was not able to trace it to anything that could've gone wrong. I had apache, php, mysql installed and configured correctly. Spent about 4 hours trying out different configurations, playing around with the database names, model names, etc, just to realise later that I did not have the php-mysql driver installed! This time I was on an ubuntu machine, so I had to: apt-get install php5-mysql and then although I could see that apt-get had already restarted apache2 for me, I just thought of doing it myself as well, service apache2 restart and there it was. Everything was working the way I wanted it to be. It was a very silly thing to miss out on this one. I have don...

Proxy Error 502 “Reason: Error reading from remote server” with Apache 2.2.3

I had a setup of tomcat running on port 8080 and Apache proxying for tomcat on port 80. If I tried to access webapps directly from tomcat on port 8080,. they were accessible, while on port 80, I would get the followig error: Proxy Error 502 “Reason: Error reading from remote server” with Apache 2.2.3 following fix worked: adding retry=1 acquire=3000 timeout=600 Keepalive=On after the Proxy directive in the http configuration.

Class 'DOMDocument' not found error in Drupal 7

Thought of trying out Drupal 7 after a long time, as much as I had used Drupal 6, I was expecting Drupal 7 to work out of the box for a system which was previously running Drupal 6.I noticed that, for some reason, there were these error messages in my httpd logs: [Wed Jul 25 17:40:13 2012] [error] [client 127.0.0.1] PHP Fatal error:  Class 'DOMDocument' not found in /home/ausmarton/Public/website/drupal-7.7/modules/filter/filter.module on line 1041 Now, since I had worked quite a bit with version 6, I knew that all that needs to be done was this: yum install php-xml and /sbin/service httpd reload  And it did work! Well, so it looks like besides the usual php extensions like php-gd, php-mysql and others, Drupal 7 also needs php-xml to be able to work properly. EDIT: I've tried this with PHP 5.3.11 on Apache 2.2.21.

Apache forbidden by SELinux and access permissions

This post is a very trivial one, but it's just that I've found myself ignoring these things time and again. Every time I need to setup a new system for development in PHP or Drupal, I've ran into almost all of these small "issues". I would always prefer to have the working copy of the code somewhere in my home directory , and maybe have it symlinked from the directory which is set as my "Document Root" in Apache. # cd /var/www/html # ln -s ~ausmarton/Public/website/drupal-7.7 drupal Assuming, everything is set up and will work, I go ahead to access the application in my browser, just to find out that all I can get is a big "Forbidden"  message. Now, this happens because, in linux, to be able to access the contents of a directory, you should have the 'x' permission. But, unfortunately, home directories are by default set not to be accessible by anyone other than the designated user. drwx------. 37 ausmarton ausmarton  4096 Aug 25 17:08 a...