神同樣的墮落了,之前搭建任何linux下的服務不費吹灰之力,如今搭建一個nginx竟然總是想着找運維的小夥伴了。
歲月催人老啊。。。看到小夥伴們如此的忙碌,我選擇本身動手豐衣足食吧,過程記錄下。python
wget http://nginx.org/download/nginx-1.7.3.tar.gz
我是在centOS 5.6下弄得,這個是64位。由於這邊須要測試一個本身用python寫的agent。
下載之後很簡單的解壓、編譯,這個過程遇到一些比較蛋疼的事情。具體以下:linux
./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
甚是蛋疼,看了下缺乏pcre-devel,直接安裝。
接着配置看看,而後又開始報了。nginx
./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option.
尼瑪。。還能不能消停。。。
接着安裝zlib-devel吧。。。運維
make -j 4 make install
老規矩安裝唄。。。測試
接着裝完之後,就是這樣得。。。ui
[root@localhost sbin]# ./nginx -h nginx version: nginx/1.7.3 Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives] Options: -?,-h : this help -v : show version and exit -V : show version and configure options then exit -t : test configuration and exit -q : suppress non-error messages during configuration testing -s signal : send signal to a master process: stop, quit, reopen, reload -p prefix : set prefix path (default: /usr/local/nginx//) -c filename : set configuration file (default: conf/nginx.conf) -g directives : set global directives out of configuration file
好吧,一切都狠順利,接着配置唄。。想讓人家啓動得配置好撒。。this