My favorites | Sign in
Project Hosting will be READ-ONLY Thursday at 3:00pm UTC for up to 3 hours for network maintenance.
Project Home Downloads Wiki Issues Source
Search
for
ApacheConfiguration  
Apache configuration for v8cgi
Updated Dec 28, 2011 by ondrej.zara

Apache configuration

There are three main ways of using v8cgi with Apache. After you manage to prepare the configuration, go on by trying serving some sample html.

On windows, all necessary dlls must be available in system path!

1. Apache module

This is the preferred way.

If you installed the libapache2-mod-v8cgi from v8cgi's PPA, just do

sudo a2enmod v8cgi
sudo /etc/init.d/apache2 restart

and you are all set. Otherwise:

  1. compile or download mod_v8cgi (.dll on Windows, .so on Linux)
  2. load the resulting module into Apache:
  3. LoadModule v8cgi_module /path/to/the/v8cgi_module.so
  4. assign a v8cgi-script handler as necessary
  5. AddHandler v8cgi-script .ssjs .sjs
  6. optionally, you can specify a different config file for v8cgi in Apache's configuration file:
  7. v8cgi_Config /path/to/v8cgi.conf

2. CGI binary - traditional approach

This variant is not specific to v8cgi. Apache configured in this way will just execute all assigned files (.ssjs in the example below) and return output.

AddHandler cgi-script .ssjs

Note that .ssjs files have to be executable (chown +r) and they must contain a valid shebang line (#!/path/to/v8cgi).

Windows users will find this approach problematic, as there is no way to execute arbitrary files with shebang on Windows.

3. CGI binary - centralized approach

This is the least preferred way.

ScriptAlias /v8cgi/ /YOUR_PATH/
AddHandler v8cgi-handler .ssjs
Action v8cgi-handler /v8cgi/BINARY_NAME

while substituting:

  • YOUR_PATH with path to your v8cgi directory,
  • BINARY_NAME with name of your v8cgi binary.

Comment by andrea.g...@gmail.com, Nov 10, 2009

Ondrej can I ask you where is the other page with comments and my window installation comment? I spent some time to write it and I did not expect an erased post, thanks.

Comment by project member ondrej.zara, Nov 10, 2009

Hi Andrea,

it is true that I recently removed several wikipages and merged them into other. Namely, "Running" and "Installation" pages are now gone. In fact, it never came to my mind that this process is irreversible, because wikipages are stored in SVN repository as well.

However, based on your email, I tried to undelete the Installation page and I was unpleasantly surprised by the fact that user comments were not part of that page. As a result, I am unfortunately unable to retrieve any user comments attached to deleted wiki pages.

I am very sorry about this, as I understand that some amount of your work is unrecoverable now. If you manage to write that stuff again, I would like to directly include it in the relevant wikipage (as opposed to simple comment): this way, it won't be lost if we decide to remove/merge the page.

Sorry again, Ondrej

Comment by slugbugb...@gmail.com, Apr 17, 2010

Regarding Windows users finding the CGI Binary approach problematic: if they create a file association between .ssjs files and v8cgi in Windows Explorer, then the system will launch v8cgi and pass it the .ssjs file whenever Apache attempts to launch a .ssjs file.

Comment by pageno...@gmail.com, Jan 15, 2011

The above conversations bring to mind that it's been a dozen years since anyone wrote a book on server-side JavaScript? (on Netscape servers). I would be delighted to proof-read drafts of a book on V8 JavaScript? servers. The likely target audience could be people like myself who wish to port their client-side skills to a web server.

-- jgwilliams@mindspring.com, http://pagenotes.com/

Sign in to add a comment
Powered by Google Project Hosting