oscartheduckin’ around

May 3, 2007

permission permission permission ( moin on apache 2.2 )

Filed under: apache, freebsd, moin, MoinMoin — oscartheduck @ 12:18 am

This took too long to solve. My head hurts.

Okay. In apache2.2, every new directory that you create needs to have associated with it specific permission to access that directory. I like that, actually, because it’s safer. Here’s the relevant portion from the documentation:

# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.

The syntax for giving permission is relatively simple. Here’s the exact code from my httpd.conf in order to enable access to moin: Note that although the moin documentation says you should add this stuff at the end of the httpd.conf file, that’s relevant only to apache 1.X. Apache 2.2 really expects to see it in a specific place set aside for it.

# Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    <Directory "/usr/local/share/moin/">
      Allow from all
      Include etc/apache22/Includes/*.conf
    </Directory>

    Alias /wiki/ "/usr/local/share/moin/htdocs/"

    <Directory "/usr/local/www/wiki/">
      Allow from all
      Include etc/apache22/Includes/*.conf
    </Directory>
    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "/usr/local/www/apache22/cgi-bin/"

    ScriptAlias /mywiki "/usr/local/www/wiki/moin.cgi"
 </IfModule>

Note that although the moin documentation says you should add this stuff at the end of the httpd.conf file, that’s relevant only to apache 1.X. Apache 2.2 really expects to see it in a specific place set aside for it. Note that my paths are all for FreeBSD, which has a very very simple moin install. You install apache, python, mod python and so on. Then cd /usr/ports/www/moinmoin && make install clean && make instance

That’s it. You now have a wiki instance in /usr/local/www/wiki. Love that OS.

1 Comment »

  1. Ok, I have apache 2.2 installed on my C drive under C:\appz\webhosting\
    My root directory is
    C:\webpage\
    My perl is installed to
    usr/bin/perl in the root dir
    and cgi-bin is in root dir IE webpage/cgi-bin.

    When I try to access hello.cgi(a test cgi script) it tells me permission denied. you seemed to know most of what your talking about in these apache helps. can you take a look at my httpd.conf for me and let me know what I have to do to allow access to the cgi-bin?

    Danke
    I will attach it to a reply email

    Comment by Jonathan — April 28, 2008 @ 9:03 am


RSS feed for comments on this post. TrackBack URI

Leave a reply to Jonathan Cancel reply

Blog at WordPress.com.