Archive for the ‘Apache’ Category

Apache: Redirect pages to another domain

Wednesday, October 23rd, 2013

Redirect: To: /somefile.php

RedirectMatch 301 /seo/(.*) /$1


Linux: Install Apache with Yum

Monday, August 16th, 2010
yum install httpd
yum install mod_ssl

Source: Installing Apache, PHP, and MySQL on Fedora Core

Apache: Check httpd.conf with apachectl

Friday, June 25th, 2010
apachectl configtest


apachectl -t


service httpd configtestt

Apache: cannot open shared object file (postgres)

Wednesday, March 24th, 2010

After installing postgresql, you might have issues to start apache

Starting httpd: /usr/sbin/httpd:
error while loading shared libraries: cannot open shared object file:
No such file or directory

One way to solve this issue, is to reinstall apache and apr-util.

#remove apache and apr-util
yum remove apr-util
#reinstall apache
yum install httpd


Apache: Install SSL on Virtual Host

Sunday, September 27th, 2009

Here is the minimum configuration to enable SSL

Load the module and configure the certificate

LoadModule ssl_module modules/
Listen 443
SSLProtocol all -SSLv2
SSLCertificateFile /path/to/domain-certificate.crt
SSLCertificateKeyFile /path/to/domain-key.key
SSLCertificateChainFile /path/to/bundle-certificate.crt
SSLCACertificateFile /path/to/bundle-certificate.crt


NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot /path/to/html/
SSLEngine on


  1. Disable your /etc/httpd/conf.d/ssl.conf by renaming it to ssl.conf.disabled (otherwise, Apache will take the properties from this file, and it can get quite confusing).
  2. Open your firewall for https protocol
  3. Get a certificate (Godaddy have the cheapest one, especially for wildcard ones)

Related links

Apache: SSL Certificate generate CSR

Friday, August 7th, 2009

CSR-Generation Instructions

To generate a triple-DES encrypted key pair and a Certificate Signing Request (CSR):

Enter the following commands:

  1. cd /usr/bin/ (/your path to openssl/)
    Enter a passphrase when prompted to.
  2. openssl genrsa -des3 -out <name of your certificate>.key 1024
  3. openssl req -new -key <name of your certificate>.key -out <name of your certificate>.csr

If you are requesting a Wildcard certificate, please add an asterisk (*) on the left side of the Common Name (e.g., “*” or “www*”). This will secure all subdomains of the Common Name.

(source: Godaddy’s help)

BTW, Godaddy has the cheapest certificates you can find (with great support).

Apache: Applying license to code

Friday, July 31st, 2009
Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   See the License for the specific language governing permissions and
   limitations under the License.

See Apache V2 licensing

Apache: htpasswd Create User for Apache Auth File

Sunday, February 8th, 2009

First user creation (create file and first user):

htpasswd -cm /path/to/auth-conf yourusername

Subsequent user creation

htpasswd -m /path/to/auth-conf yourusername

Apache: Permanent Redirect Directive in Apache httpd conf

Thursday, December 4th, 2008

Redirecting from the http.conf

<VirtualHost *:80>
  Redirect permanent /