Continuing Adventures with Ubuntu and Apache

Continuing Adventures with Ubuntu and Apache.
In a previous blog post "Installing LAMP on Ubuntu 11.04 aka The Natty Narwhal" I documented my start with Ubuntu and the Apache webserver suite.

This blog post was updated a few times as the installation was updated.
Recently, I went through another update exercise and instead of updating the previous blog post, I elected to make another blog post.

I am sure that this is "old hat" to many on this list.
But this work is not "old hat" to me.
And I would suspect that I am not alone in this.

As I recall, the previous updates to Ubuntu and especially to Apache were not trouble free.
I had been running Ubuntu 12.04 LTS since the last update in 20140525 or so.
(My bad: The other blog post does not explicitly say when 12.04 LTS was up and running.)
For some time I had been seeing Ubuntu notices that 14.04 was available. And when I tried to execute the update I saw an error message informing me that the Apache webserver was interfering with the update process. Fearing having a broken system I deferred the update for a while.

A few days ago, I bit the bullet and decided to update both Ubuntu and Apache starting with Ubuntu.
To update Ubuntu and according to various bits of advice on stackoverflow, askubuntu, apachefriends and elsewhere I needed to disable the Apache webserver.
ref: sudo service apache2 stop
ref: sudo update-rc.d apache2 disable
After a few runs at the update exercise the update from Ubuntu 12.04 LTS to 14.04 LTS was successful. The reasons why a few runs at the update exercise and details of which now elude me.

It may be needless to say that the the update to 14.04 LTS was not smooth as it could be.
But compared to the exercise in updating Apache the Ubuntu update was a whole lot smoother.

Restarting the Apache webserver was successful.
ref: sudo update-rc.d apache2 enable
ref: sudo service apache2 start

Continuing with the Apache update is where I ran into some real troubles.
Recalling that I had troubles with Apache updates over the past few years I saved a copy of /etc/apache2 in /usr (i.e. outside of /etc).
Again referring to the usual reference websites (see above) I executed apt-get.
ref: sudo apt-get install apache2
And, as I feared, I wound up with a broken system.

Apache simply would not start and, at times, would return error messages like:
The following packages have unmet dependencies: [ edit ]
Unable to correct problems, you have held broken packages.
The error messages referred to problems with the installation of php5.
Using our old sage, The Google, I looked for advice.
Somewhere there was a suggestion to use aptitude instead of apt-get.
No luck.

After attempting some repairs I trashed the broken /etc/apache2 installation.
And attempted to attempted a fresh install, again using apt-get.
And, in another run at this, using aptitude.
Result: "you have held broken packages" and again with references to php5.

I attempted to restore /etc/apache2 from a git repo created and maintained by etckeeper.
(Ref: discussions re: etckeeper in the KWLUG email list. And thanks to all who contributed.)
Result: "you have held broken packages" and again with references to php5.
Evidently, the issues with php5 are outside of /etc/apache2

I was not having much success with these repairs and looked again to The Google.
And I came across an entry about ppa repositories and how these can interfere with apt-get and aptitude.
After running through the advice given near the end of this askubuntu post it looked like the issues with php5 were solved.
And after I restarting the Apache webserver (an important step) the Apache webserver was running without errors.

Testing with /var/www/test.php containing <?php phpinfo(); ?> and executing FF: //http:/localhost/test.php.
The Apache phpinfo page is displayed.

My Linux PC is now running Ubuntu 14.04 LTS.
And Apache 2.4.7 is running - with php5

The apache2.conf file in the new install of /etc/apache2 does not have any of the local configurations that were in the configuration file prior to the update.
TODO: Restore the apache2.conf file as required from either the saved copy of the old /etc/apache2 or from the git repo created and maintained by etckeeper.
From a tip as seen on askubuntu re: fqdn below:
"It's a personal preference that keeps my configuration changes separated from the distribution package. So updates are less complicated."
sudo update-rc.d apache2 < enable : disable >
sudo service apache2 < start | stop | restart >
Re: errors with servers-fully-qualified-domain-name
service apache2 restart
Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName
Ubuntu 14.04:
echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
sudo a2enconf fqdn
Re: etckeeper
From the KWLUG list:
On 2010-02-26 13:08, Andrew Cant wrote (re: etckeeper)
> So I have not see any big benefits yet, but it requires little effort
> to maintain, and having the history of my changes makes me happy.