nginx+memcached+captcha_server實現驗證碼服務器

安裝相關開發類庫
yuminstallgccgcc-c++gd-devellibevent-devellibmemcached-develmemcachedgitphp

/usr/bin/memcached-d-uroot
serviceiptablesstophtml

配置java環境變量
tar-xvzfjdk-7u45-linux-x64.tar.gz
mvjdk1.7.0_45//usr/local/java

vi/etc/profile
exportJAVA_HOME=/usr/local/jdk1.7.0_45
exportCLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
exportPATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
source/etc/profilelinux

安裝ruby
yuminstalllibssl-devellibyaml-devel
yum-yinstallgccautomakeautoconflibtoolmake最小化系統安裝沒有安裝make、vim等經常使用命令
wgetftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz
tar-xvzfruby-1.9.2-p0.tar.gz
cdruby-1.9.2-p0
./configure;make;makeinstallnginx

安裝rubygem
wgethttp://rubyforge.org/frs/download.php/74953/rubygems-1.8.5.zip
cdrubygems-1.8.5
rubysetup.rb
安裝rubymemcached
yuminstallcyrus-sasl
yuminstallcyrus-sasl-devel
geminstallmemcachedc++

配置captcha_server
unzipcaptcha_server-master.zip
cdcaptcha_server-master
cdcaptcha
./makeimg.sh
rubyput_img.rbgit

安裝ngx_openresty-1.0.10.24
tarzxvfngx_openresty-1.0.10.24.tar.gz
cdngx_openresty-1.0.10.24
gitclonegit://github.com/yaoweibin/nginx_secure_cookie_module.git
./configure--with-debug--with-luajit--add-module=/root/ngx_openresty-1.0.10.24/nginx_secure_cookie_modulegithub

make
makeinstallvim

啓動nginx
cd/root/captcha_server-master
cpconf/nginx.conf/usr/local/openresty/nginx/conf/nginx.conf
cphtml/*/usr/local/openresty/nginx/html/
啓動nginx
/usr/local/openresty/nginx/sbin/nginx-c/usr/local/openresty/nginx/conf/nginx.confruby

若是驗證碼不能正常顯示緣由是memcache的重啓致使,
執行如下步驟:

cdcaptcharubyput_img.rb

相關文章
相關標籤/搜索