OS X and Apache Web server
How to configure and run the Apache Web server included on OS X
How to configure and run the Apache Web server included on OS X
ApacheĀ Tomcat 6.0 logging
There are two easy places to find configuration information about Tomcat logging.
A summary for the faint of heart.
Apache Tomcat 6.0 changes the logging model from Apache Tomcat 5.5. All comments from here on that refer to Apache Tomcat are referring to Apache Tomcat 6.0.
Log4j can be used instead of the org.apache.juli package for Tomcat’s internal logging and/or individual webapp logging.
Some build things ….
Apache2 needs the following flags set on the build
[To be filled in]
So does FastCGI itself.
Some configuration things …
Script Directory
Start at the root of the directory tree (“/”) that contains any directory using an ALIAS or SCRIPTALIAS directive. Every directory in the tree must be readable to the Apache2 server, usually running as “www:www”. This means read and execute permissions ( ‘o+rx’) for the world for every directory in the tree.
ALIAS vs SCRIPTALIAS
Appears to matter for CGI, but oddly enough, not for FCGI. Go figure.
IPC Directory
The IPC directory set by the required directive:
FastCgiIpcDir /var/run/fcgi
must have read and write permission to the Apache2 user, “www:www”. The easiest thing is to make ‘www:www” the user, and specify “u+rwx”.
File extensions
You need to make sure that the extension specified for the FCGI handler – normally .fcgi – matches that used for the files themselves.
Example
# /var/run/fcgi needs to have write permission for user www:www (see main file)
FastCgiIpcDir /var/run/fcgi
LoadModule fastcgi_module modules/mod_fastcgi.so
#AddHandler fastcgi-script .fcgi
#ScriptAlias /test/ “/home/jay/test_apache2/”
Alias /test/ “/home/jay/test_apache2/”
<Directory “/home/jay/test_apache2/”>
Options All
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
</Directory>
Configuration options that seem to make Apache2 and Ruby on Rails happy
./configure \
–enable-rewrite=yes \
–enable-dav=yes \
–enable-suexec \
–with-suexec-docroot=/usr/local/apache2/htdocs \
$@
An Apache rewrite rule to force SSL on every request. Place in .htaccess in any directory where you want this to happen.
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}