10/16/2010

Enable userdir

[1] Configure httpd
[root@www ~]# vi /etc/httpd/conf/httpd.conf

# line 355: make it comment
#UserDir disable

# line 362: uncomment
UserDir public_html

# line 370-381: uncomment

AllowOverride All# change
Options ExecCGI# enable CGI

Order allow,deny
Allow from all


Order deny,allow
Deny from all



[root@www ~]# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[2] Make CGI test page in a user's home directory and access to it with web browser. It's OK if following page is shown.
[cent@www ~]$ mkdir public_html
[cent@www ~]$ chmod 711 /home/cent
[cent@www ~]$ chmod 755 /home/cent/public_html
[cent@www ~]$ cd public_html
[cent@www public_html]$ vi index.cgi

#!/usr/local/bin/perl

print "Content-type: text/html\n\n";
print <<"EOM";
CGI test page
EOM
exit;
[cent@www public_html]$ chmod 705 index.cgi

No comments:

Post a Comment