When I apt-get install apache2
the server starts automatically when install completes, and the default Apache configuration makes everything in /var/www/
accessible to the client side. Thus if I have any closed source server side scripts or other secret information in that directory before installing Apache, it is publicly accessible until I change the Apache configuration and restart Apache or until I stop Apache.
I can do this
sudo apt-get install -y apache2
sudo service apache2 stop
# Finish setting up...
And then there is only a brief window where the secret stuff is accessible, but it would be preferable to keep Apache from starting automatically at all and never expose /var/www/
even for one moment.
Are there any options I can pass to apt-get install
or other ways to prevent Apache from starting automatically after it is installed?