Home‎ > ‎Server administration‎ > ‎Apache‎ > ‎

Enable SSH after fresh Apache2 or LAMP install

After installing LAMP server, I want to be able to use secure SSL connection to access my services like phpmyadmin using https://my.ip.address/phpmyadmin.

To achieve this, ssl module has to be enabled and apache needs to be told, how to handle traffic from port 443, this is done by enabling default-ssl site.

$sudo a2enmod ssl
$sudo a2ensite default-ssl
$sudo service apache2 restart

After restart, you should be able to access your web server using self-signed SSL certificate, browsers should warn you in red colors about this certificate, because it is not signed by any authority like Verysign or GeoTrust, ... but do now worry, you may trust it only if you trust yourself, I trust me and my server, so it is good enough for me for now on. 

Firewall

If you have firewall enabled, you should allow incoming TCP connection on port 443.

$ sudo ufw allow 443/tcp 

Newbies watch out using ufw, if you enable firewall on remote machine and do not allow incoming TCP on port 22, you may end up disconnected from your server!