一、安裝pcre-8.31
1、./configure --prefix=$HOME/libs/pcre-8.31
2、make
3、make install
二、安裝nginx-1.2.4
1、./configure --prefix=$HOME/apps/nginx-1.2.4/nginx --with-
pcre=/home/dmpush/libs/pcre-8.31 --with-http_stub_status_module --with-http_gzip_static_module
2、make
3、make install
啟動nginx
4、cd nginx/sbin
5、
nginx -s stop // 停止nginx
nginx -s reload // 重新加載配置文件
nginx -s quit // 退出nginx
查看是否啟動:netstat -ntlp
出現問題: nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
是因為端口號的問題,在Linux中1024以下的端口號都需要root用戶才能使用
所以普通用戶啟動程序綁定會報出權限問題,我這里是把Nginx綁定的端口號改為8888(大於1024)
6、打開IE:在地址欄輸入:http://192.168.21.23:8888/
就能看到結果,表示安裝成功:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further
configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
——————————————————————————————————————
三、安裝libevent(事件觸發)
nginx安裝的時候依賴於libevent 這是一個非常著名的API 這個編程庫用於提升網絡event事件(epoll)之類
的這樣一個庫.主要用於提升性能.
1、下載libevent:https://github.com/libevent/libevent/downloads
2、./configure
3、make
4、make install
四、安裝boost1_51
1、./bootstrap.sh
2、./b2 install --prefix=PREFIX
3、設置環境變量
例子程序在$HOME/libs/boost_1_51_0/tools/build/v2下面example