Gentoo Archives: gentoo-user

From: Michael Orlitzky <michael@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Apache server setup
Date: Mon, 11 Jun 2012 01:59:59
Message-Id: 4FD550B0.30302@orlitzky.com
In Reply to: Re: [gentoo-user] Apache server setup by Peter Humphrey
1 On 06/09/2012 05:59 AM, Peter Humphrey wrote:
2 > On Friday 08 June 2012 22:01:08 Paul Hartman wrote:
3 >> On Fri, Jun 8, 2012 at 1:21 PM, Peter Humphrey
4 > <peter@××××××××××××××.org> wrote:
5 >>> $ cat .htaccess
6 >>> RewriteEngine on
7 >>>
8 >>> RewriteCond %{HTTP_REFERER} !^http://tideswellmvc.co.uk/.*$
9 >>> [NC] RewriteCond %{HTTP_REFERER} !^http://tideswellmvc.co.uk$
10 >>> [NC] RewriteCond %{HTTP_REFERER}
11 >>> !^http://www.tideswellmvc.co.uk/.*$ [NC]
12 >>> RewriteCond %{HTTP_REFERER} !^http://www.tideswellmvc.co.uk$
13 >>> [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
14 >>>
15 >>> Options +Includes
16 >>
17 >> I suspect this particular error ("Options not allowed here") is
18 >> because this .htaccess is running in a user home directory, and
19 >> Options +Includes can't be set by a user. You may need to declare
20 >> that in your apache httpd.conf "Directory" section for that path,
21 >> rather than in the .htaccess file.
22 >
23 > Hmm. Sounds plausible. Maybe I'll have to put it back into /var/www/...
24 > and try to work out why I can't see images there.
25 >
26 > Thanks for your help Paul.
27 >
28
29 If you want to allow overrides in an htaccess, you'll need at least,
30
31 <Directory "/var/www/whatever">
32 Options +SymLinksIfOwnerMatch
33 AllowOverride FileInfo Options
34 </Directory>
35
36 in the main config or your vhost config.
37
38 The Gentoo config modularizes by default, but you don't have to use it
39 if you don't want to. Almost everything under /etc/apache2/modules.d is
40 disabled by default unless you enable it in /etc/conf.d/apache2.
41
42 Named virtual hosts are also disabled by default if I remember
43 correctly, so you should be able to just stick stuff in httpd.conf or
44 00_default_settings.conf and have it take effect if you don't want to do
45 anything fancy.
46
47 Almost everything "different" about the Gentoo config comes from these
48 two lines at the bottom of httpd.conf:
49
50 Include /etc/apache2/modules.d/*.conf
51 Include /etc/apache2/vhosts.d/*.conf
52
53 which do exactly what you'd expect.

Replies

Subject Author
Re: [gentoo-user] Apache server setup Michael Orlitzky <michael@××××××××.com>
Re: [gentoo-user] Apache server setup Peter Humphrey <peter@××××××××××××××.org>