Changes

Jump to: navigation, search

Tung httpd conf

1,085 bytes added, 18:40, 27 July 2011
no edit summary
#* Confirm the context type is correct: <b><code><font color=green >ls -Z public_html</font></code></b>
# Open a browser, and enter <code> http://hostname/~your-user-id/</code>. Your personal page should display.
 
===Create a web script in user's home===
#Login as a root
#Edit configuration file /etc/httpd/conf/httpd.conf again. Add lines
#Restart the Apache server: service httpd restart
#By default, selinux doesn't allow Apache Server to read file inside user's home. Change the default setting: setsebool -P httpd_enable_cgi 1
#Add context type to make script exexutable. To do that you need to add expressions for cgi file and public_html that more specific that the default expression.
#*For public_html: semanage fcontext -at httpd_sys_script_exec_t "/home/[^/]*/public_html"
#*For cgi files: semanage fcontext -at httpd_sys_script_exec_t "/home/[^/]*/public_html/.+\.cgi"
#*For non-cgi files: semanage fcontext -at httpd_user_content_t "/home/[^/]*/public_html/.+"
#Apply the context: restorecon -vRF public_html
#Logout root
#Create diskfree.cgi and change its permission to executable: chmod 705 /home/user/public_html/*.cgi
#Write lines in diskfree.cgi
#Open a browser, and enter http://hostname/~your-user-id/diskfree.cgi . The disk usage of your computer should be displayed.
1
edit

Navigation menu