一、安裝包nginx
二、安裝openssl-devel服務器
[root@iZuf6b5mgd99paw7t3hgeiZ]# yum -y install openssl openssl-devel測試
執行成功以後再執行3d
./configureblog
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
+ jemalloc library is disabled
nginx path prefix: 「/usr/local/nginx」
nginx binary file: 「/usr/local/nginx/sbin/nginx」
nginx configuration prefix: 「/usr/local/nginx/conf」
nginx configuration file: 「/usr/local/nginx/conf/nginx.conf」
nginx pid file: 「/usr/local/nginx/logs/nginx.pid」
nginx error log file: 「/usr/local/nginx/logs/error.log」
nginx http access log file: 「/usr/local/nginx/logs/access.log」
nginx http client request body temporary files: 「client_body_temp」
nginx dso module path: 「/usr/local/nginx/modules/」
nginx http proxy temporary files: 「proxy_temp」
nginx http fastcgi temporary files: 「fastcgi_temp」
nginx http uwsgi temporary files: 「uwsgi_temp」
nginx http scgi temporary files: 「scgi_temp」進程
看到最後這樣的輸出,就是配置成功了。 ip
三、安裝pcre-develmd5
[root@iZuf6b5mgd99paw7t3hgeiZ]# yum install pcre-develssl
四、創建nginx用戶
[root@iZuf6b5mgd99paw7t3hgeiZ]# groupadd -r nginx
[root@iZuf6b5mgd99paw7t3hgeiZ]# useradd -r -g nginx -M nginx
五、解壓縮nginx的源碼並安裝
[root@iZuf6b5mgd99paw7t3hgeiZ]# tar -zxvf nginx-1.3.16.tar.gz -C /usr/local/src/
[root@iZuf6b5mgd99paw7t3hgeiZ]# cd /usr/local/src/nginx-1.3.16/
[root@iZuf6b5mgd99paw7t3hgeiZ]# make && make install
[root@iZuf6b5mgd99paw7t3hgeiZ]# mkdir -p /var/tmp/nginx/client
六、啓動nginx服務並在客戶端作測試
# /usr/local/nginx/sbin/nginx
七、瀏覽器輸入http://IP地址 試試
八、nginx經常使用命令
-- 查看nginx進程
ps -ef|grep nginx
-- 殺死nginx進程
pkill nginx
九、最後雲服務器別忘記開放端口號(默認80)
參考:
# ./configure \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--with-pcre