Skip to main content

Installing Apache on Ubuntu 12.04 LTS Server

By October 4, 2013September 12th, 2022No Comments

In this tutorial we look at installing the Apache HTTPD server onto Ubuntu 12.04, the LTS Server. Like SUSE the package is called Apache2 whereas in Red Hat and CentOS it is HTPPD.

sudu -apt-get install apache2 apache2-doc apache2-utils

This will install the server documentation and tools. Ubuntu will also start the server and create a simple welcome page. In the video we show this by browsing to the localhost with the command line browser w3m:

w3m localhost

We should see the “It Works” page. Yeaaah just what we like to see.

If we want to install other modules we can do so, all modules that have been enables should show under the /etc/apache2/mods-enabled directory. In the video we install some PHP5 modules

sudo apt-install php5 libapache2-mod-php5 php5-mysql

If we need to edit the welcome page the default location in Ubuntu is /var/www and the welcome page is index.html.

Services can be configured to auto start with update-rc.d

To remove the auto-start configuration for the Web server

sudo update-rc.d -f apache2 remove

To enable auto-start for apache

sudo update-rc.d apache2 defaults

To manual start and stop the serverice we can the service command similar to this

service apache2 stop

The video follows: