{"id":156655,"date":"2019-09-14T11:33:10","date_gmt":"2019-09-14T03:33:10","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=156655"},"modified":"2019-08-27T14:32:44","modified_gmt":"2019-08-27T06:32:44","slug":"profile-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/profile-linux.html","title":{"rendered":"\u535a\u5ba2\u65b0\u7ad9\u89c4\u5212\uff08\u4e00\uff09\u2014\u2014\uff08\u6574\u4f53\u89c4\u5212\uff09"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u535a\u5ba2\u662f\u4ee5\u7f51\u7edc\u4f5c\u4e3a\u8f7d\u4f53\uff0c\u7b80\u6613\u8fc5\u901f\u4fbf\u6377\u5730\u53d1\u5e03\u81ea\u5df1\u7684\u5fc3\u5f97\uff0c\u53ca\u65f6\u6709\u6548\u8f7b\u677e\u5730\u4e0e\u4ed6\u4eba\u8fdb\u884c\u4ea4\u6d41\uff0c\u518d\u96c6\u4e30\u5bcc\u591a\u5f69\u7684\u4e2a\u6027\u5316\u5c55\u793a\u4e8e\u4e00\u4f53\u7684\u7efc\u5408\u6027\u5e73\u53f0\uff0c\u90a3\u4e48\u5982\u4f55\u5efa\u7acb\u4e00\u4e2a\u535a\u5ba2\u65b0\u7ad9\u5462\uff1f<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u7b2c\u4e00\u90e8\u5206\uff1a\u7cfb\u7edf\u4f18\u5316\u4e0e\u5b89\u5168\u90e8\u5206<\/strong><\/span><\/div>\n

1\uff1a\u5f00\u542fssh\u5bc6\u94a5\u767b\u5f55\uff0c\u5e76\u7981\u7528ssh\u5bc6\u7801\u8ba4\u8bc1\uff0c\u540c\u65f6\u4fee\u6539\u5176ssh\u7aef\u53e3\u4e3a \"13520\"<\/p>\n

2\uff1a\u4e3a\u7cfb\u7edf\u521b\u5efa\u666e\u901a\u8d26\u6237wsfnk\uff0c\u7981\u6b62root\u76f4\u63a5\u767b\u5f55\uff0c\u8fd0\u884c\u666e\u901a\u7528\u6237\u4f7f\u7528key\u767b\u5f55<\/p>\n

3\uff1a\u5bf9\u5386\u53f2\u547d\u4ee4\u6dfb\u52a0\u65f6\u95f4\u6233<\/p>\n

\r\n\tvi \/etc\/profile\t\t#\u5c06\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u8fdb\u53bb\r\n\r\nexport HISTTIMEFORMAT=\"%Y-%m-%d %H:%M:%S  \"\r\nHISTSIZE=1000<\/pre>\n

4\uff1a\u4fee\u6539\u7cfb\u7edf\u65f6\u533a\u4e3a\u4e0a\u6d77<\/p>\n

cp -f \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<\/pre>\n

5\uff1a\u9501\u5b9aapache\uff0cmysql\uff0cnginx\uff0cftp\uff0cgames\uff0cnobody\uff0cpostfix\uff0cntp\u7b49\u65e0\u9700\u767b\u5f55\u7684\u7528\u6237<\/p>\n

6\uff1a\u4fee\u6539linux\u7cfb\u7edf\u6253\u5f00\u6700\u5927\u6587\u4ef6\u6570\uff08\u4fee\u6539\u5982\u4e0b\u6587\u4ef6\uff0c\u6dfb\u52a0\u4e0b\u9762\u5185\u5bb9\uff1a\u8868\u793a\u4fee\u6539\u4e3a65536\uff0c\u91cd\u542f\u540e\u3000ulimit -n\u3000\u53ef\u4ee5\u9a8c\u8bc1\uff09<\/p>\n

\r\n\tvi \/etc\/security\/limits.conf\r\n\r\n*               soft   nofile       65536\r\n*               hard   nofile       65536<\/pre>\n
\u7b2c\u4e8c\u90e8\u5206\uff1a\u5e94\u7528\u7a0b\u5e8f\u90e8\u7f72\u4e0e\u5b89\u5168\u914d\u7f6e\u90e8\u5206<\/strong><\/span><\/div>\n

6\uff1a\u6307\u5b9aftp\u7528\u6e56fnkftp\u7684\u5bb6\u76ee\u5f55\u5728\/web-boke\/html\u76ee\u5f55\uff0c\u5e76\u5c06\u5176\u9650\u5b9a\u5728html\u76ee\u5f55\u91cc<\/p>\n

chroot_local_user=YES<\/pre>\n

7\uff1amysql5.7\u7684\u5b89\u88c5\uff0c\u53c2\u770bhttps:\/\/boke.wsfnk.com\/archives\/49.html<\/p>\n

8\uff1a\u5c06mysql\u7aef\u53e3\u6539\u621013522,\u5e76\u53ea\u76d1\u542c127.0.0.1\uff0c\u4e14root\u4e0d\u80fd\u8fdc\u7a0b\u7ba1\u7406\uff0c\u5e76\u521b\u5efa\u6570\u636e\u5e93sjk\u666e\u901a\u8d26\u6237\uff0c\u7ba1\u7406\u535a\u5ba2boke\u6570\u636e\u5e93<\/p>\n

cat \/etc\/my.cnf\r\n\r\n# http:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/server-configuration-defaults.html\r\n[mysqld]\r\nport=13522\r\nbind-address=127.0.0.1\r\ndatadir=\/web-boke\/mysql-data\r\nsocket=\/web-boke\/mysql-data\/mysql.sock\r\nlog-error=\/web-boke\/mysql-data\/mysqld.log\r\npid-file=\/web-boke\/mysql-data\/mysqld.pid\r\nsymbolic-links=0\r\ncharacter-set-server=utf8\r\n\r\n#log-error=\/var\/log\/mysqld.log\r\n#pid-file=\/var\/run\/mysqld\/mysqld.pid\r\n[mysql]\r\nsocket=\/web-boke\/mysql-data\/mysql.sock\r\ndefault-character-set=utf8\r\n#\r\n[client]\r\nsocket=\/web-boke\/mysql-data\/mysql.sock\r\ndefault-character-set=utf8<\/pre>\n

9\uff1a\u7f16\u8bd1\u5b89\u88c5nginx\uff0c\u5e76\u52a0\u8f7dlua + ngx_lua_waf\u6a21\u5757\u5b9e\u73b0waf\u529f\u80fd\uff0c\u53c2\u770bhttps:\/\/boke.wsfnk.com\/archives\/334.html<\/p>\n

10\uff1a\u5c06php.ini\u6700\u5927\u4e0a\u4f20\u9650\u5236\u6539\u62108M\uff0c\u65f6\u533a\u6539\u6210\u4e0a\u6d77<\/p>\n

\tvi \/etc\/php.ini\r\n\r\ndate.timezone = \"Asia\/Shanghai\"\r\nupload_max_filesize = 8m<\/pre>\n

11\uff1aphp-fpm\u4f18\u5316\uff0c\u5c06\u5176\u6539\u6210\u6267\u884c200\u6b21php\u8bf7\u6c42\u540e\uff0c\u5c06\u5185\u5b58\u91ca\u653e\u7ed9\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5e76\u5c06\u8fdb\u7a0b\u7aef\u53e3\u6539\u621013521<\/p>\n

\tvi \/etc\/php-fpm.d\/www.conf\r\n\r\nlisten = 127.0.0.1:13521\r\npm.max_requests = 200<\/pre>\n

12\uff1anginx\u4f18\u5316\u7684\u4f18\u5316\uff0c\u53c2\u770bhttps:\/\/boke.wsfnk.com\/archives\/47.html<\/p>\n

\u7b2c\u4e09\u90e8\u5206\uff1a\u76d1\u63a7\u4e0e\u5206\u6790\u90e8\u5206<\/strong><\/span><\/div>\n

13\uff1a\u6bcf\u5468\u6821\u9a8c\u7f51\u7ad9\/web-boke\/html\u4ee3\u7801\u7684md5\u503c<\/p>\n

cat \/home\/wsfnk\/md5_check.sh\r\n\r\n#!\/bin\/bash\r\nfind \/web-boke\/html -name \"*.*\" |while read line\r\ndo\r\nmd5sum $line >> boke-md5-check-`date \"+%Y-%m-%d\"`\r\ndone<\/pre>\n

14\uff1a\u914d\u7f6efilebeat\uff0c\u5c06nginx\u65e5\u5fd7\u53d1\u9001\u5230ELK\u5206\u6790\u5e73\u53f0\u4e0a<\/p>\n

#filebeat\u5b89\u88c5\r\n\t#\u914d\u7f6eyum\u6e90\uff08\u9009\u62e9\u7248\u672c\u53f7\u4e3a5\u7684\uff0c\u56e0\u4e3a\u7248\u672c6\u7684document_type\u5b57\u6bb5\u597d\u50cf\u4e0d\u80fd\u4f7f\u7528\u4e86\uff09\r\n\tvi \/etc\/yum.repos.d\/filebeat.repo\r\n\r\n[elastic-5.x]\r\nname=Elastic repository for 5.x packages\r\nbaseurl=https:\/\/artifacts.elastic.co\/packages\/5.x\/yum\r\ngpgcheck=1\r\ngpgkey=https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch\r\nenabled=1\r\nautorefresh=1\r\ntype=rpm-md\r\n\r\n\t#\u5b89\u88c5filebeat5\r\n\tyum install filebeat -y\r\n\r\n\t#\u914d\u7f6efilebeat\r\n\tvi \/etc\/filebeat\/filebeat.yml\r\n\r\nfilebeat.prospectors:\r\n- input_type: log\r\n  paths:\r\n    - \/var\/log\/nginx\/access.log\r\n  document_type: wsfnk-nginx-access\r\n#------------ Logstash output -----------------\r\noutput.logstash:\r\n  # The Logstash hosts\r\n  hosts: [\"223.84.153.80:5044\"]\r\n\r\n\t#\u542f\u52a8\r\n\tsystemctl start filebeat\r\n\tsystemctl enable filebeat<\/pre>\n","protected":false},"excerpt":{"rendered":"

1\uff1a\u5f00\u542fssh\u5bc6\u94a5\u767b\u5f55\uff0c\u5e76\u7981\u7528ssh\u5bc6\u7801\u8ba4\u8bc1\uff0c\u540c\u65f6\u4fee\u6539\u5176ssh\u7aef\u53e3\u4e3a “13520” 2\uff1a\u4e3a\u7cfb\u7edf\u521b\u5efa\u666e\u901a\u8d26\u6237w […]<\/p>\n","protected":false},"author":1482,"featured_media":47404,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-156655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/156655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1482"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=156655"}],"version-history":[{"count":7,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/156655\/revisions"}],"predecessor-version":[{"id":157389,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/156655\/revisions\/157389"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/47404"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=156655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=156655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=156655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}