page counter next up previous contents
Next: Virtual Host 虛擬主機 Up: Apache 2.2 HTTP Server Previous: Apache HTTP server 架設   Contents   DYWANG_HOME

UserDir 用戶個人網頁

  1. UserDir 模組:可以讓伺服器中的用戶,擁有自己的網頁。例如:http://kvm8.deyu.wang/~deyu1
    [root@kvm8 ~]# vim /etc/httpd/conf/httpd.conf 
    
    <IfModule mod_userdir.c>
        #
        # UserDir is disabled by default since it can confirm the presence
        # of a username on the system (depending on home directory
        # permissions).
        #
        #UserDir disabled  <= 註解這一行
    
        #
        # To enable requests to /~user/ to serve the user's public_html
        # directory, remove the "UserDir disabled" line above, and uncomment
        # the following line instead:
        # 
        UserDir public_html  <= 取消註解這行,個人網頁根目錄為 public_html
    
    </IfModule>
    
    #
    # Control access to UserDir directories.  The following is an example
    # for a site where these directories are restricted to read-only.
    #
    <Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        <Limit GET POST OPTIONS>
            Order allow,deny
            Allow from all
        </Limit>
        <LimitExcept GET POST OPTIONS>
            Order deny,allow
            Deny from all
        </LimitExcept>
    </Directory>
    



De-Yu Wang 2020-05-19