Prevent Apache from starting after apt-get install
Solution 1:
Try this:
- Create a file
/usr/sbin/policy-rc.d
with following content:
#!/bin/sh
exit 101
- Make it executable:
chmod +x /usr/sbin/policy-rc.d
After this, all packages will be installed but the services will not start.
Once you are done, you can remove the file:
rm -f /usr/sbin/policy-rc.d
Solution 2:
Lots of options:
- Move the closed source content out of
/var/www
- Change the permissions on that content such that the apache user cannot read it
- Iptables to stop port 80/443 traffic
- Pass a runlevel environment variable to
apt-get
:
sudo RUNLEVEL=1 apt-get install apache2