Dadamail com nginx

De MochilaWiki
Ir para navegaçãoIr para pesquisar

dependencias:

apt-get install build-essential libfcgi-dev autoconf psmisc
wget http://github.com/gnosek/fcgiwrap/tarball/master                                                                                                                     
tar zxvf gnosek-fcgiwrap-ba8c8d9.tar.gz                                                                                                                                   
cd gnosek-fcgiwrap-ba8c8d9/                                                                                                                                               
autoconf                                                                                                                                                                  
./configure --prefix=/usr
make                                                                                                                                                                      
make install                                                                                                                                                              
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.bz2                                                                                                            
tar jxvf spawn-fcgi-1.6.3.tar.bz2                                                                                                                                         
cd spawn-fcgi-1.6.3/                                                                                                                                                      
./configure --prefix=/usr                                                                                                                                                 
make                                                                                                                                                                      
make install 

/etc/init.d/c-fcgi:

#!/bin/bash
C_SCRIPT=/usr/bin/c-fcgi
RETVAL=0
case "$1" in
	start)
		echo "Starting fastcgi"
		$C_SCRIPT
		RETVAL=$?
  ;;
	stop)
		echo "Stopping fastcgi"
		killall -9 fcgiwrap
		RETVAL=$?
  ;;
	restart)
		echo "Restarting fastcgi"
		killall -9 fcgiwrap
		$C_SCRIPT
		RETVAL=$?
  ;;
	*)
		echo "Usage: c-fastcgi {start|stop|restart}"
		exit 1
  ;;
esac
exit $RETVAL

/usr/bin/c-fcgi:

#!/bin/sh
/usr/bin/spawn-fcgi -f /usr/bin/fcgiwrap -a 127.0.0.1 -p 49233 -P /var/run/fastcgi-c.pid -u www-data -g www-data
chmod +x /usr/bin/c-fcgi
chmod 755 /etc/init.d/c-fcgi
update-rc.d c-fcgi defaults
/etc/init.d/c-fcgi start


server {
        listen   80;
        server_name  boletim.quijaua.com.br;

  access_log   /var/log/nginx/boletim.quijaua.com.br-access.log;
  error_log  /var/log/nginx/boletim.quijaua.com.br-error.log info;

         location / {
                root   /var/www/quijaua.com.br-boletim;
                index  index.html;
        }

         location ~ ^/fckeditor/(.+) {
                root /usr/share/;
                index index.html index.htm;
        }

        location ~ \.cgi$ {

                root    /usr/lib/cgi-bin/dada;
                rewrite dada/(.*)\.cgi /$1.cgi break;

                include /etc/nginx/fastcgi_params;

                fastcgi_pass   127.0.0.1:49233;
                fastcgi_param  SCRIPT_FILENAME  /usr/lib/cgi-bin/dada/mail.cgi;  # same path as above

        }
}


referencias: