zaininnari wiki



インストール

sudo apt-get install apache2 apache2-utils apache2.2-common apache2-mpm-prefork

ヴァーチャルホスト設定

ユーザー領域(/home/ユーザー名)にPublic_htmlを作成

cd ~
mkdir -p var/www/public_html

Public_htmlにホストするドメインの領域を作成

  • Public_htmlにホストするドメインの領域を作成。
  • 領域内には{各フォルダ}が作成されます。
  • 公開フォルダはpublic_html/HOST名/public
mkdir -p var/www/public_html/test/{public,private,log,cgi-bin,backup}

apache側の設定

  • 「hostname」を適宜読み替え
sudo vi /etc/apache2/sites-available/hostname
  • 以下を記述
<VirtualHost *:80>

# Admin email, Server Name (domain name) and any aliases
#ServerAdmin info@example.com
ServerName example.com
#ServerAlias www.example.com

# Index file and Document Root (where the public files are located)
DirectoryIndex index.php index.html
DocumentRoot /home/username/public_html/example/public

# Custom log file locations
LogLevel warn
ErrorLog  /home/username/public_html/example/log/error.log
CustomLog /home/username/public_html/example/log/access.log combined

</VirtualHost>
  • VirtualHostを有効にする
cd /etc/apache2/sites-available
sudo a2ensite test
  • 再起動
sudo /etc/init.d/apache2 reload
apahceからの権限を付与
  • aclの導入が必要
  • www-data:Apacheユーザ
  • <ユーザー名>:ユーザー名
sudo setfacl -m u:www-data:rwx,g:www-data:rwx /home/<ユーザー名>/public_html/

エラーの説明&対処

error.log:「 [warn] NameVirtualHost 127.0.0.1:0 has no VirtualHosts」

  • インクルードされている.confファイル内で、「NameVirtualHost」が干渉している可能性がある

error.log:「 [notice] Digest: ~ 」

[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
  • mod_auth_digest.so(ダイジェスト認証のモジュール)を組み込んでいるとapache起動時に表示される
  • ダイジェスト認証とは

Menu

メニューサンプル1

メニューサンプル2

開くメニュー

閉じるメニュー

  • アイテム
  • アイテム
  • アイテム
【メニュー編集】

管理人/副管理人のみ編集できます