! Mac OS X で Apache 2.x !! インストール 何も考えずにデフォルト。 rin@kahori[/usr/pkgsrc/www/apache2]% sudo bmake install sudo bmake install Password: Sorry, try again. Password: ===> Checking for vulnerabilities in apache-2.0.54nb1 => httpd-2.0.54.tar.bz2 doesn't seem to exist on this system. => Attempting to fetch httpd-2.0.54.tar.bz2 from http://www.apache.org/dist/httpd/. => [5566979 bytes] Requesting http://www.apache.org/dist/httpd/httpd-2.0.54.tar.bz2 5566979 bytes retrieved in 01:17 (69.88 KB/s) => Checksum SHA1 OK for httpd-2.0.54.tar.bz2. => Checksum RMD160 OK for httpd-2.0.54.tar.bz2. ===> Extracting for apache-2.0.54nb1 ========================================================================== The supported build options for this package are: suexec You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.apache (not defined) ========================================================================== ========================================================================== The following variables will affect the build process of this package, apache-2.0.54nb1. Their current value is shown below: * APACHE_MODULES = all proxy proxy_connect proxy_ftp proxy_http ssl deflate * APACHE_MPM = prefork * SSLBASE (defined) * USE_INET6 = YES You may want to abort the process now with CTRL-C and change their value before continuing. Be sure to run `/usr/pkg/bin/bmake clean' after the changes. ========================================================================== ===> Required installed package user>=20040801: user-20040801 found ===> Required package apr>=0.9.5.2.0.52nb1: NOT found ===> Verifying reinstall for ../../devel/apr ===> Checking for vulnerabilities in apr-0.9.6.2.0.54nb1 => Checksum SHA1 OK for httpd-2.0.54.tar.bz2. => Checksum RMD160 OK for httpd-2.0.54.tar.bz2. ===> Extracting for apr-0.9.6.2.0.54nb1 ========================================================================== The supported build options for this package are: db4 ldap You can select which build options to use by setting PKG_DEFAULT_OPTIONS or the following variable. Its current value is shown: PKG_OPTIONS.apr (not defined) Deprecated variable USE_OPENLDAP used, use PKG_DEFAULT_OPTIONS+=ldap instead. ========================================================================== ===> Required installed package expat>=1.95.8nb2: expat-1.95.8nb2 found ===> Required installed package libtool-base>=1.5.18nb1: libtool-base-1.5.18nb2 found ===> Patching for apr-0.9.6.2.0.54nb1 ===> Applying pkgsrc patches for apr-0.9.6.2.0.54nb1 ===> Overriding tools for apr-0.9.6.2.0.54nb1 ===> Creating toolchain wrappers for apr-0.9.6.2.0.54nb1 ===> Configuring for apr-0.9.6.2.0.54nb1 => Fixing hardcoded paths. : ===> Installing for apache-2.0.54nb1 Installing configuration files mkdir /Volumes/NetBSD/pkg/share/examples/httpd Making install in srclib Making install in pcre Making install in os Making install in unix Making install in server Making install in mpm Making install in prefork Making install in modules Making install in aaa mkdir /Volumes/NetBSD/pkg/lib/httpd Making install in filters Making install in loggers Making install in metadata Making install in proxy Making install in ssl Making install in http Making install in dav/main Making install in generators Making install in dav/fs Making install in mappers Making install in support Installing HTML documents Installing error documents mkdir /Volumes/NetBSD/pkg/share/httpd/error Installing icons mkdir /Volumes/NetBSD/pkg/share/httpd/icons Installing CGIs Installing header files mkdir /Volumes/NetBSD/pkg/include/httpd Installing man pages and online manual mkdir /Volumes/NetBSD/pkg/share/httpd/manual Installing build system files mkdir /Volumes/NetBSD/pkg/share/httpd/build for file in apachectl apxs dbmmanage envvars-std mkcert; do /usr/sbin/chown root:wheel /Volumes/NetBSD/pkg/sbin/$file && /bin/chmod 555 /Volumes/NetBSD/pkg/sbin/$file; done =========================================================================== Installing files needed by apache-2.0.54nb1: /Volumes/NetBSD/pkg/etc/httpd/httpd.conf [/Volumes/NetBSD/pkg/share/examples/httpd/httpd-std.conf] /Volumes/NetBSD/pkg/etc/httpd/magic [/Volumes/NetBSD/pkg/share/examples/httpd/magic] /Volumes/NetBSD/pkg/etc/httpd/mime.types [/Volumes/NetBSD/pkg/share/examples/httpd/mime.types] /Volumes/NetBSD/pkg/etc/httpd/ssl.conf [/Volumes/NetBSD/pkg/share/examples/httpd/ssl-std.conf] /Volumes/NetBSD/pkg/sbin/envvars [/Volumes/NetBSD/pkg/sbin/envvars-std] =========================================================================== =========================================================================== The following files should be created for apache-2.0.54nb1: /etc/rc.d/apache (m=0755) [/Volumes/NetBSD/pkg/share/examples/rc.d/apache] =========================================================================== ===> Registering installation for apache-2.0.54nb1 Full pathname symlink `/Volumes/NetBSD/pkg/libexec/apr/libtool' is target of `/Volumes/NetBSD/pkg/share/httpd/build/libtool' - adjusting to `../../../libexec/apr/libtool' apache-2.0.54nb1 requires installed package apr-0.9.6.2.0.54nb1 apache-2.0.54nb1 requires installed package expat-1.95.8nb2 apache-2.0.54nb1 requires installed package perl-5.8.6nb4 apache-2.0.54nb1 requires installed package user-20040801 apache-2.0.54nb1 requires installed package zlib-1.2.2 rin@kahori[/usr/pkgsrc/www/apache2]% !! 設定 !!! 起動項目 起動項目を修正。 rin@kahori[/System/Library/StartupItems/Apache]% diff -u Apache.20040528 Apache --- Apache.20040528 Tue Jul 12 20:37:42 2005 +++ Apache Wed Jul 13 22:57:41 2005 @@ -10,10 +10,7 @@ { if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then ConsoleMessage "Starting Apache web server" - if [ ! -e /etc/httpd/httpd.conf ] ; then - cp -p /etc/httpd/httpd.conf.default /etc/httpd/httpd.conf - fi - apachectl start + /usr/pkg/sbin/apachectl start if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then if [ -x /usr/sbin/webperfcachectl ]; then ConsoleMessage "Starting web performance cache server" @@ -30,14 +27,14 @@ /usr/sbin/webperfcachectl stop fi ConsoleMessage "Stopping Apache web server" - apachectl stop + /usr/pkg/sbin/apachectl stop } RestartService () { if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then ConsoleMessage "Restarting Apache web server" - apachectl restart + /usr/pkg/sbin/apachectl restart if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then if [ -x /usr/sbin/webperfcachectl ]; then ConsoleMessage "Restarting web performance cache server" !!! httpd.conf rin@kahori[~]% diff -u /usr/pkg/share/examples/httpd/httpd-std.conf /usr/pkg/etc/httpd/httpd.conf --- /usr/pkg/share/examples/httpd/httpd-std.conf Tue Jul 12 00:54:50 2005 +++ /usr/pkg/etc/httpd/httpd.conf Fri Jul 15 21:33:31 2005 @@ -72,6 +72,11 @@ + + ProxyPass /irc/ http://sakura.area51.gr.jp:8805/ + ProxyPass /dav/rin/ http://sakura.area51.gr.jp:8000/rin/ + ProxyPass /gonzui/ http://sakura.area51.gr.jp:46984/ + # # PidFile: The file in which the server should record its process @@ -119,8 +124,8 @@ StartServers 5 MinSpareServers 5 MaxSpareServers 10 -MaxClients 150 -MaxRequestsPerChild 0 +MaxClients 10 +MaxRequestsPerChild 10 # worker MPM @@ -132,7 +137,7 @@ # MaxRequestsPerChild: maximum number of requests a server process serves StartServers 2 -MaxClients 150 +MaxClients 50 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 @@ -275,7 +280,7 @@ # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. admin@your-domain.com # -ServerAdmin you@example.com +ServerAdmin rin@maaya.jp # # ServerName gives the name and port that the server uses to identify itself. @@ -289,7 +294,7 @@ # You will have to access it by its address anyway, and this will make # redirections work in a sensible way. # -#ServerName www.example.com:80 +ServerName www.area51.gr.jp # # UseCanonicalName: Determines how Apache constructs self-referencing @@ -371,18 +376,20 @@ # Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. # -# -# AllowOverride FileInfo AuthConfig Limit Indexes -# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec -# -# Order allow,deny -# Allow from all -# -# -# Order deny,allow -# Deny from all -# -# + + ##AllowOverride FileInfo AuthConfig Limit Indexes + AllowOverride All + Options All + ##Options ExecCGI MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec + + Order allow,deny + Allow from all + + + Order deny,allow + Deny from all + + # # DirectoryIndex: sets the file that Apache will serve if a directory @@ -392,7 +399,7 @@ # negotiated documents. The MultiViews Option can be used for the # same purpose, but it is much slower. # -DirectoryIndex index.html index.html.var +DirectoryIndex index.html index.html.var index.cgi index.rb index.pl index.php # # AccessFileName: The name of the file to look for in each directory @@ -533,7 +540,7 @@ # Set to "EMail" to also include a mailto: link to the ServerAdmin. # Set to one of: On | Off | EMail # -ServerSignature On +ServerSignature Off # # Aliases: Add here as many aliases as you need (with no limit). The format is @@ -844,7 +851,7 @@ # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # -#AddHandler cgi-script .cgi +AddHandler cgi-script .cgi .rb .pl # # For files that include their own HTTP headers: rin@kahori[~]% !! 起動確認 すでに動いている apache を止める。 rin@kahori[/System/Library/StartupItems/Apache]% sudo /usr/sbin/apachectl stop /usr/sbin/apachectl stop: httpd stopped 開始。 rin@kahori[/System/Library/StartupItems/Apache]% sudo ./Apache start Starting Apache web server 停止。 rin@kahori[/System/Library/StartupItems/Apache]% sudo ./Apache stop Stopping Apache web server