Installing apache on Ubuntu

Tutorial on how to install apache on Ubuntu from the package manager.

To install Apache on Ubuntu, you will need to navigate to the package manager, search for apache2 and install the metapackage.

When you have done this, you should be able to hit in http://localhost/ in your browser, and get a standard page delivered by your server.

Starting and Stopping the server

To start and stop the server, you can use the following terminal commands.

sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart

The configuration files

The main configuration files are located in etc/apache2 in case you need them.

Often you wont need them, but if you are running your server on another port than the default port, then you need to change the listen port to access the server from outside locations.

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.