|
|
S'il n'y a pas de solution c'est qu'il n'y a pas de problème! |
|
|
To begin...
When I first got the weird idea to install apache with mod_ssl, php and
mod_perl, my aspirine and coffe bills began to raise in a dangerous way.
Files to download
Be careful, each version of mod_ssl is associated with a precise version of apache. Pick-up the right one! To install openssl, you need...perl 5! Installation of the whole stuff I suppose that you have uncompressed all the sources in /usr/local/src. You have directories like openssl-x.x.x, mod_ssl-y.y.y-z.z.z, php-u.u.u, mod_perl-v.v.v and apache_z.z.z openssl (Jump to next § if you do not install mod_ssl) Go to openssl sources directory and read the INSTALL file ;-) and run:
You can change the install directory with the option -prefix=, you can see all the available options by:
Then, run:
Let us go to more serious stuff... mod_ssl patch (jump to next § if you do not install mod_ssl) mod_ssl modify apache sources... There are several ways to install apache + mod_ssl, I give here what appeared to be the easiest one (dynamic)
Go to the mod_ssl sources directory
where apache_z.z.z is the apache sources directory.
All the ./configure options must be written on the command line.
--enable-module=ssl --enable-module=all --enable-shared=max --enable-rule=EAPI
are apache options. ou can add more options or modify them, for example, the install directory of apache is /usr:local/apache. To know all the available apache options run ./configure --help from apache sources directory.
Apache installation with mod_ssl (see further to install apache without mod_ssl)
apache configuration has already been made by mod_ssl.
Go to apache sources directory.
apache installation without mod_ssl
Go to apache sources directory.
You can add, or modify some options, for example apache installation directory which is here /usr/local/apache. To know all the available options, run ./configure --help from apache sources directory. All the options must be written on the command line. Then, make and make install. PHP installation (jump to next § if you do not install php).
Go to php sources directory.
--with-imap option allows php to get access to an imap email server,
--with-gettext allows php to use gettext based localization
(use these options only if you need them!!)
/usr/local/apache/bin/apxs is the path to the apxs file of apache.
Then, run:
Remark: since some "versions", php does not add this (which is required) to apache config file:
In the same idea, do not forget:
mod_perl installation (jump to next § if you do not install mod_perl).
Go to mod_perl sources directory.
where /usr/local/apache/bin/apxs is the path to apxs file of apache (as usual, this command is to be entered in one piece on the command line)
Then, run:
Create a security certificate (jump to next § if you do not install mod_ssl)
There is a tool for that, its name is openssl (yes...), it is usually located in /usr/local/bin.
where obvioulsy name.your.site is the declared name of your web site. If you want to create a password protected key, run:
But in this case, every start of apache require to enter the password for the key.
But it's upt to you to write the password programm, be careful!! Some times, it is easier to simply protect a non protected file, than writing a programm that gives a password!! Then, run:
You have to answer some question here. Type a . to leave a field blank. These are my own answers:
CSR is now created, you can validate it by yourseld to generate a security certificate by running:
-days gives the validity time of the certificate, I put 10000 days ;-)
Check thet these files are only readble by apache processes owner!! Installation is now over. You have to set up /usr/local/apache/conf/httpd.conf Apache set up
I do not intend to give full explanations fo httpd.conf, I will only give the need of mod_ssl.
restart, stop, status, fullstatus et configtest remain the same, but start launches apache WITHOUT mod_ssl.
The installation procedure above makes a httpd.conf file where php and mod_perl are only activated with mod_ssl. This can lead to security weakness!! by disabling php when starting without mod_ssl (and making php sources files readable!!)
and
You can also comment out all the <IfDefine SSL> and the <IfModule mod_ssl.c> (with the corresponding closing tags) so that apache is always started with mod_ssl, even with the start order. Below, I only explain the complements needed by mod_ssl in httpd.conf. First, thes lines have been generated:
A ssl server listens on 443 port. Do not, forget to open this port on your firewall.
The easiest way to use ssl is to configure virtual hosts.
If you do not have a fixed IP, you can (from apache 1.3.13) use
NameVirtualHost *:443 and <VirtualHost *:443>.
|
|