Install and configure SSL certificate in Apache Webserver
Step:1
Upload the certificate file into the server.
I have uploaded the file in /tmp directory
Step:2
Modify the apache configuration
vi /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerName monit.example.com
ServerAdmin webmaster@localhost
DocumentRoot /opt/observium/html
Redirect / https://monsupport.example.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/observium/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerSignature On
</VirtualHost>
<VirtualHost *:443>
ServerName monit.bol-online.com
DocumentRoot /opt/observium/html
SSLEngine on
SSLCertificateFile /tmp/STAR_example_com.crt
SSLCertificateKeyFile /tmp/STAR_example_com.key
SSLCertificateChainFile /tmp/STAR_example_com_ca.crt
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/observium/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerSignature On
</VirtualHost>
Step:3
Modify ssl configuration file under apache
vi /etc/apache2/sites-available/default-ssl.conf
<VirtualHost *:443>
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /tmp/STAR_example_com.crt
SSLCertificateKeyFile /tmp/STAR_example_com.key
SSLCertificateChainFile /tmp/STAR_example_com_ca.crt
</VirtualHost>
Step:4
Restart apache service
Remarks:
1. Please insert/modify green marked lines into the mentioned files if they exist/do not exist.
2. Here I have used a wildcard SSL certificate.
Comments
Post a Comment