Last active
August 29, 2015 14:07
-
-
Save jet10000/f91a6332c14d392a64b6 to your computer and use it in GitHub Desktop.
ubuntu14.04+dchest_captcha+supervisor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu@testserver:~$ sudo apt-get install supervisor | |
ubuntu@testserver:~$ sudo service supervisor restart | |
ubuntu@testserver:~$ cd /etc/supervisor/conf.d/ | |
ubuntu@testserver:/etc/supervisor/conf.d$ sudo nano -w captcha.conf | |
====================================================================== | |
[program:dchest_captcha] | |
command=/usr/local/bin/captcha | |
autostart=true | |
autorestart=true | |
====================================================================== | |
nginx for captcha | |
ngx.conf | |
================================================================== | |
location /captcha { | |
proxy_pass http://127.0.0.1:8666/captcha; | |
#proxy_set_header Host $host; | |
#proxy_set_header X-Real-IP $remote_addr; | |
} | |
=================================================================== | |
http://nginx.org/en/docs/http/ngx_http_proxy_module.html | |
ubuntu@testserver:~$ sudo apt-get install golang git | |
http://railskey.wordpress.com/2014/05/31/install-gogolang-on-ubuntu/ | |
export GOROOT=/usr/lib/go | |
export GOPATH=$HOME/gocode | |
export PATH=$PATH:$GOPATH/bin | |
ubuntu@testserver:~$ mkdir gocode | |
ubuntu@testserver:~$ go get github.com/dchest/captcha | |
ubuntu@testserver:~/gocode/src/github.com/dchest/captcha/capexample$ go build captcha.go | |
ubuntu@testserver:/usr/local/bin$ sudo cp ~/captcha . | |
ubuntu@testserver:/usr/local/bin$ sudo chmod +x captcha | |
ubuntu@testserver:/usr/local/bin$ ls -l | |
total 8596 | |
-rwxr-xr-x 1 root root 8801240 Oct 5 14:57 captcha | |
ubuntu@testserver:~$ pstree | |
init─┬─acpid | |
├─atd | |
├─cron | |
├─dbus-daemon | |
├─dhclient | |
├─epmd | |
├─6*[getty] | |
├─master─┬─pickup | |
│ └─qmgr | |
├─postgres───5*[postgres] | |
├─rabbitmq-server───beam.smp─┬─inet_gethost───inet_gethost | |
│ └─36*[{beam.smp}] | |
├─rsyslogd───3*[{rsyslogd}] | |
├─sshd───sshd───sshd───bash───pstree | |
├─supervisord───captcha───3*[{captcha}] | |
├─systemd-logind | |
├─systemd-udevd | |
├─upstart-file-br | |
├─upstart-socket- | |
└─upstart-udev-br | |
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts | |
link: | |
https://www.digitalocean.com/community/tutorials/how-to-install-and-manage-supervisor-on-ubuntu-and-debian-vps | |
http://supervisord.org/configuration.html?highlight=autostart | |
http://railskey.wordpress.com/2014/05/31/install-gogolang-on-ubuntu/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment