安装相关开发类库
yuminstallgccgcc-c++gd-devellibevent-devellibmemcached-develmemcachedgit

/usr/bin/memcached-d-uroot
serviceiptablesstop

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

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/profile

安装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;makeinstall

安装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
geminstallmemcached

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

安装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_module

make
makeinstall

启动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.conf

如果验证码不能正常显示原因是memcache的重启导致,
执行以下步骤:

cdcaptcha
rubyput_img.rb