Installing Apache on Ubuntu
This tutorial will take you through installing the Apache HTTP Server on Ubuntu.
Enter the following at the terminal:
sudo apt-get install apache2
This will install Apache to ‘/etc/apache2′ on your filesystem. The server will be automatically started each time you start Ubuntu. Alternatively, you can start, stop, and restart the server by running the following commands respectively:
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart
The document root will be installed to ‘/var/www’. This is the root directory of the context path where your files can be accessed from on the server.
To test that it is working enter the following at the terminal:
sudo gedit /var/www/index.html
Enter the following and save it.
<html>
<head></head>
<body>
Yeaa. It works!
</body>
</html>
You can now open the browser and enter the following address:
http://localhost/
This should display the page you have just created.