Nginxjavascript
Nginx管理css
wget http://nginx.org/download/nginx-1.15.8.tar.gz -P /usr/src
tar zxvf nginx-1.15.8.tar.gz
查看幫助:./configure --help
html
配置:html5
編譯java
yum install gcc pcre-devel zlib-devel
./configure --prefix=/usr/local/nginx
make
make install
lsof -i :80
netstat -ntpl
啓動:先cd
到安裝目錄/usr/loacl/nginx/
,以後就可執行sbin/nginx
。能夠經過查看端口占用命令看看是否已經啓動node
驗證:能夠經過瀏覽器訪問:192.168.2.42
就能夠查看nginx啓動頁面python
注意:可能存在防火牆問題,簡單的就關閉防火牆,或者開放此80端口jquery
# /表示root根目錄 表明 /usr/local/nginx/html/ location / { root html; index index.html index.htm; } # 訪問控制 只容許本機訪問a 其餘機器拒絕訪問 location /a { allow 127.0.0.1; # 容許ip訪問 allow 192.168.2.42; deny all; # 拒絕全部 return 404; # 返回頁面 # return http://www.jd.com; } # 目錄用戶驗證 任何人均可以訪問 可是須要用戶密碼才能訪問 location /b { auth_basic "登陸驗證(子牙)" auth_basic_user_file /etc/nginx/htpasswd } # 記錄日誌 http { log_format alex '[$time_local] $remote_addr "$request" $status'; } server{ access_log logs/host.access.log alex; }
elinks 127.0.0.1 --dump
killall -s HUP nginx
yum search elinks
yum install httpd-tools
htpasswd -c /etc/nginx/htpasswd alex
tailf host.access.log
sed -i "/#/d" conf/nginx.conf
sed -i "/^$/d" conf/nginx.conf
scp -r /root/nginx_install/ root@192.168.0.106:/root
:移動一個目錄下的全部文件用-r