Posts Categorized: apache

cPanel: Adding Apache and PHP Modules

I needed to add mysqli support to cPanel and did so by logging in to the WHM on port 2087 scrolling down the left menu to Software and clicking EasyApache (Apache Update) then followed the steps to recompile with my chosen options. Continuing with the default options were necessary and ticking MySQL Improved Extension This… Read more »

IntegraTUM Web Disk

I decided to test IntegraTUM Web Disk which can provide a web interface to Samba shares, and just to get a demo working I did the following – these are not necessarily the best options for actual deployment.The first problem I had with this app was setting the tmp directory and I eventually used:                <param-name>uploadpath</param-name>               … Read more »

certwatch

Certwatch checks for Apache certificates which are due to expire. By default on Red Hat / Centos there is a cron job in /etc/cron.daily which runs and sends its output to root. To configure it: vi /etc/sysconfig/httpd Add a line such as: CERTWATCH_OPTS=”–period 30 –address my.user@domain.tld” It is also possible to switch it off with:… Read more »

MS Office 2007 Formats in Apache

In Apache 2 I added the following to stop Internet Explorer trying to open these formats as compressed archives (which they actually are) and to open them using the MS Office appliations: AddType application/vnd.ms-word.document.macroEnabled.12 .docm AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docxAddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotxAddType application/vnd.ms-powerpoint.template.macroEnabled.12 potmAddType application/vnd.openxmlformats-officedocument.presentationml.template potxAddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppamAddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsmAddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsxAddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptmAddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptxAddType application/vnd.ms-excel.addin.macroEnabled.12… Read more »

Apache Server Status OPTIONS *

Checking the Apache server-status page I noticed multiple lines like the following: 29-39 – 0/0/3162 . 32.26 8949 0 0.0 0.00 186.48 123.111.123.111 mywebsite.co.uk OPTIONS * HTTP/1.0 30-39 – 0/0/10 . 0.00 24324 0 0.0 0.00 0.04 123.111.123.111 mywebsite.co.uk OPTIONS * HTTP/1.0 The access_log for that website also showed: 123.111.123.111 – – [18/Nov/2009:09:28:44 +0000] “OPTIONS… Read more »

Redirecting Mobile Web Users

There are a few potential methods for this, but the first worked fine for me.1. Apache Mod_Rewrite RewriteEngine On#redirect mobile browser using HTTP_ACCEPT headerRewriteCond %{HTTP_ACCEPT} “text/vnd.wap.wml|application/vnd.wap.xhtml+xml” [NC]RewriteCond %{HTTP_HOST} “!m.yourmobileurl.com” [NC]RewriteRule (.*) http://m.yourmobileurl.com/$1 [L]#some high-end phone sometimes support HTML, only its sucks#add more browser user agent sig hereRewriteCond %{HTTP_USER_AGENT} (nokia|symbian|iphone|blackberry) [NC] RewriteCond %{HTTP_HOST} “!m.yourmobileurl.com” [NC]RewriteRule (.*)… Read more »

Apache DirectoryMatch for Intranet-Style Access

I needed to ensure that within a rather large directory structure any directory named ‘intranet’ was only accessible by internal IP addresses. Although from a security perspective this is not truly intranet it is what I was asked to do./var/www/vhosts/mydomain/httpdocs/ represents the DocumentRoot for the virtual host.  This will protect /any/path/with/intranet/in/the/name – so intranet is… Read more »

Apache DirectoryMatch for Intranet-Style Access

I needed to ensure that within a rather large directory structure any directory named ‘intranet’ was only accessible by internal IP addresses. Although from a security perspective this is not truly intranet it can help protect some pages./var/www/vhosts/mydomain/httpdocs/ represents the DocumentRoot for the virtual host.  This will protect /any/path/with/intranet/in/the/name – so intranet is in there… Read more »

Apache LDAP Authentication to Active Directory

I was testing authentication against Active Directory (LDAP) using Apache 2. The following worked for me in a .htaccess file but only after adding: LDAPVerifyServerCert Off in the main httpd.conf file. I presume this is related to the server name in the SSL certificate on the Active Directory server. AuthBasicProvider ldapAuthzLDAPAuthoritative OffAuthLDAPURL ldaps://adserver.prefix.tld.co.uk:636/DC=prefix,DC=tld,DC=co,DC=uk?sAMAccountName?sub?(objectClass=user)AuthLDAPBindDN “CN=someuser,OU=some ou,OU=another… Read more »

Install LAMP on Ubuntu

For local development to install Apache, MySQL, PHP: apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql phpmyadmin Configuration files are in /etc e.g./etc/apache2/etc/php5/etc/mysql/etc/phpmyadmin Deamons are started by default so just visit http://localhost An alternative is to use Tasksel: sudo tasksel install lamp-server