[Nottingham] Two simple Apache 2questions

Martin martin at ml1.co.uk
Thu Apr 25 11:41:46 UTC 2013


On 25/04/13 12:23, Jason Irwin wrote:
> 1) How do I ensure that Apache is parsing .htaccess filea?  I am aware
> that .htaccess usage is discouraged, but it is what I have to work with.
>  A PHP checker-tool is warning me it might be getting ignored.

In your vhosts file or httpd.conf as appropriate, use "AllowOverride" in
whatever way you want.


I deliberately have all .htaccess disabled ("AllowOverrideList None",
"AllowOverride None") and also a rewrite rule to stop them ever being
seen. All my 'Allow' stuff is all in the vhosts configs.

Check out:

http://httpd.apache.org/docs/2.4/howto/htaccess.html



> 2) How do I stop Apache running as root?  From what I understand there
> will always be one root process and the rest spun out under "www-data".
>  Problem I'm having is that a wee the PHP checker-tool is claiming it is
> running as UID 0.  Which is root.  Which is not good.  And also might
> explain a few odd glitches I'm seeing.

In:
/etc/apache2/httpd.conf

# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
User apache
Group apache


> Yes, this is related to the upcoming talk!

Sounds good :-)


Cheers,
Martin


-- 
- ------------------ - ----------------------------------------
-    Martin Lomas    - OpenPGP (GPG/PGP) Public Key: 0xCEE1D3B7
- martin @ ml1 co uk - Import from   hkp://subkeys.pgp.net   or
- ------------------ - http:// ml1 .co .uk/martin_ml1_co_uk.gpg



More information about the Nottingham mailing list