Fastcgi++: Difference between revisions
Jump to navigation
Jump to search
Created page with '{{lowercase title}} * install apache2, awstats * apt-get install g++ libboost-dev libboost-thread-dev libboost-date-time-dev * visit http://www.nongnu.org/fastcgipp/ , download …' |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{lowercase title}} | {{lowercase title}} | ||
== 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 <code>ldd</code> 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: | |||
<pre> | |||
spawn-fcgi -n -u deploy -d /home/deploy/shakes/app -s /home/deploy/shakes/tmp/shakes.sock -- /home/deploy/shakes/app/shakes.fcgi | |||
</pre> | |||
The "-n" flag keeps the process in the foreground and sends all output to the terminal. | |||
=== nginx === | |||
* add something like this to nginx.conf: | |||
<pre> | |||
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; | |||
} | |||
} | |||
</pre> | |||
== Apache under Ubuntu 10.04 == | |||
* install apache2, awstats | * install apache2, awstats | ||
* apt-get install g++ libboost-dev libboost-thread-dev libboost-date-time-dev | * apt-get install g++ libboost-dev libboost-thread-dev libboost-date-time-dev |
Latest revision as of 23:44, 3 March 2015
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