Add non-root userUnder Root permision
AddUser wedatepasswd wedate-> Input The new passwordchmod u+w/etc/sudoersvim/etc/sudoers add Wedate all= (All) A LL after root (search to root first): Wqchmod u-w/etc/sudoers
Install the necessary package dependenciesUpdate the packages required by the system
Yum Update
Download Nginx (current stable version)
/* System contract software source code package storage Location:/USR/LOCAL/SRC Source Package Compilation installation location:/usr/local/software name */wget http://nginx.org/download/nginx-1.6.0.tar.gz
Download pcre (support nginx pseudo static)
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
Download OpenSSL (nginx extension)
wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz
Download zlib (nginx extension)
wget http://zlib.net/zlib-1.2.8.tar.gz
Download Nodejs
wget http://nodejs.org/dist/v0.9.0/node-v0.9.0.tar.gz
Download RABBITMQ
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.3.1/rabbitmq-server-3.3.1-1.noarch.rpm
Install the compilation tools and library files (install using the yum command)
Yum install-y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp Curl Curl-devel fontconfig Fontconfig-devel FreeType freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils ke Yutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++- Devel libtool* libgomp libxml2 libxml2-devel libxpm* libtiff libtiff* make MPFR ncurses* ntp OpenSSL openssl-devel patch p Cre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel
Installing NginxInstalling Pcre
Cd/usr/local/srcmkdir/usr/local/pcretar zxvf PCRE-8.35.TAR.GZCD pcre-8.35./configure--prefix=/usr/local/ Pcremakemake Install
Installing OpenSSL
Cd/usr/local/srcmkdir/usr/local/openssltar zxvf OPENSSL-1.0.1H.TAR.GZCD openssl-1.0.1h./config--prefix=/usr/local /opensslmakemake installvi/etc/profileexport path= $PATH:/usr/local/openssl/bin:wq!source/etc/profile
Installing zlib
Cd/usr/local/srcmkdir/usr/local/zlibtar zxvf ZLIB-1.2.8.TAR.GZCD zlib-1.2.8./configure--prefix=/usr/local/zlib Makemake Install
Installing Nginx
Groupadd www//useradd-g www www-s/bin/false//temporarily without Cd/usr/local/srctar zxvf nginx-1.6.0. TAR.GZCD nginx-1.6.0./configure--prefix=/usr/local/nginx--without-http_memcached_module--user=www--group=www-- With-http_stub_status_module--with-http_ssl_module--with-http_gzip_static_module--with-openssl=/usr/local/src/ openssl-1.0.1h--with-zlib=/usr/local/src/zlib-1.2.8--with-pcre=/usr/local/src/pcre-8.35 Note:--with-openssl=/usr/ local/src/openssl-1.0.1h--with-zlib=/usr/local/src/zlib-1.2.8--with-pcre=/usr/local/src/ pcre-8.35 points to the source package decompression path, not the path of installation, otherwise it will be an error
Installing Nodejs
Cd/usr/local/srcmkdir/usr/local/nodetar zxvf node-v0.9.0.tar.gz cd node-v0.9.0./configure--prefix=/usr/local/ Nodemakemake installvi/etc/profile in export PATH USER ... Add the following on the line and set the Node_home/bin to the system PATH #set for Nodejs export Node_home=/usr/local/node export path= $NODE _home/bin:$ path:wq! After you save the exit, execute the following command to make the configuration effective source/etc/profile
Installing RABBITMQ
Cd/usr/local/srcwget-o/etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/ Epel-erlang.repoyum Install erlangrpm--import Http://www.rabbitmq.com/rabbitmq-signing-key-public.ascyum Install rabbitmq-server-3.3.1-1.noarch.rpm
Installing MongoDB
Vi/etc/yum.repos.d/mongodb.repo Glue the following code into it [Mongodb]name=mongodb repositorybaseurl=http:// Downloads-distro.mongodb.org/repo/redhat/os/x86_64/gpgcheck=0enabled=1sudo yum install mongodb-org in '/' Add data/ db file sudo service Mongod start
Get all server-side code
Su wedatecd ~git clone https://github.com/mainliner/APNS-rabbitMQ-nodejsgit clone https://github.com/mainliner/ Emailqueue the file clone to the Wedate folder install the daemon npm installed Forever-g
Debug Nginx
Configure NGINXVI /USR/LOCAL/NGINX/CONF/NGINX.CONF to include the following code in HTTP proxy_cache_path /var/cache/ Nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; proxy_temp_path /var/tmp;include mime.types;default_type application /octet-stream;gzip on;gzip_comp_level 6;gzip_vary on;gzip_min_length 1000;gzip_ proxied any;gzip_types text/plain text/html text/css application/json Application/x-javascript text/xml application/xml application/xml+rss text/javascript;gzip _buffers 16 8k;server { listen 80; server_ name xxxxxx.com; location /wedate { proxy_redirect off; proxy_set_header x-real-ip $remote _addr; proxy_set_header X-Forwarded-For $proxy _add_x_forwarded_for; proxy_ set_header host $http _host; proxy_set_header x-nginx-proxy true; proxy_set_header Connection ""; proxy_http_version 1.1; proxy_cache one; proxy_cache_key sfs$request_uri$scheme; proxy_pass http://127.0.0.1:3000; }}
Start all services
Cd/home/wedate/apns-rabbitmq-nodejs/forever start Apns.jscd/home/wedate/emailqueue/forever start email.jscd/home/ Wedate/wedateserver/forever start Cluster.jsservice mongod startchkconfig rabbitmq-server on