Preparing Ubuntu system for WordPress installation.

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

Chapter 1

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.

Chaptes 2

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.

https://amionrails.wordpress.com/2014/09/26/upgrading-mysql-5-5-to-mysql-5-6-on-digital-hosting-on-ubuntu-14-04-the-easy-way/

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.

http://www.unixmen.com/how-to-enable-and-disable-apache-modules/

http://www.cyberciti.biz/faq/howto-disable-apache-modules-under-linux-unix/

http://www.lophost.com/tutorials/how-to-disable-un-neccesary-default-apache-modules/

$ls /etc/apache2/mods-enabled/

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!

$cd /etc/apache2/mods-enabled

$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 ūüôā

https://amionrails.wordpress.com/2014/09/26/apache-module-installation-needed-to-server-wordpress-with-php/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s