Keeping Services Alive with Monit

Posted 233 days ago | 0 Comments

On CentOS install monit as follows: 1yum install monit Make sure it starts automatically: 1/sbin/chkconfig –levels 235 monit on The main configuration file is at /etc/monit.conf but this file loads in any files under /etc/monit.d which is where we will place our files. First comment out the following sections in /etc/monit.conf as we will be [...]

Continue Reading

Image data does not exist. Please re-upload the image

Posted 453 days ago | 1 Comments

I had this error message when uploading images in WordPress. Image dimensions were set to 0×0 and the thumbnails did not appear. A quick scan of the Apache logs PHP Warning:  copy(/var/www/vhosts/thedomain.com/httpdocs/wp-content/uploads/thephoto.jpg): failed to open stream: Permission denied in showed me that I needed to correct the permissions on the /wp-content/uploads directory to allow Apache [...]

Continue Reading

LAMP Performance

Posted 456 days ago | 0 Comments

The following scripts can help in determining good values for Apache and MySQL configurations based on the amount of memory available: MySQL Tuner Apache Tuner Apache Buddy The following will give  a list of Apache Modules loaded: apachectl -t -D DUMP_MODULES The following will give the memory usage of Apache: #!/bin/sh # apache_mem.sh # Calculate [...]

Continue Reading

Apache Protect Multiple Locations

Posted 461 days ago | 0 Comments

The configuration directive below is one I used to protect multiple URLs with a htpasswd file. So match (~) /url01/ or (|) /url02/ or (|) …. <Location ~ “/url01/|/url02/|/rfinlay1/|/cgribb5/|/lgrw01/|/ahll7/|/cki3/|/ele02/|/mm24/|/cmcc78/|/jmc8/|/gmc1/|/mmy82/|/eoa1/|/cs01/|/pr5/|/ln50/|/rc1/|/hd01/|/a05/|/e1/|/ss12/|/mm6/|/s75/|/gp01/” > AuthUserFile /etc/httpd/conf/.htpasswd-file AuthName “Restricted Access” AuthType Basic Require valid-user </Location>

Continue Reading

Apache GeoIP Country Detection

Posted 575 days ago | 0 Comments

Creating customised content based on the origin country of your website visitors requires installing the mod_geoip module for Apache and also the MaxMind GeoIP database as follows (on CentOS): mkdir ~/geoip cd  ~/geoip wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz tar xzf GeoIP* cd GeoIP* ./configure make make check make install cd .. wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz tar xzf mod_geoip2_1.2.5.tar.gz cd mod_geoip2_1.2.5 [...]

Continue Reading

LAMP on Ubuntu

Posted 619 days ago | 0 Comments

There are several different commands that can be used to install Apache and MySQL services with PHP support: sudo apt-get install tasksel && sudo tasksel sudo apt-get install lamp-server^ sudo apt-get install apache2 libapache2-mod-php5 php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-curl mysql-client mysql-server libmysqlclient15-dev phpmyadmin   For number two the carat at the end is important.

Continue Reading

cPanel: Adding Apache and PHP Modules

Posted 631 days ago | 0 Comments

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 [...]

Continue Reading

IntegraTUM Web Disk

Posted 1203 days ago | 0 Comments

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>                [...]

Continue Reading

certwatch

Posted 1203 days ago | 1 Comments

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: [...]

Continue Reading

MS Office 2007 Formats in Apache

Posted 1230 days ago | 0 Comments

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 [...]

Continue Reading