轉貼:在 RedHat 7.2 Linux 系統下實現提供個人首頁空間服務的方法

來源:互聯網
上載者:User
在linux中,可以用apache 和 wu-ftpd 伺服器通過一些簡單設定,實現個人空間服務,apache是web伺服器,ftp提供首頁上傳功能.本文以redhat 7.2 linux為例,假設apache 和 wu-ftpd伺服器已經安裝,具體配置方法如下:

(1)安裝redhat7.2 linux時選擇"伺服器"或者定製安裝伺服器軟體;

(2)修改/etc/httpd/conf/httpd.conf檔案中下面關於個人空間設定的一段.(//後是詳細說明)

UserDir public_html //此處修改預設目錄,可修改,應該與下面的

//相對應

#

# Control access to UserDir directories. The following is an example

# for a site where these directories are restricted to read-only.

#

# //

# AllowOverride FileInfo AuthConfig Limit

# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

#

# Order allow,deny

# Allow from all

#

#

# Order deny,allow

# Deny from all

#

# //.....行之間的所有#去掉,使得個人首頁使用者的設定生效.並且""中的 "/home/*/public_html"是個人首頁服務在linux中存放位置的設定 *代表使用者名稱產生的目錄名.

重新啟動httpd服務:httpd stop / httpd start 或者httpd restart

(3) 添加一個ftp使用者的shell,使其不能使用命令,和telnet 和ssh服務

編輯/etc/shells檔案,在檔案最後添加一行"/dev/null"的內容

(4)添加一個ftpchroot族,改組中的使用者將已自己的home目錄作為ftp根目錄

groupadd ftpchroot

(5)使用者申請個人首頁空間時,所用的使用者名稱在linux上要作為ftpchroot組的使用者.以下操作以test使用者為例:

建立一個使用者test ;密碼:test

usradd test -s /dev/null -g ftpchroot

passwd test

這樣就在/home目錄下自動產生一個test的目錄.

(6)進入test目錄,建立個人首頁發布目錄public_html,然後進行使用權限設定

cd /home/test

mkdir public_html

chmod 711 /home/test

chmod 755 /home/test/public_html

ok,現在只要將網頁檔案通過用使用者名稱test密碼為test,使用ftp上傳到自己ftp目錄下的public_html目錄就可以啟動自己的web服務了,系統預設為index.html檔案.

後記:如果伺服器系統安裝完整,在個人首頁中可以支援php jsp動態網頁和mysql postgresql資料庫.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.