티스토리 뷰

OpenSUSE 11 Apache2 Basic Authentication


Basic Authentication

 

Enable Basic Authentication to limit access on specific web pages.



1. For example, Configure Basic Authentication setting under the directory [/srv/www/htdocs/auth-basic].


www:~ # a2enmod auth_basic 

www:~ # mkdir /srv/www/htdocs/auth-basic 


www:~ # vi /etc/apache2/conf.d/auth-basic.conf

# create new

 <Directory /srv/www/htdocs/auth-basic>

    AuthType Basic

    AuthName "Basic Authentication"

    AuthUserFile /etc/apache2/.htpasswd

    require valid-user

</Directory>


# add a user : create a new file with "-c" (add the "-c" option only for the initial regist)

www:~ # htpasswd2 -c /etc/apache2/.htpasswd suse 

New password:     # set password

Re-type new password: 

Adding password for user suse


www:~ # /etc/init.d/apache2 restart


# create a test page

www:~ # vi /srv/www/htdocs/auth-basic/index.html

 <html>

<body>

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

Test Page for Basic Auth

</div>

</body>

</html>




2. Access to 'http://(your server's name or IP address)/



 Access to the test page from a client computer with a web browser. Then authentication is required like follows as a setting, answer with a user added in [1].



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

'EN > OpenSUSE 11' 카테고리의 다른 글

OpenSUSE 11 MySQL Install MySQL  (0) 2016.05.10
OpenSUSE 11 Apache2 WebDAV Settings  (0) 2016.05.08
OpenSUSE 11 Apache2 Basic Authentication  (0) 2016.05.08
OpenSUSE 11 Apache2 SSL Settings  (0) 2016.05.08
OpenSUSE 11 Apache2 Virtual Hostings  (0) 2016.05.08
OpenSUSE 11 Apache2 Enable userdir  (0) 2016.05.08
댓글