FreeBSD Servers †サーバアプリケーションとライブラリをインストールする。
サーバアプリケーションとライブラリ †Apache? †$ tar xvjf httpd-2.2.4.tar.bz2 $ cd httpd-2.2.4 $ ./configure --enable-so $ make # make install WabDav?とsslを使用する場合 †$./configure
--enable-so
--enable-dav
--enable-auth_digest
--enable-ssl
--with-ssl=/usr/local/openssl
webDAVの認証でDigest認証をする場合は、--enable-auth_digestが必要。 htdigestにてパスワードをファイルを作成するときにユーザを追加しても認証に失敗した。 htdigest passwd-file DAVDAV user としてパスワードを作成するが、DAVDAVはAuthName?で指定したものだった。 Apache Log †Apacheのログを放っておくとどんどん膨らんでしまうので、syslogによりローテートする # vi /etc/newsyslog.conf | 追加する。 /usr/local/apache2/logs/access_log 644 3 Z /var/run/httpd.pid 30 /usr/local/apache2/logs/error_log 644 3 * $M1DO Z /var/run/httpd.pid 30 | (ちょっと間違っているかも。とりあえずメモ) Apacheの自動起動 †#!/bin/sh
#
. /etc/rc.subr
name="apachectl"
rcvar=`set_rcvar`
command="/usr/local/apache2/bin/${name}"
load_rc_config $name
apachectl_enable=${apachectl_enable:-"NO"}
start_cmd="apachectl_start"
apachectl_start()
{
echo -n 'Starting Apache:'
${command} start &
}
run_rc_command $1
簡単なスクリプトを作って実行フラグを付けて /usr/local/etc/rc.d/apachectl.sh におく。 /etc/rc.confに apachectl_enable="YES" を追加すると自動起動する(はず) MySQL? †PostgreSQLを使ったり、MySQLを使ったりしていたんだけど、一本化してみる。 ソースをダウンロードする。 †http://dev.mysql.com/downloads/mysql/5.1.html ドキュメントに従ってそのままインストールしてみる。 †http://dev.mysql.com/doc/refman/5.1/ja/quick-install.html shell> groupadd mysql shell> useradd -g mysql mysql shell> gunzip < mysql-VERSION.tar.gz | tar -xvf - shell> cd mysql-VERSION shell> ./configure --prefix=/usr/local/mysql shell> make shell> make install shell> cp support-files/my-medium.cnf /etc/my.cnf shell> cd /usr/local/mysql shell> bin/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql var shell> chgrp -R mysql . shell> bin/mysqld_safe --user=mysql &
# adduser : : Username : mysql Password : ***** Full Name : mysql db Uid : 86 Class : Groups : mysql Home : /usr/local/mysql Home Model : Shell : /bin/sh Locked : no
となっていた。 $ ./configure \ --prefix=/usr/local/mysql \ --with-charset=utf8 \ --with-extra-charsets=all \ --enable-assembler \ --with-mysqld-ldflags=-all-static $ make $ su Password: # make install # cp support-files/my-medium.cnf /etc/my.cnf # cd /usr/local/mysql # bin/mysql_install_db --user=mysql # chown -R root . # chown -R mysql var # chgrp -R mysql . PHP †$ tar xvjf php5.2.9.tar.bz2 $ cd php-5.2.9 $ ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --enable-mbstring \ --enable-zend-multibyte \ --with-zlib \ --with-pdo-mysql=/usr/local/mysql $ make $ su # make install phpを使うためにapacheの設定を変更する。 †変更するファイルは、/usr/local/apache2/conf/httpd.conf LoadModule php5_module modules/libphp5.so ←はphpでインストールされるはず AddType application/x-httpd-php .php Postfix †FreeBSDには最初からSendmailが入っている。Linuxディストリビューションでは、デフォルトでPostfixだったりするらしいけど... インストール方法はまたあとで。 # postalias /PATH/TO/aliases が正解らしい。 参考サイト †MEMO †
|