標籤:linux
650) this.width=650;" width="700" height="427" title="33.jpg" style="width:700px;height:427px;" alt="wKiom1mYAHzSQ0ydAAD6mI0rsfU054.jpg" src="https://s5.51cto.com/wyfs02/M02/00/2C/wKiom1mYAHzSQ0ydAAD6mI0rsfU054.jpg" border="0" vspace="0" hspace="0" />
650) this.width=650;" width="700" height="363" title="34.jpg" style="width:700px;height:363px;" alt="wKiom1mYFZ_isbP-AAB0Qe3CuKc904.jpg" src="https://s2.51cto.com/wyfs02/M02/00/2D/wKiom1mYFZ_isbP-AAB0Qe3CuKc904.jpg" border="0" vspace="0" hspace="0" />
650) this.width=650;" width="700" height="511" title="35.jpg" style="width:700px;height:511px;" alt="wKioL1mYFZzwoChMAABvqahTmaA675.jpg" src="https://s1.51cto.com/wyfs02/M01/9E/DD/wKioL1mYFZzwoChMAABvqahTmaA675.jpg" border="0" vspace="0" hspace="0" />
650) this.width=650;" width="700" height="522" title="36.jpg" style="width:700px;height:522px;" alt="wKiom1mYFaOhJfnxAADMUQfrdqY273.jpg" src="https://s4.51cto.com/wyfs02/M00/00/2D/wKiom1mYFaOhJfnxAADMUQfrdqY273.jpg" border="0" vspace="0" hspace="0" />
[[email protected] conf]# egrep -v "^$|#" nginx.conf.default >nginx.conf
[[email protected] conf]# pwd
/application/nginx/conf
[[email protected] conf]# vim nginx.conf 1 worker_processes 1; 2 events { 3 worker_connections 1024; 4 } 5 http { 6 include mime.types; 7 default_type application/octet-stream; 8 sendfile on; 9 keepalive_timeout 65; 10 server { 11 listen 80; 12 server_name localhost; 13 location / { 14 root html; 15 index index.html index.htm; 16 } 17 error_page 500 502 503 504 /50x.html; 18 location = /50x.html { 19 root html; 20 } 21 } 22 }
把第12行修改為如下:
12 server_name www.etiantian.org;
優雅重啟/application/nginx/sbin/nginx -s reload
[[email protected] conf]# /application/nginx/sbin/nginx -tnginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is oknginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful[[email protected] conf]# /application/nginx/sbin/nginx -s reload
[[email protected] conf]# cd /application/nginx/html/[[email protected] html]# ls50x.html index.html[[email protected] html]# rm -f index.html
編輯index.html檔案,輸入如下內容:
[[email protected] html]# vim index.html
<html><head><title>老男孩教育營運28期</title></head><body>28期最牛<table border=1><tr><td>學號</td><td>姓名</td></tr><tr><td>01</td><td>力哥</td></tr><tr><td>02</td><td>亮哥</td></tr></table><a href="http://blog.oldboyedu.com"target=_balcnk><img src="gongli.jpg"冰冰美女</a></body></html>
然後再到目前的目錄上傳一張gongli.jpg的圖片(圖片在下面附件中)。rz -y斷行符號上傳
</html>[[email protected] html]# pwd/application/nginx/html[[email protected] html]# ls50x.html gongli.jpg index.html
最後開啟windows ie輸入地址http://10.0.0.8/ 即可開啟網址。首頁網站部署成功。
650) this.width=650;" width="700" height="391" title="39.jpg" style="width:700px;height:391px;" alt="wKioL1mYFQjwVjCKAAJsriUplNw576.jpg" src="https://s3.51cto.com/wyfs02/M02/9E/DD/wKioL1mYFQjwVjCKAAJsriUplNw576.jpg" border="0" vspace="0" hspace="0" />
開啟windows C:\Windows\System32\drivers\etc\hosts檔案添加本地DNS解析
10.0.0.8 www.etiantian.org
cmd 中ping www.etiantian.org查看解析是不是10.0.0.8ip地址,如果是直接在ie中開啟網址www.etiantian.org即可。
C:\Users\Administrator>ping www.etiantian.org正在 Ping www.etiantian.org [10.0.0.8] 具有 32 位元組的資料:來自 10.0.0.8 的回複: 位元組=32 時間<1ms TTL=64來自 10.0.0.8 的回複: 位元組=32 時間<1ms TTL=64來自 10.0.0.8 的回複: 位元組=32 時間<1ms TTL=64來自 10.0.0.8 的回複: 位元組=32 時間<1ms TTL=6410.0.0.8 的 Ping 統計資訊: 資料包: 已發送 = 4,已接收 = 4,丟失 = 0 (0% 丟失),往返行程的估計時間(以毫秒為單位): 最短 = 0ms,最長 = 0ms,平均 = 0ms
650) this.width=650;" width="700" height="500" title="40.jpg" style="width:700px;height:500px;" src="https://s4.51cto.com/wyfs02/M00/9E/DD/wKioL1mYGWnTM8laAAIobKCECLc592.jpg" border="0" vspace="0" hspace="0" alt="wKioL1mYGWnTM8laAAIobKCECLc592.jpg" />
本文出自 “sandshell” 部落格,請務必保留此出處http://sandshell.blog.51cto.com/9055959/1957666
nginx自訂網站目錄及簡單編寫開發網頁內容講解