Apache2 Tutorial For Debian Linux

By | March 28, 2013

A very small apache2 tutorial that debian linux beginners. I’m creating this document for my future reference, if you think you like this article feel free to drop your comments.

The basics:

Installing apache2.

apt-get install apache2

Start your browser and visit, http://localhost/ to check.

Default root directory: /var/www/
Configuration file is /etc/apache2/apache2.conf
STORE additional configuration files here /etc/apache2
Enable apache modules /etc/apache2/mods-enabled
Enable virtual hosts /etc/apache2/sites-enabled

Check this to enabling sites in apache2. If you want you can also change port number for security reasons.


Virtual hosts: One IP address but multiple domains – “Name based” virtual hosting.
Multiple IP based virtual hosts: One IP address for each domain – “IP based” virtual hosting.

What is .htaccess file?

Hypertext Access, commonly shortened to htaccess, is a configuration file which controls the directory it is placed in and all the subdirectories underneath it. It’s an incredibly useful feature which allows webmasters to control how many aspects of their website works. You can redirect pages, change the extensions of pages, password protect directories and much much more.

To know almost everything about apache2 (not debian alone) check this out.

If you like this article, then please consider sharing it. Sharing really inspires us to do things much better!!

Leave a Reply

Your email address will not be published. Required fields are marked *