You are not logged in.

#1 2004-07-23 15:08:54

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 707
Website

httpd: forbiddon?

I want to have a folder in my home directory on my website.  I tried symlinking with a symlink in the root of my httpd and I set the folder to a+rx...  When I access the folder on the website, I get a forbidden message...  What's wrong?


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#2 2004-07-23 20:55:47

neotuli
Lazy Developer
From: San Francisco, CA
Registered: 2004-07-06
Posts: 1,201
Website

Re: httpd: forbiddon?

There is a feature in apache which allows people to access a given user's stuff via http://your_website/~username/ . You can get this to work by making a folder in your home directory called "public_html" . Make sure your home directory is exectuable by all, so "chmod 0771 ~" would be fine. Then also make sure that your ~/public_html directory is readable and executable by all..so "chmod 0775 ~/public_html" would work.

Now enabling it in the apache config file. Make sure the following lines/sections exist and are not commented out:

LoadModule userdir_module lib/apache/mod_userdir.so

This one is to enable the apache module for this.

<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options All Includes ExecCGI
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>

And this is a directory entry to make all the user's directories accessible with whatever options you want to put in there (see apache manual). 

Now just (re)start apache to get the new config loaded, throw whatever you want to in ~/public_html, then visit http://127.0.0.1/~yourusername/fileyouwant  ,  to test it out.

Best of luck and I hope this helps.


The suggestion box only accepts patches.

Offline

#3 2004-07-24 03:03:52

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: httpd: forbiddon?

On an arch system 771 isn't exactly the best idea.  Everyone shares the same group, so anyone would be able to write to your home dir.  Try 711.  Same thing with ~/public_html, 755.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

Board footer

Powered by FluxBB