Mudanças entre as edições de "Dadamail com nginx"
De MochilaWiki
Ir para navegaçãoIr para pesquisar (Nova página: apt-get install build-essential libfcgi-dev autoconf psmisc wget http://github.com/gnosek/fcgiwrap/tarball/master ...) |
|||
Linha 1: | Linha 1: | ||
− | apt-get install build-essential libfcgi-dev autoconf psmisc | + | dependencias: |
+ | apt-get install build-essential libfcgi-dev autoconf psmisc | ||
− | wget http://github.com/gnosek/fcgiwrap/tarball/master | + | wget http://github.com/gnosek/fcgiwrap/tarball/master |
− | tar zxvf gnosek-fcgiwrap-ba8c8d9.tar.gz | + | tar zxvf gnosek-fcgiwrap-ba8c8d9.tar.gz |
− | cd gnosek-fcgiwrap-ba8c8d9/ | + | cd gnosek-fcgiwrap-ba8c8d9/ |
− | autoconf | + | autoconf |
− | ./configure --prefix=/usr | + | ./configure --prefix=/usr |
− | make | + | make |
− | make install | + | make install |
− | wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.bz2 | + | wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.bz2 |
− | tar jxvf spawn-fcgi-1.6.3.tar.bz2 | + | tar jxvf spawn-fcgi-1.6.3.tar.bz2 |
− | cd spawn-fcgi-1.6.3/ | + | cd spawn-fcgi-1.6.3/ |
− | ./configure --prefix=/usr | + | ./configure --prefix=/usr |
− | make | + | make |
− | make install | + | make install |
/etc/init.d/c-fcgi: | /etc/init.d/c-fcgi: | ||
− | #!/bin/bash | + | #!/bin/bash |
− | C_SCRIPT=/usr/bin/c-fcgi | + | C_SCRIPT=/usr/bin/c-fcgi |
− | RETVAL=0 | + | RETVAL=0 |
− | case "$1" in | + | 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 | + | esac |
− | exit $RETVAL | + | exit $RETVAL |
/usr/bin/c-fcgi: | /usr/bin/c-fcgi: | ||
− | #!/bin/sh | + | #!/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 | + | /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 +x /usr/bin/c-fcgi |
− | chmod 755 /etc/init.d/c-fcgi | + | chmod 755 /etc/init.d/c-fcgi |
− | update-rc.d c-fcgi defaults | + | update-rc.d c-fcgi defaults |
− | /etc/init.d/c-fcgi start | + | /etc/init.d/c-fcgi start |
− | server { | + | 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 ~ \.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: | referencias: | ||
− | http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/ | + | * http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/ |
− | http://mochila.quijaua.com.br/DadaMail | + | * http://mochila.quijaua.com.br/DadaMail |
Edição das 14h00min de 23 de abril de 2010
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 ~ \.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: