Posts Categorized: apache

Apache: unable to open logs

In the annals of “Everyday is a learning day”. I have an Apache server hosting student websites, and the number of websites grew to over 700 within a day and Apache was complaining with error:

It took a little while to narrow down the problem as I assumed there was a path that did… Read more »

Nginx Reverse Proxy

centos logo

Using CentOS 6 I installed Nginx with:

and amended the config file for the default website i.e.

With the following content:

So visiting the web address frontend.domain.co.uk:8080 as configured under the ‘server’ section will proxy the website from st.domain.co.uk:80 Advice on the web specified using $host or configuring the proxy_set_header:

However,… Read more »

Set Default Theme in phpMyAdmin on CentOS

phpmyadmin

I have installed phpMyAdmin on CentOS 6 via the EPEL repository using:

I was asked to set the default theme from the new jazzy one to the traditional one. To do so I edited the phpMyAdmin config file. On CentOS this was at /etc/phpMyAdmin/config.inc.php but on other installations it may be under /usr/share/phpMyAdmin

Read more »

DigiCert Certificate Inspector on CentOS 6

DigiCert Certificate Inspector

Installation on CentOS Download the 64-bit RPM:

Install the package:

Register the Agent You will need your DigiCert credentials to register the agent:

Scan an Server

  Amend the Apache SSL Configuration for POODLE Vulnerability In the file used to configure SSL for Apache ( usually /etc/httpd/conf.d/ssl.conf ) find the section… Read more »

Keeping Services Alive with Monit

On CentOS install monit as follows:

Make sure it starts automatically:

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 defining this in the next step:… Read more »

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

I had this error message when uploading images in WordPress. Image dimensions were set to 0x0 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… Read more »

LAMP Performance

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… Read more »

Apache Protect Multiple Locations

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>

Apache GeoIP Country Detection

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… Read more »

LAMP on Ubuntu

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.