5
4

More than 5 years have passed since last update.

Cloud 9のプレビューサーバーに BASIC認証をかける

Posted at

Cloud9では、プライベートプロジェクトでもサーバーを「Public」に設定することで、外部の人に見せることができます。

ただし、BASIC認証をかけておこうと次のような .htaccessを書くと Internal Server Errorが発生します。

<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
AuthUserFile .../.htpasswd
AuthGroupFile /dev/null
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user 
order deny,allow

Cloud9のサーバーでは「AuthGroupFile」の記述が不要のようです。以下のようになります。

<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
AuthUserFile .../.htpasswd
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user 
order deny,allow
5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4