ホーム > linux > 玄箱を Debian化して遊ぶ その6 Apache2インストール

玄箱を Debian化して遊ぶ その6 Apache2インストール

前回はApacheをインストールしましたが、どうやらApache2の方が良いみたいなので、こちらに乗り換えることにしました。

ってことで、今回もやったことをメモしたいと思います。

$ su
Password:
# aptitude update
# aptitude install apache2-mpm-prefork

これでインストールされます。
そして、ドメイン管理ユーザーを作ったほうがいいようなので作ります。

# adduser webadmin
Adding user `webadmin’ …
Adding new group `webadmin’ (1000) …
Adding new user `webadmin’ (1000) with group `webadmin’ …
Creating home directory `/home/webadmin’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for webadmin
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [y/N] y

Homeディレクトリにサイト用ディレクトリを作成します。

# mkdir htdocs

DocumentRootなどを変更

# cd /etc/apache2/sites-available/
# cp default default.org

defaultファイルの修正

# vi default

編集します。

DocumentRoot /var/www/

を・・・

DocumentRoot /home/webadmin/htdocs/

<Directory /var/www/>

を・・・

<Directory /home/webadmin/htdocs/>

RedirectMatch ^/$ /apache2-default/

を・・・

#RedirectMatch ^/$ /apache2-default/

apache2.confの修正

文字コードをメタタグの指定に任せる

# cd /etc/apache2/
# cp apache2.conf apache2.org

# vi apache2.conf
AddDefaultCharset off

日本語を優先するよう LanguagePriority のjpを先頭へ

LanguagePriority ja en da nl et fr de el it ko no pl pt pt-br ltz ca es sv tw

これで設定完了と思うw

しかし、設定完了だが、今後は、PHPもつかえるようにしたい。


Photo by Army.mil

カテゴリー: linux タグ: ,
  1. コメントはまだありません。
  1. トラックバックはまだありません。