Apache configs

Follow the steps after these file attachments first, then copy these four files onto the new machine.

Might want to read through the whole thing, because the notes below assume you are setting up Apache from a fresh install, so some of it is redundant if you are copying the four files below over the ones you would have created following the steps below.

Create a Certificate

$ sudo apt-get install ssl-cert
$ sudo mkdir /etc/apache2/ssl
$ sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem

Install Module

$ sudo a2enmod ssl
$ sudo /etc/init.d/apache2 force-reload

Create virtualhost

Make a copy of the default VirtualHost

$ # or you can symbolically link these
$ sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl

Modify /etc/apache2/sites-available/ssl so that you have,

NameVirtualHost *:443

and

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem

.
.
.

</VirtualHost>

Enable SSL virtualhost

$ sudo a2ensite ssl
$ sudo /etc/init.d/apache2 reload

Modify /etc/apache2/sites-available/default so that you change your NameVirtualHost and any other virtual hosts to *:80 as in the next two lines.

NameVirtualHost *:80
<VirtualHost *:80>

Restart Apache server

$ sudo /etc/init.d/apache2 restart

Enable the following modules

$ a2enmod rewrite
# ls mods-enabled/
alias.conf@       authz_default.load@    autoindex.conf@  dir.load@   negotiation.conf@  php5.load@        rewrite.load@   ssl.load@
alias.load@       authz_groupfile.load@  autoindex.load@  env.load@   negotiation.load@  proxy.conf@       setenvif.conf@  status.conf@
auth_basic.load@  authz_host.load@       cgi.load@        mime.conf@  perl.load@         proxy_http.load@  setenvif.load@  status.load@
authn_file.load@  authz_user.load@       dir.conf@        mime.load@  php5.conf@         proxy.load@       ssl.conf@






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.