Deploy ssl to apache 1. Enable apache mod ssl: $ sudo a2enmod ssl $ sudo systemctl restart apache2 $ sudo apache2ctl -M | grep ssl 2. generate csr and private key sudo openssl req -new -newkey rsa:2048 -nodes -keyout 10.134.27.100.key -out 10.134.27.100.csr 3. send the csr to be signed (self or trusted) sudo openssl x509 -req -days 365 -in 10.134.27.100.csr -signkey 10.134.27.100.key -out 10.134.27.100.crt 4. deploy to apache $ sudo mkdir /etc/apache2/ssl $ sudo mv 10.134.27.100* /etc/apache2/ssl $ sudo ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/ $ sudo nano /etc/apache2/sites-enabled/default-ssl.conf <VirtualHost> ... SSLEngine on SSLCertificateFile /etc/apache2/ssl/10.134.27.100.crt SSLCertificateKeyFile /etc/apache2/ssl/10.134.27.100.key ... </VirtualHost> $ sudo apache2ctl -t $ sudo systemctl restart apache2
Tuesday, September 25, 2018
Linux @ PMJ
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment