LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-07-2007, 01:23 AM   #1
adam_blackice
Member
 
Registered: Apr 2006
Location: /*Egypt */ //cairo
Distribution: Ubuntu 7.04 , SLED 10 , Fedora , RHEL 5
Posts: 312

Rep: Reputation: 32
Helping in implementing a public_html in apache


hello all

i have tried to make the public html on the apache but i failed

first i have configured apache httpd.conf file to enable the UserDir directive as follows

[HTML]<IfModule mod_userdir.c>


#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
# UserDir disable

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir public_html

</IfModule>

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
# <LimitExcept GET POST OPTIONS>
# Order deny,allow
# Deny from all
# </LimitExcept>
</Directory>[/HTML]

second i create a new dir in my home dir (blackice) named with public_html and i create an index.html page for testing ... and i change all permission of the public_html dir and the file also
then i restarted apache ....

but if i tried to access it throw http://localhost/~blackice/ i got the following error ....

[HTML] Not Found

The requested URL /~blackice/ was not found on this server.
Apache/2.2.4 (Fedora) Server at localhost Port 80[/HTML]
 
Old 08-07-2007, 01:55 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Try doing
Code:
#chmod 755 /home/blackice
#chmod 755 /home/blackice/public_html
If you are using selinux, do
Code:
#chcon -t httpd_sys_content_t /home/blackice/public_html
 
Old 08-07-2007, 04:00 AM   #3
adam_blackice
Member
 
Registered: Apr 2006
Location: /*Egypt */ //cairo
Distribution: Ubuntu 7.04 , SLED 10 , Fedora , RHEL 5
Posts: 312

Original Poster
Rep: Reputation: 32
also it doesn't work :S

i was setting the right permissions for /home

and iam not usnig SELINUX i disabled it but when i ran this command

#chcon -t httpd_sys_content_t /home/blackice/public_html

chcon: can't apply partial context to unlabeled file /home/blackice/public_html

is that related to the disabling of the SElinux ? .

and by the way thanks for you help
 
Old 08-07-2007, 03:16 PM   #4
adam_blackice
Member
 
Registered: Apr 2006
Location: /*Egypt */ //cairo
Distribution: Ubuntu 7.04 , SLED 10 , Fedora , RHEL 5
Posts: 312

Original Poster
Rep: Reputation: 32
any suggestion for this problem ? !
 
Old 08-08-2007, 03:46 AM   #5
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
I think the problem could be selinux related but I find it a bit baffling since you say its disabled. Anyway, search on google for "chcon: can't apply partial context to unlabeled file public html". There are others who had similar problems, so maybe you may find a solution.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache+.htaccess+public_html willigiann Linux - Networking 1 01-16-2007 09:17 PM
Ads for users public_html on Apache 2 Oxagast Linux - Software 5 10-09-2005 06:27 PM
apache UserDir public_html problem aeshley Linux - Newbie 4 11-29-2004 01:58 AM
Problem with Apache and public_html MiB_24 Linux - General 3 07-28-2002 12:33 AM
apache UserDir public_html problem aeshley Linux - Networking 4 01-17-2002 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration