Fastcgi++
Jump to navigation
Jump to search
Nginx under Ubuntu 12.04
packages
- apt-get install g++
- apt-get install libboost-dev libboost-thread-dev libboost-date-time-dev
- apt-get install libboost-system-dev libboost-filesystem-dev libboost-iostreams-dev
- apt-get install spawn-fcgi
- visit http://www.nongnu.org/fastcgipp/ , download fastcgi++-2.1.tar.bz2
- untar on server, cd to dir, make, sudo make install
- cd /usr/lib; ln -s /usr/local/lib/libfastcgipp.so; ln -s libfastcgipp.so libfastcgipp.so.2
- recompile the source and make sure
ldd
looks good
spawn-fcgi
- this runs as its own daemon; the init script is in the app directory
- cd /etc/init.d/; ln -s /home/deploy/shakes/app/shakes; update-rc.d shakes defaults
- for debugging, the spawn-fcgi command should look something like this:
spawn-fcgi -n -u deploy -d /home/deploy/shakes/app -s /home/deploy/shakes/tmp/shakes.sock -- /home/deploy/shakes/app/shakes.fcgi
The "-n" flag keeps the process in the foreground and sends all output to the terminal.
nginx
- add something like this to nginx.conf:
server { listen 80; server_name test.scottcamacmartin.org; root /home/deploy/shakes/public; index speak.html; location / { fastcgi_pass unix:/home/deploy/shakes/tmp/shakes.sock; fastcgi_index speak.html; include fastcgi_params; } }
Apache under Ubuntu 10.04
- install apache2, awstats
- apt-get install g++ libboost-dev libboost-thread-dev libboost-date-time-dev
- visit http://www.nongnu.org/fastcgipp/ , download fastcgi++-1.2.tar.bz2
- untar on server, cd to dir, make, sudo make install
- cd /usr/lib; ln -s /usr/local/lib/libfastcgipp.so
- restore /etc/apache2/mods-available/fastcgi.{load,conf} from backup
- restore /usr/lib/apache2/modules/mod_fastcgi.so from backup
- mkdir -p /var/lib/apache2/fastcgi; chown www-data.www-data /var/lib/apache2/fastcgi
- a2dissite default; a2ensite mysite1 mysite2; a2enmod alias rewrite fastcgi
- run /var/www/myapp/app/make to rebuild myapp.fcgi, check with ldd myapp.fcgi
- restore /etc/awstats/awstats.{conf.local,myapp.conf}, /etc/apache2/stats.passwd
- restore /var/lib/awstats/*, /var/log/apache2/myapp-access.log, /etc/cron.daily/awstats
- restart apache