From charlesreid1

Revision as of 00:13, 16 March 2015 by Admin (talk | contribs) (Created page with "When you install or use the default-installed apache on ubuntu, things can be a bit all-over-the-place. This page is intended to collect my notes on where everything is when you ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

When you install or use the default-installed apache on ubuntu, things can be a bit all-over-the-place. This page is intended to collect my notes on where everything is when you go this route.

Overview

htdocs

The main Apache site is located in /www/htdocs

I put things in /www/ if they need to be accessed by Apache (MediaWiki, Wordpress, Drupal, etc.)

Configuration Files

Normally, Apache is configured through the httpd.conf file. However, on Ubuntu, configuration files are more fragmented.

The main configuration file is located in /etc/apache2/apache2.conf. This contains the system's Apache configuration, and should probably not be modified directly.

The main configuration file pulls in other configuration files, such as /etc/apache2/ports.conf, which contains configuration directives related to which ports Apache uses.

There are also site-specific configuration files, detailed below.

Sites

Site settings contained in: /etc/apache2/sites-available/default

Site settings for sites currently running contained in: /etc/apache2/sites-enabled/*

The contents of the server's main website are contained in: /www/htdocs/

To add a new site, you'll need to add a new virtual host, by creating a new file in /etc/apache2/sites-available/newsite. It will contain a <VirtualHost> block that will indicate how to reach the new site and the directory containing the contents of the new site.

To enable the new virtual host, run:

sudo a2ensite newsite

To disable it, run:

sudo a2dissite newsite