Fedora12 + Httpd + Userdir + SElinuxWorks

Source: Internet
Author: User
FirstinstallLAMPstackseetheguideonHowtoForgereplace $ USERforyourusernamemkdir $ USER/public_htmlfirefoxhttp: // localhost /~ $ USER/IfyouseeonlyForbidden (403), don 'tworry, dothis: I

First install LAMP stack see the guide on HowtoForge

Replace $ USER for your username

Mkdir $ USER/public_html
Firefox http: // localhost /~ $ USER/
If you see only Forbidden (403), don't worry, do this:

I made a patch file (if you made custom changes on httpd. conf don't use this file, do manual changes)

Install patch on your system and patch httpd. conf

Yum install patch
My patch file:

--- Httpd-patch.conf 14:59:51. 811850034-0800
++ Httpd. conf 14:25:04. 527864263-0800
@-349,14 + 349,15 @@
# Of a username on the system (depending on home directory
# Permissions ).
#
-UserDir disabled
+ # UserDir disabled
+ UserDir enabled $ USER
 
#
# To enable requests /~ User/to serve the user's public_html
# Directory, remove the "UserDir disabled" line above, and uncomment
# The following line instead:
#
-# UserDir public_html
+ UserDir public_html
 
 
 
@-364,18 + 365,18 @@
# Control access to UserDir directories. The following is an example
# For a site where these directories are restricted to read-only.
#
-#
-# AllowOverride FileInfo AuthConfig Limit
-# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
-#
-# Order allow, deny
-# Allow from all
-#
-#
-# Order deny, allow
-# Deny from all
-#
-#
+
+ AllowOverride FileInfo AuthConfig Limit
+ Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
+
+ Order allow, deny
+ Allow from all
+
+
+ Order deny, allow
+ Deny from all
+
+
 
#
# DirectoryIndex: sets the file that Apache will serve if a directory
Next do:

Patch/etc/httpd. conf <patch1.txt
Chmod 711/home/$ USER
Chmod 755/home/$ USER/public_html
Chcon-R-t httpd_sys_content_t/home/$ USER/public_html
Setsebool-P httpd_enable_homedirs 1
Now:

Firefox http: // localhost /~ $ USER/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.