Archive for the Apache Category

Enable Apache Mode Rewrite in ubuntu

Posted on September 18, 2009 with No Comments

You need to run “a2enmod rewrite” to enable apache mod_rewrite.

hon@hon-desktop:~/web$ sudo a2enmod rewrite
Module rewrite already enabled
hon@hon-desktop:~/web$

In my case it was already enabled, still .htaccess was not working.

It was the default site, so i need to edit

sudo vi /etc/apache2/sites-available/default

Find

<Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
</Directory>

In that find

AllowOverride None

Replace with

AllowOverride All

Now restart apache

/etc/init.d/apache2 restart

libphp5.so: cannot enable executable stack as shared object requires: Permission denied

Posted on August 17, 2009 with No Comments

On starting Apache, i got following error

[root@localhost apache2]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.d/zendserver_php.conf: Cannot load /usr/local/zend/lib/apache2/libphp5.so into server: /usr/local/zend/lib/apache2/libphp5.so: cannot enable executable stack as shared object requires: Permission denied
                                                           [FAILED]
[root@localhost apache2]#

This is because SELinux. You need to disable it by editing /etc/selinux/config

vi /etc/selinux/config

Find

SELINUX=enforcing

Replace with

SELINUX=disabled

Restart server.

You can disable selinux run time with command “setenforce 0″, this will be lost on reboot, so you need to edit /etc/selinux/config for disabling permanently.

[root@localhost apache2]# setenforce 0
[root@localhost apache2]# service httpd start
Starting httpd:                                            [  OK  ]
[root@localhost apache2]#

Apache serve blank page for static files in cifs mount

Posted on June 6, 2009 with 3 Comments

We use Linux guest on WMware as development web server.

Files are stored in a windows share. This share in mounted inside DocumentRoot of apache web server.

Today i have to reinstall web server as it created some disk issue after a HDD fail.

After reinstall, static files (css, images, videos) when accessed, serve a blank file. If we save the file, we get a file of 0 byte size.

This is fixed by setting

EnableSendfile off

in /etc/httpd/conf/httpd.conf file.