Mobile app version of vmapp.org
Login or Join
Jamie184

: Purposes and priorities of Apache conf files I've installed an Apache2 server on a Linux Box (Ubuntu 10.04 TLS) and am trying to setup some virtual host and proxies. There is some stuff in

@Jamie184

Posted in: #Apache #Apache2 #HttpdConf #Virtualhost

I've installed an Apache2 server on a Linux Box (Ubuntu 10.04 TLS) and am trying to setup some virtual host and proxies. There is some stuff in the apache2.conf, an empty httpd.conf (which was used heavily in the Windows setup I had), and then there are the invidividual files for the websites in my sites-available directory, call them a.com and b.com.

What information needs to be where?
What is the priority of processing for these?
Will repeated information cause a problem?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jamie184

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cody1181609

Apache configuration is exhaustively covered in the Apache documentation (though, if you're using Debian or Ubuntu, there are some additional considerations) and the best way to familiarize with Apache will be to study each portion of the documentation as you encounter a need to use a particular module or set of directives.

To address your specific questions:


What information needs to be where?


The file system you described would suggest that your configuration is intended for name-based virtual hosts (the default Ubuntu 10.04 Apache configuration) so any directives which apply to your Apache configuration for all virtual hosts (i.e. domains, subdomains) should be added to httpd.conf and any directives specific to a given virtual host (including its declaration) should be added to the /sites-available/domain.com.conf (or similar) file.


What is the priority of processing for these?


Toward the end of a typical apache2.conf file, the following directive appears:

Include /etc/apache2/sites-enabled


This directive instructs Apache to include all configuration files in the sites-enabled directory. (see Include documentation)

Files are included in numeric then alphabetical order from 0-9 then A-z.


Will repeated information cause a problem?


Duplicate virtual host definitions will be ignored when Apache is started, however, you will receive a warning when this happens - ideally, you should run apache2ctl configtest (documentation) before attempting to restart Apache so you have the opportunity to correct duplicates or errors which would prevent Apache from starting.

Note that the config syntax checker will not warn you if there are file permission problems or other issues which would prevent Apache from starting.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme