Debian 同様、簡単にインストールすることができました。インストールで Debian と違う点は、デフォルトの MTA として Postfix が採用されている点と、インストール時のソフトウェアの選択で、「Manual package selection」にチェックを入れることで、インストールするパッケージを細かく選択することができる点でしょうか。
自分の場合は、LAMP、Mail Server、OpenSSH、PostgreSQL database をインストールしました。
Ubuntu では、基本的に直接 root でログインすることができません。そのため root 権限が必要な操作に関しては sudo コマンドを使用します。
この制約の実体は、root にパスワードが設定されていないためのようです。root で操作しないというのは、セキュリティ上好ましいことではあるのですが、今まで root でログインして操作するのに慣れていて、どうも不便に感じてしまうため、今回は root にパスワードを設定して、直接ログインが可能な状態にします。
user@host:~$ sudo su [sudo] password for user: root@host:/home/user# passwd 新しいUNIXパスワードを入力してください: 新しいUNIX パスワードを再入力してください: passwd: password updated successfullyで、次はネットワーク設定の変更。Ubuntu はインストールの段階で固定 IP を割り振ることができません。かといって Debian のように、インストールの時点でデスクトップ環境をインストールすることもできないため、GUI で操作は、GUI 環境を別途インストールいない限りできません。
ネットワークの設定にわざわざ GUI を入れることもないので、CUI 環境で行います。
具体的には interfaces ファイルの内容を変更するのですが、まずは、念のためバックアップをとります。
root@host:~# cp -a /etc/network/interfaces /etc/network/interfaces.backupバックアップしたら、次は編集。
root@host:~# vi /etc/network/interfacesdhcp と書かれた部分を static に変更し、NIC に関する設定を追加します。
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.120
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.1.1
dns-search domain.com
編集後、reboot することで変更した設定が反映されます。次は Apache2 の設定を行います。 まずは、デフォルトのサイトの設定。Debian の時と同じですね。
root@host~:# vi /etc/apache2/sites-enabled/000-defaultコメントアウトがデフォルトの設定、その下の行にあるのが変更した内容です。
<Directory /var/www/>
# Options Indexes FollowSymLinks MultiViews
Options Includes ExecCGI FollowSymLinks Indexes
# AllowOverride None
AllowOverride All
Order allow,deny
allow from all
</Directory>
ユーザーディレクトリを有効にします。
root@host:~# a2enmod userdir Enabling module userdir. Run '/etc/init.d/apache2 restart' to activate new configuration!ユーザーディレクトリに関する設定の変更を行います。
root@host:~# vi /etc/apache2/mods-enabled/userdir.confコメントアウトした方がデフォルトの設定で、その 1 行下に書かれてている設定が変更内容です。
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root
<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit Indexes
AllowOverride All
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Options IncludesNoExec ExecCGI FollowSymLinks
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
</IfModule>
変更内容を反映するため、Apache を再起動します。
root@host:~# /etc/init.d/apache2 restart * Restarting web server apache2 [ OK ]MySQL の設定内容を変更します。
root@host:~# vi /etc/mysql/my.cnfこれも Debian とほぼ同様、文字コードの設定となります。[mysqld_safe] [mysqld] [mysql] に default-character-set を追加します。
[mysqld_safe] default-character-set = utf8 [mysqld] default-character-set = utf8 [mysql] default-character-set = utf8で、MySQL 再起動。
root@host:~# /etc/init.d/mysql restart * Stopping MySQL database server mysqld [ OK ] * Starting MySQL database server mysqld [ OK ] * Checking for corrupt, not cleanly closed and upgrade needing tables.おまけ。zip ファイルを解凍しようとしたら、unzip が入っていなかったのでインストールしました。
root@host:~# unzip プログラム 'unzip' はまだインストールされていません。 次のように入力することでインストールできます: apt-get install unzip -bash: unzip: command not found root@host:~# aptitude install unzip参考にしたリンク
コメント