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
InstallationUbuntu  
v8cgi on Unbuntu (Januty)
Deprecated
Updated Dec 14, 2011 by ondrej.zara

Some of this might be obsolete

v8cgi on Ubuntu (Jaunty)

NOTE: replace ~/src with path to where you checkout and build v8 and v8cgi!

NOTE: If you don't like to use vi to edit files, use gedit instead.

prerequisites:

sudo apt-get install mysqlclient15-dev libgd2-xpm-dev apache-threaded-dev

build (replace ~/src with path to where you compile these):

mkdir ~/src
cd ~/src
svn checkout v8 (see actual command at google code)
svn checkout v8cgi (see actual command at google code)
chdir v8
scons arch=x64 library=shared

OR if not x64 OS:

scons library=shared
sudo libv8.so /usr/lib/libv8.so
cd ../v8cgi
scons module=1 gd=1 mysql=1
sudo cp v8cgi.config.posix /etc/v8cgi.config

configure /etc/v8cgi.config

sudo vi /etc/v8cgi.config
require.paths = ['~/src/v8cgi/lib'];

configure apache module:

sudo vi /etc/apache2/mods-available/v8cgi.load
* The only line in the file should be:
LoadModule v8cgi_module ~/src/v8cgi/mod_v8cgi.so
--
sudo vi /etc/apache2/mods-available/v8cgi.conf
* The only line in the file should be:
AddHandler v8cgi-script .sjs .jst

enable the mod:

sudo a2enmod v8cgi

create/edit virtual host file:

sudo vi /etc/apache2/sites-available/v8cgi

This configuration should work, remember to replace ~/src with where you built v8 and v8cgi

<VirtualHost *:80>
        ServerName v8cgi
        ServerAdmin webmaster@localhost
        DocumentRoot ~/src/v8cgi/htdocs

        <Directory ~src/v8cgi/htdocs>
                Options Indexes All Multiviews
                AllowOverride All
                Order allow,deny
                allow from all
                DirectoryIndex index.sjs
        </Directory>

        ErrorLog /var/log/apache2/v8cgi_error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/v8cgi_access.log combined
        ServerSignature On

</VirtualHost>

enable the site:

sudo a2ensite v8cgi

configure v8cgi hostname:

sudo vi /etc/hosts

the first line in mine looks like this:

127.0.0.1       localhost freewill v8cgi

restart apache:

sudo /etc/init.d/apache2 restart

Check it out: point browser at http://v8cgi/

Comment by project member brandonjwilhite@gmail.com, Nov 4, 2009

I am attempting these installation instructions on ubuntu 9.10 server. So far I've had to change the first line to: sudo apt-get install libmysqlclient15-dev libgd2-xpm-dev apache2-threaded-dev

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

Should you encounter any more issues, feel free to ask on the v8cgi mailing list :)

Comment by project member brandonjwilhite@gmail.com, Nov 5, 2009

Thanks. I'm working through some right now, but I think I'm on the right track. The idea is to build a vm and then if you all wish, I'll make it available so that people can quickly start playing it.

Comment by project member brandonjwilhite@gmail.com, Nov 5, 2009

Maybe it's because I ultimately didn't use the latest from repository (instead I got mine from download section)...but the example index.sjs I had kept throwing an error of printbr is not defined. So I changed them all to response.write().

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

Hmm, this wikipage is rather old and it assumes the existence of a global HTTP handler. This feature is now optional and turned off by default...

Comment by mzi...@gmail.com, Feb 2, 2010

Hmmm... I added include('requestHandler.js') and it worked. However, test.jst prints nothing, but test.jst:1: SyntaxError?: Unexpected token <

It just seems to treat the file like a regular javascript. How to change that behaviour?

Comment by project member ondrej.zara, Feb 2, 2010

The requestHandler is no longer supported and will be removed in future releases. In order to serve HTML pages with v8cgi, just use "response.write()" or the "template" module.

Comment by mzi...@gmail.com, Feb 3, 2010

Actually what I asked was how to make .jst files run. Maybe I misunderstood the whole idea of .jst files? What I expect is to type: http://myhost/myapp.jst in the browser and be served a preprocessed page.

Comment by project member ondrej.zara, Feb 4, 2010

Basically, yes. The question is, HOW do you want the preprocessing to take place. v8cgi is not PHP; source files must be valid javascript. We use response.write() commands to create (HTML) output.

Comment by svg...@gmail.com, Jun 29, 2010

Hi all, I am trying to install on ubuntu 9.10, installed sudo apt-get install libmysqlclient15-dev libgd2-xpm-dev apache2-threaded-dev

after this i have checked out v8cgi-0.8.2-src.tar.gz, then i tried scons library=shared inside v8. this gives following error.

c1plus: warnings being treated as errors src/handles-inl.h: In static member function 'static void v8::V8::RemoveMessageListeners?(void ()(v8::Handle<v8::Message>, v8::Handle<v8::Value>))':

anybody has idea ?

Comment by aaron.o...@gmail.com, Oct 1, 2010

I had to do: sudo apt-get install libmysqlclient16-dev libgd2-xpm-dev apache2-threaded-dev for Ubuntu 10.04.


Sign in to add a comment
Powered by Google Project Hosting