|
InstallationUbuntu
v8cgi on Unbuntu (Januty)
Deprecated 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/ |
► Sign in to add a comment
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
Should you encounter any more issues, feel free to ask on the v8cgi mailing list :)
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.
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().
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...
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?
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.
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.
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.
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 ?
I had to do: sudo apt-get install libmysqlclient16-dev libgd2-xpm-dev apache2-threaded-dev for Ubuntu 10.04.