Chapter 2. Setting up the virtual server

The first thing to do is getting the Apache server to listen to port 443 as well as port 80. This is done in the main configuration file /etc/apache/httpd.conf, where we add the Port directive for port 443.

Port 80
Port 443

next we setup a virtual server to take care of the admin site.

In the /etc/apache/vhosts.conf file, we add the following:


	ErrorLog     /var/log/apache/admin/error.log
	TransferLog  /var/log/apache/admin/access.log
	DocumentRoot /home/www/admin/html
	php_admin_value safe_mode Off
	SSLEngine on
	SSLCertificateFile    /home/www/admin/ssl/admin.crt
	SSLCertificateKeyFile /home/www/admin/ssl/admin.key

This virtual server will only respond to requests on port 443 (https), which is what we want. No unencrypted access to this beast. Vi added the NameVirtualHost directive for port 443 as well, since we would otherwise not be able to listen to this port.

Ths server should new be setup in apache, but will however generate an error due to the fact that we have yet to install the SSL certificate necessary to encrypt the connection, and the apache server itself does not yet know about ssl.