カテゴリー: IT tips

Ubuntuでapache2のrewrite を有効にする

Ubuntuでapache2のrewriteを有効にする作業をしたのでメモ。

# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
# service apache2 restart

# vi sites-available/default
※rewrite の設定内容は割愛します。

# service apache2 restart
* Restarting web server apache2

 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

nginx 環境でのBasic認証の設定

最近nginxを使うことになったので、apacheとの違いなどを調べて記録していきます。
今回は、Basic認証を設定するときの手順です。

# htpasswd -c /etc/xxxxxxxx/.yyyyyyyy USERNAME

New password:
Re-type new password:

# vi /etc/nginx/sites-available/default

 server {
   〜中略〜
   # Basic 認証
   location /blog {
   auth_basic    "Secret Area";
   auth_basic_user_file  "/etc/xxxxxxxx/.yyyyyyyy";
   index index.html index.php;
   }
 } 

# /etc/init.d/nginx restart

© 2023 Opendream

Theme by Anders Noren上へ ↑