今日は適当にメモっただけ。後日清書するかも。
/usr/ports/www/apache22
/usr/local/etc/pkgtools.conf
MAKE_ARGS = {
‘www/apache22′ => [
‘WITHOUT_DAV_MODULES=yes’,
‘WITHOUT_PROXY_MODULES=yes’,
‘WITHOUT_IPV6=yes’,
],
}
# portinstall www/apache22
# diff /usr/local/etc/apache22/httpd.conf httpd.conf.org
40c40
< Listen www.xxx.yyy.zzz:80
—
> Listen 80
132c132
< ServerAdmin www@ほげほげ
—
> ServerAdmin you@example.com
453,468d452
< < NameVirtualHost *:80
<
<
< ServerAdmin webmaster@ほげほげ
< DocumentRoot /usr/home/www/404
< ServerName 404.ほげほげ
<
< Options Indexes FollowSymLinks
< AllowOverride None
< Order allow,deny
< Allow from all
<
< ErrorLog /var/log/404.ほげほげ-error_log
< CustomLog /var/log/404.ほげほげ-access_log common
<
こうしておけば /usr/local/etc/apache22/Includesで設定していないホストへのアクセスを全部ここに集中できる。
# /usr/bin/openssl genrsa -out /usr/local/etc/apache22/server.key 1024
# /usr/bin/openssl req -new -days 365 -key /usr/local/etc/apache22/server.key -out /usr/local/etc/apache22/server.csr -out /usr/local/etc/apache22/server.csr
なんちゃって自己証明
# /usr/bin/openssl x509 -in /usr/local/etc/apache22/server.csr -out /usr/local/etc/apache22/server.crt -req -signkey /usr/local/etc/apache22/server.key -days 365
# chmod 600 server.*
を忘れずに。
/usr/local/etc/apache22/extra/httpd-ssl.confのDocumentRoot, ServerName, ServerAdminをを適当に書き換えて/usr/local/etc/apache22/Includes/httpd-ssl.confに置く。
あと、必要に応じて /usr/local/etc/apache22/IncludesにVirtual Hostのファイルを作って置けばOK。こんな感じ
# Virtual Hosts
#
ServerAdmin webmaster@へろへろ
DocumentRoot /usr/home/www/http
ServerName www.へろへろ
ServerAlias へろへろ
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
ErrorLog /var/log/www.へろへろ-error_log
CustomLog /var/log/www.へろへろ-access_log common
Apcheの再起動は /usr/local/etc/rc.d/apache22 restart
# /usr/local/etc/rc.d/apache22
Usage: /usr/local/etc/rc.d/apache22 [fast|force|one](start|stop|restart|rcvar|re
load|graceful|gracefulstop|configtest|status|poll)
/usr/local/etc/apache22/Includes/no-accf.confはそのままそっと置いておく。