Nginx —— 用HTTP核心模块配置一个静态的Web服务器
生活随笔
收集整理的這篇文章主要介紹了
Nginx —— 用HTTP核心模块配置一个静态的Web服务器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
靜態Web服務器的主要功能有NGX_HTTP_CORE_MODULE模塊(HTTP框架的主喲奧成員)實現,當然,一個完整的靜態Web服務器還有許多功能由其他的HTTP模塊實現。
1》Web服務器的地址: 192.168.1.210
2》Web服務器端設置nginx的conf文件內容:
3》啟動nginx服務器(找到nginx的二進制文件):
[root@localhost conf]# /usr/local/nginx/sbin/nginx查找方式:# whereis? nginx? (會顯示 nginx的安裝路徑)
4》查看是否啟動成功:
[root@localhost conf]# ps -aux | grep nginx root 34848 0.0 0.0 20748 1404 ? Ss 19:46 0:00 nginx: master process /usr/local/nginx/sbin/nginx nobody 35739 0.0 0.0 23284 1768 ? S 20:52 0:00 nginx: worker process root 35749 0.0 0.0 112720 984 pts/1 S+ 20:54 0:00 grep --color=auto nginx5》客戶端測試地址: 192.168.1.93
打瀏覽器地址欄輸入: http://192.168.1.210:8080/
注意: 這里一定要加conf文件中監聽的端口,否則http默認監聽80端口。
6》顯示的頁面內容:
[root@localhost sbin]# cat ../html/index.html <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style>body {width: 35em;margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;} </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p><p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p><p><em>Thank you for using nginx.</em></p> </body> </html>?
?
?
?
?注意:? Nginx —— nginx服務的基本配置(nginx.conf文件的詳解)
總結
以上是生活随笔為你收集整理的Nginx —— 用HTTP核心模块配置一个静态的Web服务器的全部內容,希望文章能夠幫你解決所遇到的問題。

- 上一篇: Linux命令 —— 输出一组系统信息
- 下一篇: Nginx —— 用HTTP proxy