Fastcgi++: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{lowercase title}}
{{lowercase title}}
== 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




Line 27: Line 11:
* untar on server, cd to dir, make, sudo make install
* 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
* 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 ===
=== spawn-fcgi ===
* this runs as its own daemon; the init script is in the app directory
* this runs as its own daemon; the init script is in the app directory
* cd /etc/init.d/; ln -s <shakes-dir>/app/shakes; update-rc.d shakes defaults
* 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:
* for debugging, the spawn-fcgi command should look something like this:
<pre>
<pre>
Line 35: Line 21:
</pre>
</pre>
The "-n" flag keeps the process in the foreground and sends all output to the terminal.
The "-n" flag keeps the process in the foreground and sends all output to the terminal.
=== nginx ===
=== nginx ===
* add something like this to nginx.conf:
* add something like this to nginx.conf:
Line 50: Line 37:
}
}
</pre>
</pre>
== 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

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