Archive for the ‘LAMP’ Category

Using mod_proxy to avoid DNS propagation during site migration

There are a number of ways to migrate a site to a new server, whilst avoiding downtime or data concurrency issues. For a highly dynamic site, generally I would edit the old and new site connection strings to both use the same database during switchover.  mod_proxy is a useful method perhaps if a new version […]

Crazy Zend Errors!

Like so: Zend� 2002062301�1�29734�169503�xù Ÿ2 ì½MlgÇu/x›¤ßÉ0 Y|RlÙn·r«n}>=%ÔJ^Ú‹‘”<Ä“1Ãnþ[Í›ìlK­Á´`A›Ù%›L?H XhÀ… kñyÐBh-ò.öh1„EÀ+ƒ0§îg}ž**’¢¸õÿœ[¿:çÔ©SU§ŒSøüﯽ0Û¼9 xÇ´D‘ ÑJUíÜ¿uûæÍ;mnmí÷SxeÜ3ó?Z½ô@÷åŽ,Ëjkvm{w¶ÕOJ÷²)sãOž¼ü7þðÙN½H§ÀzÞ×¾¤¾„¹Žë;þ,úæâ‡Nm „‰êâöþìêáÚ“W¯ÎÀmØ[3C¿¶³wuóp{o×Ì~»{‡k›;;{/϶[û_§ ùúáá­ÿüÛ¿mìÊ•;{‡³«×aùí›WwníÜ>xøw.=ùôåuø¯µõý½µ§ÁöìíÎv×®íí¯]ÚÛ»¹³ùŸÖÈcõc¤Y{¾ðvnÿß7M¾ Ioncube and Zend Optimizer don’t get on.  Ioncube needs to be loaded by PHP first to avoid problems.  Rather than loading them in php.ini, it’s wiser to add their own ini files in /etc/php.d which is then read alphabetically.

Configuring webdav on apache

enabled the mod_dav modules in httpd.conf add the following to vhost.conf <Directory /var/www/vhosts/> DAV On AuthType Digest AuthName “webdav” AuthUserFile “/var/www/vhosts/” require user test </Directory> You can test by: cadaver dav:!> open put,list,edit etc

Disable Track and Trace in Apache

TraceEnable off is available in Apache 1.3.34, 2.0.55 and later Otherwise you will need to add: RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRAC(E|K) RewriteRule .* – [F] to a /etc/httpd/conf.d/zz_020_disable_track_trace.conf and possibly to the individual vhost.conf’s

Apache case insensitive URL’s

If your moving a site from a Windows host to Linux and all of the cases are messed up (Yes Windows is case-insensitive ), you could try to substitute through all the code to make sure the links are the correct case. If your lucky though, enable mod_speling and this should work: # Add the […]

Apache MySQL Authentication

mod_auth_mysql will need to be loaded. in vhost.conf add: AuthType Basic AuthName “Auth required” AuthMySQLHost localhost AuthMySQLUser auth_user AuthMySQLPassword mypassword AuthMySQLDB mysqlauth AuthMysqlUserTable clients AuthMySQLNameField username AuthMySQLPasswordField passwd AuthMySQLPwEncryption none AuthMySQLEnable on require valid-user Then in MySQL: create database mysqlauth; use mysqlauth; CREATE TABLE `clients` ( `username` varchar(25) NOT NULL default ”, `passwd` varchar(25) NOT […]

Apache server status

Add the following to httpd.conf for resource troubleshooting: ExtendedStatus On SetHandler server-status Order deny,allow Deny from all Allow from myipaddress

Allow directory listing in Apache

Simple I know, but I always forget. # Create a .htaccess file Options +Indexes

mod_rewrite 301 redirect

To redirect the entire site, for example to enforce www. , add the following to .htaccess Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$$1 [R=301,L]