{"id":115210,"date":"2018-08-17T08:11:38","date_gmt":"2018-08-17T00:11:38","guid":{"rendered":"https:\/\/gulass.cn\/?p=115210"},"modified":"2018-08-13T09:23:11","modified_gmt":"2018-08-13T01:23:11","slug":"ubuntu-nginx-anquangou","status":"publish","type":"post","link":"https:\/\/gulass.cn\/ubuntu-nginx-anquangou.html","title":{"rendered":"Ubuntu nginx\u548c\u5b89\u5168\u72d7\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e"},"content":{"rendered":"
Ubuntu16.04 apt-get \u5b89\u88c5\u7684nginx \u7248\u672c1.10.0 <\/p>\n
\u7531\u4e8esbin\u548cconf\u6587\u4ef6\u4e0d\u5728\u540c\u4e00\u76ee\u5f55\uff0c\u6240\u4ee5\u5b89\u88c5\u8fc7\u7a0b\u4f1a\u62a5\u9519\uff0c\u5b89\u88c5\u5931\u8d25\u3002<\/p>\n
\r\nroot@server:~# apt-get install nginx \/\/\u5b89\u88c5nginx \r\n \r\n\r\nroot@server:~# nginx -v \/\/\u67e5\u770bnginx\u7248\u672c\r\n\r\nnginx version: nginx\/1.10.0 (Ubuntu) \r\n \r\n\r\nroot@server:~# wget http:\/\/down.safedog.cn\/safedog_linux64.tar.gz \/\/\u4e0b\u8f7d\u5b89\u5168\u72d7\u5b89\u88c5\u5305\r\n\r\nroot@server:~# ls \/\/\u5217\u76ee\u5f55\r\n\r\nsafedog_linux64.tar.gz \u516c\u5171\u7684 \u6a21\u677f \u89c6\u9891 \u56fe\u7247 \u6587\u6863 \u4e0b\u8f7d \u97f3\u4e50 \u684c\u9762\r\n\r\nroot@server:~# tar xzvf safedog_linux64.tar.gz \/\/\u89e3\u5b89\u5168\u72d7\u538b\u7f29\u5305\r\n \r\n\r\nroot@server:~# ls \/\/\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u6587\u4ef6\r\n\r\nsafedog_an_linux64_2.8.16709 \u516c\u5171\u7684 \u89c6\u9891 \u6587\u6863 \u97f3\u4e50\r\n\r\nsafedog_linux64.tar.gz \u6a21\u677f \u56fe\u7247 \u4e0b\u8f7d \u684c\u9762\r\n\r\nroot@server:~# cd safedog_an_linux64_2.8.16709 \/\/\u8fdb\u5165\u89e3\u538b\u597d\u7684\u5b89\u5168\u72d7\u76ee\u5f55\r\n \r\n\r\nroot@server:~\/safedog_an_linux64_2.8.16709# ls \/\/\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u6587\u4ef6\r\n\r\ninstall_files install.py uninstall.py\r\n \r\n\r\nroot@server:~\/safedog_an_linux64_2.8.16709# .\/install.py \/\/\u8fd0\u884c\u5b89\u88c5\u811a\u672c\r\n\r\n1. Select Install Apache. 2. Nginx defense module(enter Ctrl-C to exit). input 1 or 2: 2 \/\/apache\u9009\u62e91\uff0cnginx\u9009\u62e92\r\n\r\nstep 1\/3, start install common lib [ok] \r\n\r\nstep 2\/3, start Install Server Defense Module \r\n\r\n step 2.1, checking os release version... [ok] \r\n\r\n step 2.2, check app needed... [ok] \r\n\r\n step 2.3, installing file... [ok] \r\n\r\n step 2.4, start service... [ok] \r\n\r\n step 2.5, save safedog install info...\r\n\r\n Tips: \r\n\r\n (1)safedog install directory: \/etc\/safedog \r\n\r\n (2)install safedog version: 2.8.16709 \r\n\r\n install safedog completely\r\n\r\nstep 3\/3, start install Nginx Defense Module..\r\n\r\n step 3.1, input Nginx install path: [enter \"CTRL+c\" to exit]\r\n\r\n For example:\/usr\/local\/nginx\r\n\r\n Please input the absolute path:\/usr\/local\/nginx \/\/\u8f93\u5165nginx\u7684\u5b89\u88c5\u76ee\u5f55\r\n\r\n Warn: the path you inputted is not exist!\r\n\r\n Please input the absolute path:\/usr\/sbin\/ \/\/\u8f93\u5165nginx\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u7b2c\u4e00\u6b21\u5b89\u88c5\u914d\u7f6e\u4e0d\u6b63\u786e\uff0c\u6240\u4ee5\u4f1a\u5728\u8fd9\u91cc\u62a5\u9519\r\n\r\n Error: cann't not find sbin or conf directory!\r\n\r\nInstall Completely!\r\n\r\n<\/pre>\n\u5728step 3.1 \u5904\uff0c\u7531\u4e8esbin\u548cconf\u6587\u4ef6\u4e0d\u5728\u540c\u4e00\u76ee\u5f55\uff0c\u6240\u4ee5\u4e0d\u7ba1\u4f60\u600e\u4e48\u8f93\u5165\uff0c\u90fd\u4f1a\u62a5\u9519\uff0c\u6240\u4ee5\u5728\u6b64\u4e4b\u524d\uff0c\u9700\u8981\u628asbin\u548cconf\u6587\u4ef6\u653e\u5728\u4e00\u8d77<\/p>\n
\r\nroot@server:~\/safedog_an_linux64_2.8.16709# whereis nginx \/\/\u641c\u7d22nginx\u7684\u76f8\u5173\u76ee\u5f55 \r\n\r\nnginx: \/usr\/sbin\/nginx \/etc\/nginx \/usr\/share\/nginx\r\n\r\nroot@server:~\/safedog_an_linux64_2.8.16709# mkdir \/usr\/local\/nginx\/ \/\/\u5728\/usr\/local\/\u4e0b\u521b\u5efanginx\u76ee\u5f55\uff0cubuntu16.04\u6ca1\u6709\u8fd9\u4e2a\u76ee\u5f55\r\n \r\n\r\nroot@server:~\/safedog_an_linux64_2.8.16709# cd \/usr\/local\/nginx\/ \/\/\u6253\u5f00\/usr\/local\/nginx\/\u76ee\u5f55\r\n \r\n\r\nroot@server:\/usr\/local\/nginx# ln -s \/usr\/sbin\/ .\/sbin \/\/\u521b\u5efa\/usr\/sbin\/\u7684\u8f6f\u8fde\u63a5\u5230\u5f53\u524d\u76ee\u5f55\uff0c\u5e76\u547d\u540d\u4e3asbin\r\n \r\n\r\nroot@server:\/usr\/local\/nginx# ln -s \/etc\/nginx .\/conf \/\/\u521b\u5efa\/etc\/nginx\u7684\u8f6f\u8fde\u63a5\u5230\u5f53\u524d\u76ee\u5f55\uff0c\u5e76\u547d\u540d\u4e3aconf\r\n\r\nroot@server:\/usr\/local\/nginx# ls \/\/\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u7684\u6587\u4ef6\r\n\r\nconf sbin\r\n\r\n\r\nroot@server:\/usr\/local\/nginx# cd ~\/safedog_an_linux64_2.8.16709 \/\/\u6253\u5f00safedog_an_linux64_2.8.16709\u76ee\u5f55\r\n\r\nroot@server:~\/safedog_an_linux64_2.8.16709# .\/install.py \/\/\u91cd\u65b0\u5b89\u88c5\u5b89\u5168\u72d7\u7a0b\u5e8f\r\n\r\nstop safedog server ....\r\n\r\n1. Select Install Apache. 2. Nginx defense module(enter Ctrl-C to exit). input 1 or 2: 2\r\n\r\nstep 1\/3, start install common lib [ok] \r\n\r\nstep 2\/3, start Install Server Defense Module \r\n\r\n step 2.1, checking os release version... [ok] \r\n\r\n step 2.2, check app needed... [ok] \r\n\r\n step 2.3, installing file... [ok] \r\n\r\n step 2.4, start service... [ok] \r\n\r\n step 2.5, save safedog install info...\r\n\r\n Tips: \r\n\r\n (1)safedog install directory: \/etc\/safedog \r\n\r\n (2)install safedog version: 2.8.16709 \r\n\r\n install safedog completely\r\n\r\nstep 3\/3, start install Nginx Defense Module..\r\n\r\n step 3.1, input Nginx install path: [enter \"CTRL+c\" to exit]\r\n\r\n For example:\/usr\/local\/nginx\r\n\r\n Please input the absolute path:\/usr\/local\/nginx \/\/\u8f93\u5165\u521a\u624d\u914d\u7f6e\u597d\u7684\u76ee\u5f55\r\n\r\n step 3.2, copy libraries [ok]\r\n\r\n step 3.3, copy bin and set boot [ok]\r\n\r\n step 3.4, download nginx.. [ok]\r\n\r\n step 3.5, start the nginx server.. [ok]\r\n\r\n Tips:\r\n\r\n (1)If you want to change the configuration of nginx defense module, please modify the files in \/etc\/safedog\/nginx\/conf;\r\n\r\n (2)If you want to check nginx defense module log, please use command: sdalog -n;\r\n\r\n (3)If nginx defense module is failed to use, you can try to restart Nginx.\r\n\r\nsend command to server ok.\r\n\r\nInstall Completely! \r\n\r\n<\/pre>\n\u5230\u6b64\uff0c\u5b89\u88c5\u5b8c\u6210\uff01\u547d\u4ee4\u90e8\u5206\u5df2\u7ecf\u52a0\u7c97\u663e\u793a\uff0c\u61d2\u4eba\u8bf7\u770b\u4e0b\u9762\uff0c\u4ec5\u9700\u56db\u6b65\u5373\u53ef\u89e3\u51b3\u73af\u5883\u95ee\u9898<\/p>\n
\r\nmkdir \/usr\/local\/nginx\/\r\ncd \/usr\/local\/nginx\/\r\nln -s \/usr\/sbin\/ .\/sbin\r\nln -s \/etc\/nginx .\/conf\r\n<\/pre>\n\u5b89\u5168\u72d7\u5b98\u7f51http:\/\/www.safedog.cn <\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/wuxiaobai.win\/archives\/92<\/a><\/p>\n