I’ve Ubuntu Droplet and want to use as Mysql server. SO I’ want to remove Apache2. With earlier provider Linode, there was some settings that if Apache or Mysql ever stopped it’d automatically restart the VPS.
Is there something like this here?
Can I go ahead and remove the Apache2( on Ubuntu 14)?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @stonepuma,
You can remove the Apache service without a problem. Please bear in mind this can break your website if you have any hosted on the droplet. If you are going to use it just for MySQL then it should be okay.
To remove or rahter would I say stop Apache2 from your ubuntu server, you can type in the following command
systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] # and symlinks that might be related
rm /usr/lib/systemd/system/[servicename]
rm /usr/lib/systemd/system/[servicename] # and symlinks that might be related
systemctl daemon-reload
systemctl reset-failed
Alternatively, you can remove it directly with apt-remove.
Regards, KFSys
Hi,
Removing Apache2. I do not recommend removing packages related to Apache2. There may be some dependencies between packages which may not be correctly followed by package manager during removal process. It may end in system malfunction. Preventing Apache2 service from automatic start seems to be better solution. So first, stop apache2 service
sudo service apache2 stop
and then, disable its automatic start when system starts
sudo update-rc.d apache2 disable
Restarting a droplet when particular service is stopped. I do not know if DO droplets have this feature. Anyway, you could configure it using bash script and cron, if such solution would satisfy you.
BTW, you asked a question related to unsupported version of Ubuntu. Ubuntu 14 reached its end of life in April 2019. So, my advice is to migrate to the most current version ASAP.
1st you need to disable default configuration, RUN>>
a2dissite 000-default.conf
and then restart apache2 >>>
service apache2 restart
Hope this will help to solve the issue :)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.