Enable userdir2011/11/12 |
Enable userdir, users can build websites with this config.
|
|
[1] | Configure httpd |
[root@www ~]#
vi /etc/httpd/conf/httpd.conf # line 366: make it comment # UserDir disable
# line 372: uncomment UserDir public_html # line 380-391: uncomment <Directory /home/*/public_html> AllowOverride All # change Options ExecCGI # enable CGI <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory> systemctl restart httpd.service |
[2] | Create a CGI test page in a user's home directory and access to it with web browser. It's OK if following page is shown. |
[fedora@www ~]$ mkdir public_html [fedora@www ~]$ chmod 711 /home/fedora [fedora@www ~]$ chmod 755 /home/fedora/public_html [fedora@www ~]$ cd public_html
[fedora@www public_html]$
vi index.cgi #!/usr/local/bin/perl print "Content-type: text/html\n\n"; print "<html>\n<body>\n"; print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n"; print "Userdir Test Page"; print "\n</div>\n"; print "</body>\n</html>\n"; chmod 705 index.cgi
|
Sponsored Link |