歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> Linux文化 >> Redhat9下用 apache2.0實現個人主頁

Redhat9下用 apache2.0實現個人主頁

日期:2017/2/27 11:55:47   编辑:Linux文化

1、系統平台:redhat9.0

基本要求:有一個apache2.0的安裝。並且包含了mod_userdir模塊。 默認的安裝包含該模塊。

./configure --disable-all --enable-module=alias --enable-module=access --enable-module=auth --enable-module=log_config --enable-module=dir --enable-module=mime --enable-module =userdir make make install

###編輯httpd.conf。添加內容如下

UserDir sites

UserDir enabled testuser #只給這個用戶開啟個人空間

###使每個用戶都擁有各自的cgi腳本目錄

Options ExecCGI SetHandler cgi-script

########結束##########

說明:用UserDir dir指定目錄時,dir可以有三種表示方法

UserDir dir 目錄前沒有“/”,此時指該dir在用戶的主目錄裡.

既http://localhost/~test----->/home/test/dir test用戶的個人主頁空間

UserDir /var/web 此時用戶主頁存放在/var/html/username目錄裡

httpd://localhost/~testuser----->/var/web/testuser

UserDir /var/*/html 此時的用戶的主頁存放在/var/username/html目錄裡

httpd://localhost/~testuser------->/var/testuser/html

2、准備目錄

cd /etc/skel

mkdir sites

echo "this is user homepage" >> sites/index.html

3、添加實驗用戶

useradd testuser

4、測試

http://domainname/~testuser

Copyright © Linux教程網 All Rights Reserved