Category: Webservers

Set Apache To Start On Boot

By default many Apache RPM packages do not set the httpd server to start automatically on boot so this needs to be done manually. On RedHat/CentOS the chkconfig command should be used as follows:

Read More »

Apache Configuration Best Practices

There are numerous ways to organize your Apache configuration files. In some cases this organization will be dictated by your Linux distribution or control panel choice. When I’m working on RedHat/CentOS with no control panel here’s what I have found to be a good organization: Minimize changes to /etc/httpd/conf/httpd.conf. It’s easier to upgrade or migrate if this file has few or not changes. Place virtual host definitions in /etc/httpd/conf/vhosts.conf. Put the document root for each website at /var/www/vhosts/[domain name]/httpdocs. Do not include “www” on the domain name. For example with “acme.com” the document root would be /var/www/vhosts/acme.com/httpdocs. Here’s a template for the virtual host definition:

Of course the SSL portion of the template is optional.

Read More »

Set X-Robots-Tag in Apache

The X-Robots-Tag HTTP header can be used to send directives to Google and other search engines. See this page for a discussion from Google: https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag In Apache you can implement the X-Robots-Tag using the Header directive. For example the following code will mark PDF documents as “noindex, nofollow”:

Read More »

Install PHP SSH2 extension on RHEL 5.6 with EPEL repository

Here are the steps to install the PHP SSH2 extention on RHEL 5.6 with the EPEL repository. Install packages that may be needed:

Temporarily allow binary execution in /tmp

Install the extension:

Restore /tmp restrictions:

Reload apache:

Read More »

Insert Varnish Cache With NAT Rule

Here’s a simple nat rule for iptables that will route incoming web traffic to your varnish cache. This allows you to implement varnish without reconfiguring apache. In the varnish config, set the backing do be 127.0.0.1:80.

Here’s a different rule that also seems to work:

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.