Setting up a Local Apache2 Server on Ubuntu

Posted by Johnny on April 7th, 2009 filed in Guides, Technology

Getting an Apache2 server running on your Ubuntu box for some local dev work is pretty easy. Install the apache2 package via the Synaptic Package Manager or sudo apt-get install. Unlike normal Apache2 installs though, the default Apache install in Ubuntu is located under /etc/apache2/.

Without getting into nitty-gritty configuration details, most users will probably want to change the directory that the server reads files from. To do this, open up /etc/apache2/sites-available/default in a text editor of your choice, and change the DocumentRoot to the directory that you wish to serve your files from. Restart your server by running either sudo /etc/init.d/apache2 restart or sudo apache2ctl restart. Then simply hit http://localhost/ in your web browser to view.

For additional details on how to set up the full LAMP stack, take a look at this HowtoForge tutorial.

Leave a Comment