Contents
#!/bin/bash clear # Create RSA echo 'RSA' echo mkdir -pv /www/ca/ cd /www/ca/ # Certificate Authority # RSA – CA without a password echo echo "Certificate Authority – RSA" echo openssl genrsa -aes256 -out ca.rsa.pem 4096 openssl rsa -in ca.rsa.pem -out ca.rsa.key openssl req -new -x509 -days 1825 -key ca.rsa.key -out ca.rsa.crt echo # Country Name (2 letter code) [AU]:GR # State or Province Name (full name) [Some-State]:Athens # Locality Name (eg, city) []:Aigaleo # Organization Name (eg, company) [Internet Widgits Pty Ltd]:Ebalaskas.Gr # Organizational Unit Name (eg, section) []:Web Apps # Common Name (eg, YOUR name) []:Evaggelos Balaskas # Email Address []:ebalaskas@ebalaskas.gr # Server Site Certificate – RSA echo echo "Server Site Certificate – RSA" echo openssl genrsa -aes256 -out ebal.pem 4096 openssl rsa -in ebal.pem -out ebal.key openssl req -new -key ebal.key -out ebal.csr echo 'ΠΡΟΣΟΧΗ: ΤΟ Common Name ΠΡΕΠΕΙ ΝΑ ΤΟ ΟΝΟΜΑ ΤΟΥ site' openssl x509 -req -days 1825 -in ebal.csr -out ebal.crt \ -sha1 -CA ca.rsa.crt -CAkey ca.rsa.key -CAcreateserial # Country Name (2 letter code) [AU]:GR # State or Province Name (full name) [Some-State]:Athens # Locality Name (eg, city) []:Aigaleo # Organization Name (eg, company) [Internet Widgits Pty Ltd]:Ebalaskas.Gr # Organizational Unit Name (eg, section) []:Web Apps # Common Name (eg, YOUR name) []: www.ebal.gr # Email Address []:ebalaskas@ebalaskas.gr # Server Site Client Certificate echo echo "Server Site Client Certificate – RSA" echo openssl pkcs12 -export -in ebal.crt -inkey ebal.key \ -name "www.ebal.gr Certificate Client" -out ebal.p12 # Apache echo echo Apache echo /usr/local/apache2/bin/htpasswd \ -c /www/ca/.htaccess ebal echo '127.0.0.13 www.ebal.gr' >> /etc/hosts
wget -c http://apache.otenet.gr/dist/httpd/httpd-2.0.63.tar.bz2 tar jxvf httpd-2.0.63.tar.bz2 cd httpd-2.0.63 ./configure --enable-ssl make make install
elinks http://localhost
<VirtualHost 127.0.0.13:80>
DocumentRoot /www/www.ebal.gr
ServerName www.ebal.gr
</VirtualHost><VirtualHost 127.0.0.13:80>
DocumentRoot /www/www.ebal.gr
ServerName www.ebal.gr
<Directory /www/www.ebal.gr>
AuthType Basic
AuthName "Authenication"
AuthUserFile /www/ca/.htaccess
Require valid-user
</Directory>
</VirtualHost><VirtualHost 127.0.0.13:443>
DocumentRoot /www/www.ebal.gr
ServerName www.ebal.gr
<Directory /www/www.ebal.gr>
AuthType Basic
AuthName "Authenication"
AuthUserFile /www/ca/.htaccess
Require valid-user
</Directory>
SSLEngine on
SSLProtocol SSLv3
SSLCertificateFile /www/ca/ebal.crt
SSLCertificateKeyFile /www/ca/ebal.key
</VirtualHost><VirtualHost 127.0.0.13:443>
DocumentRoot /www/www.ebal.gr
ServerName www.ebal.gr
<Directory /www/www.ebal.gr>
AuthType Basic
AuthName "Authenication"
AuthUserFile /www/ca/.htaccess
Require valid-user
</Directory>
SSLEngine on
SSLProtocol SSLv3
SSLCertificateFile /www/ca/ebal.crt
SSLCertificateKeyFile /www/ca/ebal.key
SSLVerifyClient require
SSLVerifyDepth 1
SSLCACertificateFile /www/ca/ca.rsa.crt
</VirtualHost>