Friday, April 07, 2006

Ephesians 6:17 - sword of the Spirit


As I was finishing the book of Ephesians this morning, I came across a marginal note I made while learning Biblical Greek. The note clarifies a single relative pronoun in Ephesians 6:17. We read Paul's counsel to take ... the sword of the Spirit which is the word of God. The question: what is the sword? Or in other words, what is the referent of which. The traditional Protestant view is that The word of God is the sword of the Spirit (Matthew Henry). Namely, the referent for which is sword. However, in Greek, the grammatical gender of a relative pronoun agrees with its referent. In Ephesians 6:17, the relative pronoun is ὅς (singular neuter). The referent therefore must be neuter. sword is μάχαιρα (singular feminine) and Spirit is πνεύματος (singular neuter). So the referent of which is Spirit. The Spirit is the sword and the Spirit is the word of God. Translating Ephesians 6:17 by dereferencing the relative pronoun gives something like And take the helmet of salvation, and the sword of the Spirit, which Spirit is the word of God:




So what? The point is that the sword Paul counsels us to take is the Spirit not the written word of God. A solid knowledge of the scriptures is commendable, useful and wise, but it does not provide the active, dividing power which the Spirit of the Lord provides. For it is the Holy Ghost which will show unto you all things what ye should do.

Thursday, April 06, 2006

Migrating a Catalyst app from mod_perl to FastCGI


There's a web application that I developed at work which runs under the
Catalyst MVC framework for Perl.
Catalyst is fun to develop in, but this particular application has a lot of
code and made for very large Apache server processes. The result was a lot of
swapping on the server and really slow shutdown times for the Apache
process. I decided to migrate the application to FastCGI. Finding all the
configuration details was a bit of a pain, but the final steps are simple.
I've restated those steps here to save you (and me) some time.



Migrate to CGI




I found it easiest to make sure the Catalyst application was running under CGI
without trouble before beginning the FastCGI portion. It also helped me to
create an empty Catalyst application to make sure none of my code was
responsible for failure.




> catalyst TestApp



In your httpd.conf file, add directives like this
(assuming you have mod_cgi already installed and loaded).




Alias /testapp/ /absolute/path/to/TestApp/script/testapp_cgi.pl/
<Location /testapp/>
SetHandler cgi-script
Options +ExecCGI
</Location>



Now you can visit http://server/testapp/ to see the default Catalyst
screen.



Migrate to FastCGI




Once that's working, move the app over to FastCGI. You'll need to install
mod_fastcgi (available from
FastCGI's webpage) or install
mod_fcgid (a compatible
alternative). Now change your Apache directives to the following:




Alias /testapp/ /absolute/path/to/TestApp/script/testapp_fastcgi.pl/
<Location /testapp/>
SetHandler fastcgi-script
Options +ExecCGI
</Location>



The only changes in the above configuration are to add fast to
testapp_cgi.pl and cgi-script. Once
that works, you can replace the TestApp locations and names with the
ones for your real application.




Some documentation online mentioned using Apache's Action
directive. I wasn't able to make that work, but Alias
seems to do the trick.