Apache2.4 使用者認證登陸筆記!

來源:互聯網
上載者:User

標籤:apache2.4 使用者認證登陸筆記!-任志遠

apache使用者認證用利於進一步安全你的apache網站,簡單做個筆記。


1、建立指定使用者,並指明密碼。

[[email protected] apache2]# htpasswd -c /usr/local/apache2/passwords renzhiyuan

New password: 

Re-type new password: 

Adding password for user renzhiyuan

[[email protected] apache2]#

2、編輯http.conf設定檔

1.httpd.conf設定

...

  Options none

  AllowOverride AuthConfig      //開啟認證功能

  AuthName "apache login"       //顯示給使用者的資訊 

  AuthType Basic             //認證類型

  AuthUserFile /xxx/.htpasswd     //指定使用者認證檔案位置,檔案名稱、路徑可變,隱藏較好。

  Require user renzhiyuan xxx   //指定可訪問的使用者,該使用者為虛擬使用者非系統使用者,可設定多個

  Require valid-user       //.htpasswd中的所有使用者可使用者可用,這裡是renzhiyuan

 3、重啟服務

 service httpd restart


4、登陸驗證

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/87/24/wKioL1fWAcfB_IB0AACxaIICCB4659.png-wh_500x0-wm_3-wmp_4-s_3785262432.png" title="1.png" alt="wKioL1fWAcfB_IB0AACxaIICCB4659.png-wh_50" />


本文出自 “[email protected]” 部落格,請務必保留此出處http://renzhiyuan.blog.51cto.com/10433137/1851837

Apache2.4 使用者認證登陸筆記!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.