Johnny Tan
2008-Apr-03 22:25 UTC
[CentOS] using conf.d files to override options in httpd.conf
Like many of you, I like to avoid modifying /etc/httpd/conf/httpd.conf as much as possible. Instead, modifying or adding files in /etc/httpd/conf.d However, because /var/www/html is declared within the main httpd.conf and certain directives are set along with "AllowOverride None" (thus forbidding use of .htaccess), it seems like the only way to override any of these options is to modify httpd.conf directly. If nothing else, at least setting "AllowOverride" to something besides None. Is that correct? Or does anyone know of a way to leave httpd.conf pristine, yet still override or set directives for /var/www/html? johnn
Ignacio Vazquez-Abrams
2008-Apr-03 23:14 UTC
[CentOS] using conf.d files to override options in httpd.conf
On Thu, 2008-04-03 at 18:25 -0400, Johnny Tan wrote:> Like many of you, I like to avoid modifying > /etc/httpd/conf/httpd.conf as much as possible. Instead, > modifying or adding files in /etc/httpd/conf.d > > However, because /var/www/html is declared within the main > httpd.conf and certain directives are set along with > "AllowOverride None" (thus forbidding use of .htaccess), it > seems like the only way to override any of these options is > to modify httpd.conf directly. If nothing else, at least > setting "AllowOverride" to something besides None. > > Is that correct? Or does anyone know of a way to leave > httpd.conf pristine, yet still override or set directives > for /var/www/html?Just don't use "example.com". Instead stick to subdomains such as "www.example.com", while putting in a rewrite rule that redirects from example.com. -- Ignacio Vazquez-Abrams <ivazqueznet at gmail.com> PLEASE don't CC me; I'm already subscribed -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.centos.org/pipermail/centos/attachments/20080403/c0aea09e/attachment-0001.sig>
Johnny Tan wrote:> Like many of you, I like to avoid modifying /etc/httpd/conf/httpd.conf > as much as possible. Instead, modifying or adding files in > /etc/httpd/conf.d > > However, because /var/www/html is declared within the main httpd.conf > and certain directives are set along with "AllowOverride None" (thus > forbidding use of .htaccess), it seems like the only way to override > any of these options is to modify httpd.conf directly. If nothing > else, at least setting "AllowOverride" to something besides None.I don't think there is anything to prevent .htaccess in the default config. That said, I couldn't find a satisfactory way to avoid editing httpd.conf.> > Is that correct? Or does anyone know of a way to leave httpd.conf > pristine, yet still override or set directives for /var/www/html?