您好,登錄后才能下訂單哦!
檢查安裝
[root@kurolz ~]# rpm -qa pcre* pcre-devel-7.8-6.el6.x86_64 pcre-7.8-6.el6.x86_64 [root@kurolz ~]# rpm -qa openssl* openssl-1.0.0-27.el6.x86_64
安裝nginx
包下載地址:http://nginx.org/en/download.html
[root@kurolz ~]# tar -zxvf nginx-1.10.3.tar.gz [root@kurolz ~]# cd ngunx-1.10.3 [root@kurolz ~]# ./configure ./configure: error: the HTTP rewrite module requires the PCRE library.
報錯,原因:沒有安裝pcre-devel
解決,掛載系統盤,找到rpm包安裝:
[root@kurolz Packages]# ls pcre* pcre-7.8-6.el6.i686.rpm pcre-7.8-6.el6.x86_64.rpm pcre-devel-7.8-6.el6.i686.rpm pcre-devel-7.8-6.el6.x86_64.rpm [root@kurolz Packages]# rpm -ivh pcre-devel-7.8-6.el6.x86_64.rpm warning: pcre-devel-7.8-6.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Preparing... ########################################### [100%] 1:pcre-devel ########################################### [100%]
重新安裝成功:
[root@kurolz nginx-1.10.3]# ./configure checking for OS + Linux 2.6.32-358.el6.x86_64 x86_64 checking for C compiler ... found + using GNU C compiler + gcc version: 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) checking for gcc -pipe switch ... found ...... nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" [root@kurolz nginx-1.10.3]# make [root@kurolz nginx-1.10.3]# make install
主頁測試:
[root@kurolz ~]# cd /usr/local/nginx/html [root@kurolz html]# cat 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> <h2>Welcome to nginx!</h2> <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 >nginx.org</a>.<br/> Commercial support is available at <a >nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p> </body> </html>
出錯,沒有開啟服務:
[root@kurolz html]# curl http://localhost curl: (7) couldn't connect to host
開啟服務測試成功:
[root@kurolz ~]# cd /usr/local/nginx/sbin [root@kurolz sbin]# curl http://localhost <!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> <h2>Welcome to nginx!</h2> <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 >nginx.org</a>.<br/> Commercial support is available at <a >nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p> </body> </html>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。