标签:
参考:https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/helloworld.html
http://openresty.org/
wget https://openresty.org/download/ngx_openresty-1.9.7.1.tar.gz
tar xzvf ngx_openresty-1.9.7.1.tar.gz
cd ngx_openresty-1.9.7.1
./configure
make
make install
root@iZ944ahibxpZ:~/openresty/ngx_openresty-1.9.7.1# cd /usr/local/openresty/nginx/sbin/nginx
-bash: cd: /usr/local/openresty/nginx/sbin/nginx: Not a directory
root@iZ944ahibxpZ:~/openresty/ngx_openresty-1.9.7.1# cd /usr/local/openresty/
root@iZ944ahibxpZ:/usr/local/openresty# ls
bin luajit lualib nginx
root@iZ944ahibxpZ:/usr/local/openresty# cd nginx
root@iZ944ahibxpZ:/usr/local/openresty/nginx# ls
conf html logs sbin
root@iZ944ahibxpZ:/usr/local/openresty/nginx# cd sbin
root@iZ944ahibxpZ:/usr/local/openresty/nginx/sbin# ls
nginx
root@iZ944ahibxpZ:/usr/local/openresty/nginx/sbin# cd nginx
-bash: cd: nginx: Not a directory
root@iZ944ahibxpZ:/usr/local/openresty/nginx/sbin# nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
root@iZ944ahibxpZ:/usr/local/openresty/nginx/sbin# cd /home
root@iZ944ahibxpZ:/home# ls
py3env
root@iZ944ahibxpZ:/home# mkdir resty
root@iZ944ahibxpZ:/home# cd resty
root@iZ944ahibxpZ:/home/resty# ls
root@iZ944ahibxpZ:/home/resty# mkdir logs/ conf/
root@iZ944ahibxpZ:/home/resty# ls
conf logs
root@iZ944ahibxpZ:/home/resty# cd conf
root@iZ944ahibxpZ:/home/resty/conf# vim nginx.conf
root@iZ944ahibxpZ:/home/resty/conf# whereis nginx
nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx
root@iZ944ahibxpZ:/home/resty/conf# export PATH=$PATH:/usr/local/openresty/nginx/sbin
root@iZ944ahibxpZ:/home/resty/conf# whereis nginx
nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx
root@iZ944ahibxpZ:/home/resty/conf# nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
root@iZ944ahibxpZ:/home/resty/conf# PATH
PATH: command not found
root@iZ944ahibxpZ:/home/resty/conf# /usr/local/openresty/nginx/sbin/nginx -p /home/resty/ -c conf/nginx.conf
root@iZ944ahibxpZ:/home/resty/conf# curl http://localhost:6699/
HelloWorld
root@iZ944ahibxpZ:/home/resty/conf#
标签:
原文地址:http://www.cnblogs.com/xiangnan/p/5129579.html