help with configuring Apache to access user directories
Hi all, Can anyone offer some hints as to how to make public_html folders available for access by apache? I'm trying to set up a server in which users can create html files within a folder (eg: /alanh/public_html) which can be made available on the school intranet. I've checked the folder permissions and they seen ok, httpd.conf seems ok but I get the following errors when trying to access the test html file via lynx :- lynx 192.168.1.10/~alanh !Alert: http/1.1 403 Forbidden! I'd like to get this working - any hints / help / etc? I've tried this under Suse 7 and Red Hat 6.1 with the same result so it seems like i'm making a fundamental and possibly obvious error here.... Alan ----------------------------------------------------- Alan Harris Network Manager Bryngwyn School Tel : 01554 750661 Fax : 01554 758255 E-mail: alanh@bryngwyn.carmarthen.sch ----------------------------------------------------- Notes: 1. The contents of this email may be snooped on by interested government parties for unknown purposes! Regulation of Investigatory Powers Act, 2000. 2. The opinions expressed in this email are personal and may not be shared by Bryngwyn School. -----------------------------------------------------
On Tue, 27 Mar 2001, Alan Harris wrote:
Hi all, Can anyone offer some hints as to how to make public_html folders available for access by apache? I'm trying to set up a server in which users can create html files within a folder (eg: /alanh/public_html) which can be made available on the school intranet. I've checked the folder permissions and they seen ok, httpd.conf seems ok but I get the following errors when trying to access the test html file via lynx :- lynx 192.168.1.10/~alanh !Alert: http/1.1 403 Forbidden! I'd like to get this working - any hints / help / etc?
What permissions do you have on: /home/username /home/username/public_html /home/username/public_html/index.html ? Michael
Michael Brown wrote:
I've checked the folder permissions and they seen ok, httpd.conf seems ok but I get the following errors when trying to access the test html file via lynx :- lynx 192.168.1.10/~alanh !Alert: http/1.1 403 Forbidden! I'd like to get this working - any hints / help / etc?
What permissions do you have on:
/home/username /home/username/public_html /home/username/public_html/index.html ?
I get a similar message with virtual hosts under apache -- I've got three defined: http://debian/ -- a mirror of koffice.org from CVS for testing purposes http://info.debian/ -- the phpSysInfo program http://doc.debian/ -- Supposedly the Apache manual The only one that doesn't work is doc.debian -- I've chmod +r htdocs -R to set read permissions for all, and the virual host format is identical to that of info.debian -- but I get the 403 forbidden. It's got me stumped! -- Chris Howells E-Mail: chris.h@gmx.co.uk ICQ: 93699029 Web: http://www.chowells.uklinux.net
You also need execute permissions for directories. That's the one that gets most people (including me) On Tuesday 27 March 2001 7:51 pm, Chris Howells wrote:
Michael Brown wrote:
I've checked the folder permissions and they seen ok, httpd.conf seems ok but I get the following errors when trying to access the test html file via lynx :- lynx 192.168.1.10/~alanh !Alert: http/1.1 403 Forbidden! I'd like to get this working - any hints / help / etc?
What permissions do you have on:
/home/username /home/username/public_html /home/username/public_html/index.html ?
I get a similar message with virtual hosts under apache -- I've got three defined:
http://debian/ -- a mirror of koffice.org from CVS for testing purposes http://info.debian/ -- the phpSysInfo program http://doc.debian/ -- Supposedly the Apache manual
The only one that doesn't work is doc.debian -- I've chmod +r htdocs -R to set read permissions for all, and the virual host format is identical to that of info.debian -- but I get the 403 forbidden.
It's got me stumped!
-- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
Hi Michael + all, in my alter ego mode now, working from home! Michael Brown wrote:
What permissions do you have on:
/home/username drwx /home/username/public_html drwxr-xr-x /home/username/public_html/index.html ? -rw-r--r--
Used chmod +x index.html on last one to give -rwxr-xr-x but no difference Alan
On Tue, 27 Mar 2001, aeh1962 wrote:
/home/username drwx /home/username/public_html drwxr-xr-x /home/username/public_html/index.html ? -rw-r--r-- Used chmod +x index.html on last one to give -rwxr-xr-x but no difference
Try chmod o+x /home/username (My mail client seems to have mangled something - I'm only seeing the permissions you list for /home/username as "drwx", with the group and world sets both missing.) HTH, Michael
It's probably still permissions. Try: ls -ld / /alanh /alanh/public_html /alanh/public_html/index.html All the dir's need read and exec permissions for 'other' (the last bit) the file needs read permission for other Have a look in the error log - check httpd.conf for it's location - to see what it's complaining about. On Tuesday 27 March 2001 5:12 pm, Alan Harris wrote:
Hi all,
Can anyone offer some hints as to how to make public_html folders available for access by apache?
I'm trying to set up a server in which users can create html files within a folder (eg: /alanh/public_html) which can be made available on the school intranet.
I've checked the folder permissions and they seen ok, httpd.conf seems ok but I get the following errors when trying to access the test html file via lynx :-
lynx 192.168.1.10/~alanh
!Alert: http/1.1 403 Forbidden!
I'd like to get this working - any hints / help / etc?
I've tried this under Suse 7 and Red Hat 6.1 with the same result so it seems like i'm making a fundamental and possibly obvious error here....
Alan
----------------------------------------------------- Alan Harris Network Manager Bryngwyn School
Tel : 01554 750661 Fax : 01554 758255 E-mail: alanh@bryngwyn.carmarthen.sch
-----------------------------------------------------
Notes:
1. The contents of this email may be snooped on by interested government parties for unknown purposes! Regulation of Investigatory Powers Act, 2000.
2. The opinions expressed in this email are personal and may not be shared by Bryngwyn School.
-----------------------------------------------------
-- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
Sorry it's taken so long but at last I can contribute !
Michael Culverhouse. Currently I have three hats, Linux advocate, Contract
Unix Sys Admin. System Support Manager for Internet co.
I have two school age children and initially came to the list to find out
what I could do for local schools.
My childrens own school (junior) were totally bemused when I suggested I
could install Linux for them at no cost. They said they would let me know.
Anyway onto Apache. First rule 'check the logs'.
You need to look at the httpd.conf file to see where the error log lives.
Default, when installing from source, is /usr/local/apache/logs.
Another useful command is `locate error_log` assuming slocate is run on a
regular basis otherwise try `find / -name error_log`.
This file should give you the information you need to fix the problem (if
you have the right level of logging switched on also!).
Hope that helps.
Mike
btw It feels good to have come out from lurking :), Also I'm glad to see the
OSE discussion moved on. It was taking forever to catch up with the mail :)
----- Original Message -----
From: Alan Harris
Hi all,
Can anyone offer some hints as to how to make public_html folders available for access by apache?
I'm trying to set up a server in which users can create html files within a folder (eg: /alanh/public_html) which can be made available on the school intranet.
I've checked the folder permissions and they seen ok, httpd.conf seems ok but I get the following errors when trying to access the test html file via lynx :-
lynx 192.168.1.10/~alanh
!Alert: http/1.1 403 Forbidden!
I'd like to get this working - any hints / help / etc?
I've tried this under Suse 7 and Red Hat 6.1 with the same result so it seems like i'm making a fundamental and possibly obvious error here....
Alan
Michael Culverhouse wrote:
Anyway onto Apache. First rule 'check the logs'.
Ah yes, so obvious, but I forgot to! ;) Cheers, -- Chris Howells E-Mail: chris.h@gmx.co.uk ICQ: 93699029 Web: http://www.chowells.uklinux.net
hi
after some examination of this problem, too long :-), it seems that access to
public_html is effected by the permissions on the /home/username directory
(?) and that changing permissions for to:-
drwx--x--x 60 mherbert mherbert 8192 Mar 28 05:46 /home/mherbert
and for:-
drwxr-xr-x 2 mherbert mherbert 4096 Mar 28 06:09 public_html
for the public_html directory.
The httpd.conf file will have a UserDir entry like:-
#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
UserDir public_html
this then gives you a URL of something like:-
http://www.hungerstone.co.uk/~mherbert/
however remember you need a file like index.html in place, as Apache will not
allow directory browsing by default, see the DirectoryIndex directive in
httpd.conf
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
DirectoryIndex index.html index.htm index.shtml index.php index.php4
index.php3 index.cgi
However, i'm not happy with the permissions, not with the fact of having a ~
in the URL (always a pain!). So alternatively you can use a VirtualHost,
something like:-
#
<VirtualHost people.hungerstone.co.uk>
ServerAdmin webmaster@hungerstone.co.uk
DocumentRoot /home/www/people
ServerName people.hungerstone.co.uk
ErrorLog logs/error-people.log
CustomLog logs/access-people.log common
</VirtualHost>
(you need to check the NameVirtualHost directive, to your IP number for your
web server)
You can then put your user html files into the directory below
/home/www/people, ie /home/www/people/mherbert giving you a URL
http://people.hungerstone.co.uk/mherbert/
Use a symbolic link from the users directory...
ln -s /home/www/people/mherbert /home/mherbert/public_html
nicer.....:-). This is based on Red Hat 7.0, with everything in httpd.conf
for the apache settings. Seems apachectl has gone, so did my restarts using
/etc/init.d/httpd
Hi all,
Can anyone offer some hints as to how to make public_html folders available for access by apache?
I'm trying to set up a server in which users can create html files within a folder (eg: /alanh/public_html) which can be made available on the school intranet.
I've checked the folder permissions and they seen ok, httpd.conf seems ok but I get the following errors when trying to access the test html file via lynx :-
lynx 192.168.1.10/~alanh
!Alert: http/1.1 403 Forbidden!
I'd like to get this working - any hints / help / etc?
I've tried this under Suse 7 and Red Hat 6.1 with the same result so it seems like i'm making a fundamental and possibly obvious error here....
Alan
----------------------------------------------------- Alan Harris Network Manager Bryngwyn School
Tel : 01554 750661 Fax : 01554 758255 E-mail: alanh@bryngwyn.carmarthen.sch
-----------------------------------------------------
Notes:
1. The contents of this email may be snooped on by interested government parties for unknown purposes! Regulation of Investigatory Powers Act, 2000.
2. The opinions expressed in this email are personal and may not be shared by Bryngwyn School.
-----------------------------------------------------
-- ------------------------------------ Malcolm Herbert Red Hat Europe t:+44 1483 734955 m:+44 7720 079845 ------------------------------------
Hello y'all At 06:30 28/03/01 +0000, Malcolm Herbert wrote:
However, i'm not happy with the permissions, not with the fact of having a ~ in the URL (always a pain!). So alternatively you can use a VirtualHost, something like:-
# <VirtualHost people.hungerstone.co.uk> ... </VirtualHost>
You'll get faster throughput (by avoiding dns lookups) if you specify the
ip address and port of the REAL one in the virtual host directive. This
has the disadvantage of requiring re-editing should you change the ip
address of the REAL apache server at any time in the future, but it does
make for considerably less traffic ...
e.g.
participants (8)
-
aeh1962
-
Alan Harris
-
Andrew Ray
-
Chris Howells
-
Gary Stainburn
-
Malcolm Herbert
-
Michael Brown
-
Michael Culverhouse