I have had a real nightmare recently with my Ubuntu 14.04 and Apache running on digital hosting.As I go expirement with new website and I am running wordpress on it I went to a cheap solution 5 dollar per month.
You just cant complain about it 🙂
Despite my sites was barely serving 20-30 sites a default configuration on my server and default apache, mysql, wordpress were maxing out my CPU to 100% enabling me even logging to it using my ssh account.
512ram is not a lot but 20gb ssd drive can be handy 🙂
At first I had no idea what was causing the problem although I was monitoring my processes using:
$top – command. I missed it somehow 🙂
and using the $uptime command I was monitoring my system performance
Luckily I found that the issue is with Apache configuration. The first thing I done was taking off the php module needed to run a site so I can have a web server running.
I have switched off the Apache Server.
$sudo service apache2 stop
and run $uptime command again and notice that the CPU was dropping down!
Oh yes that was sweat so the issue comes from apache!
it does not really an issue with apache itself poor system performance plus some bots, spamers attacking my tiny wordpress site barely server few views a day. Just shocking how bad the internet is these days.
We never had such problems when we were using 56kb/s modems.
Anyway lets’ bad to the subject. I decided to configured my tiny droplet on digitalSystem to get maximum performance possible at some point 🙂
You can’t do everything done in the same long night especially when you are blogging about it in the same time
1. Switching off apache so I actually do some work – $sudo service apache2 stop
2. Disabling php mod on the server so I can enable my web server at least. $sudo a2dismod php5
I found out on the internet that the default php5 is apparently not the best solution for my tiny system.
I have take off the php5 system so my wordpress stops working but so I could enable the apache for fun!
At least I found that the apache with my php was causing the issue for me.
1. Lets do it in good old fashion way.
2. Update apache to latest system version and update php version to last stable version.
In a easy way for now without compiling sources.
$sudo apt-get update and then apt-get upgrade
$sudo apt-get upgrade php5 apache2 mysql-server5.6 (latest version)
You can check your current mysql version by running the following command
$mysql -h localhost -V
If you want to upgrade your mysql to current latest stable version 5.6 from 5.5
then please follow my other post.
2. Disable all apache modules and all php modules and start from scratch
I think this is a good practice. You will learn what is needed for you. Get your hands dirty with apache configuration so you will understand it a bit more and also learn more about apache and php modules.
There are a lot of articles on the internet about it.
This will display all the modules for you such as
acess_compat.load authz_user.load filter.load rewrite.load
alias.conf autoindex.conf mime.conf setenvif.conf
alias.load autoindex.load mime.load setenvif.load
auth_basic.load cgi.load mpm_prefork.conf socache_shmcb.load
authn_core.load deflate.conf mpm_prefork.load ssl.conf
authn_file.load deflate.load negotiation.conf ssl.load
authz_core.load dir.conf negotiation.load status.conf
authz_groupfile.load dir.load reqtimeout.conf status.load
authz_host.load env.load reqtimeout.load
These are just simlinks so you can easily remove as they stay in mods-available directory.
Lets remove the all!
$sudo rm -r * (Make sure you are in the right directory!!!!!!)
$ls – folder is empty
Telling the true I have changed my mind and decide to do php modules removal at later stage.
I don’t want to figure out if this is apache or php module that i need to server the site.
Complete apache first and move to the next step!.
Once you remove all your modules you will not able to start the service
Now you can read here to find out what is needed 🙂