티스토리 뷰

CentOS 5 WEB Server Enable userdir


Enable userdir

 

Enable userdir, users can build websites with this config.



1. Configure httpd to use UserDir.


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

# line 355: comment out

#UserDir disable


# line 362: uncomment

UserDir public_html


# line 370 - 381: 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>


[root@www ~]# /etc/rc.d/init.d/httpd restart 

Stopping httpd: [ OK ]

Starting httpd: [ OK ]




2. Create a test page as a user and access to it with a web browser on Client to make sure it works normally.


[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 "<html>\n<body>\n";

print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n";

print "Test Page ( /home/cent/public_html )";

print "\n</div>\n";

print "</body>\n</html>\n";


[cent@www public_html]$ chmod 705 index.cgi


※ Next manual



저작자 표시 비영리 변경 금지
신고

'EN > CentOS 5' 카테고리의 다른 글

CentOS 5 WEB Server Virtual Hostings  (0) 2016.06.01
CentOS 5 WEB Server Configure SSL  (0) 2016.06.01
CentOS 5 WEB Server Enable userdir  (0) 2016.06.01
CentOS 5 WEB Server Install Ruby  (0) 2016.06.01
CentOS 5 WEB Server Install PHP  (0) 2016.06.01
CentOS 5 WEB Server Install httpd  (0) 2016.06.01
댓글