HostOnNet Blog

Category Archives: Apache

Redirect users to Mobile Version or Desktop Version of Websites Based on Device using Apache mod_rewrite

Since the massive rise of smartphones and tablets like the iPhone, iPad, Android phones and tablets, BlackBerries, etc. you might have considered creating a mobile version of your web site. This tutorial explains how to configure Apache to serve the


How to Install Mod_Gzip with Apache

mod_gzip is an Internet Content Acceleration module for the popular Apache Web Server. It compresses the contents delivered to the client. There is no need to install any additional software on the client! If you are having difficulties with getting


Password Protect a Folder with .htaccess

To password protect a folder in Apache, create a password file [root@server12 ~]# htpasswd -c /path/to/.htpasswd admin New password: Re-type new password: Adding password for user admin [root@server12 ~]# This is create a password with user user “admin”. This file


Disable Unused Apache Modules

On server12 Apache installation, i commented out following modules, that is not required for web server. #LoadModule ldap_module modules/mod_ldap.so #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so #LoadModule dav_module modules/mod_dav.so #LoadModule status_module modules/mod_status.so #LoadModule info_module modules/mod_info.so #LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule userdir_module modules/mod_userdir.so


Enable Apache Mode Rewrite in ubuntu

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


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

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


Apache serve blank page for static files in cifs mount

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


mod_secdownload for Apache

mod_secdownload is a lighttpd module that provide secure download of files. The file download link expire after specified amount of time. This is very usefull for file hosting and video sharing sites to prevent bandwidth stalers (hotlinking of files). mod_auth_token


Invalid command BytesLog

On Cpanel server after OS reload, can’t start apache, it shows following error Invalid command ‘BytesLog’, perhaps mis-spelled or defined by a module not included in the server configuration The problem is fixed by installing mod_log_bytes cd /usr/local/cpanel/apache /usr/local/apache/bin/apxs -iac