{"id":236,"date":"2017-03-21T20:34:59","date_gmt":"2017-03-21T12:34:59","guid":{"rendered":"http:\/\/pony.hk\/?p=236"},"modified":"2017-10-25T15:17:15","modified_gmt":"2017-10-25T07:17:15","slug":"centos7-3-64bitnginx1-11-10mysql5-6-35php7-0-16tomcat7-0-69java1-6-0%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/lnmp.ivan.xin\/?p=236","title":{"rendered":"centos7.3 64bit + nginx1.11.10 + mysql5.6.35 + php7.0.16 + tomcat6.0.39 + java 1.6.0\u73af\u5883\u642d\u5efa"},"content":{"rendered":"<h3>\u89c4\u5212\uff1a<\/h3>\n<p>\u8f6f\u4ef6\u7248\u672c\uff1a<br \/>\ncentos 7.3 64bit<br \/>\nmysql 5.6.35<br \/>\nnginx 1.11.10 \u5b89\u88c5ngx_log_if-master ngx_http_substitutions_filter_module http_ssl_module\u7b49\u6a21\u5757<br \/>\nphp 7.0.16 \u5b89\u88c5php-fpm zend mcrypt openssl opcache gd\u7b49\u6a21\u5757<br \/>\njava 1.6.0<br \/>\ntomcat 6.0.39<\/p>\n<h3>\u7528\u6237\u73af\u5883\u914d\u7f6e\uff1a<\/h3>\n<p># hwclock --set --date=\"03\/21\/17 09:10:30\" \/\/\u66f4\u65b0\u65f6\u95f4<br \/>\n# hwclock --hctosys\/\/\u628a\u786c\u4ef6\u65f6\u949f\u540c\u6b65\u5230\u7cfb\u7edf\u65f6\u949f<br \/>\n# vi \/etc\/sysconfig\/clock \/\/\u66f4\u6539\u65f6\u533a\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>ZONE=Asia\/Shanghai<br \/>\nUTC=false<br \/>\nARC=false<\/p><\/blockquote>\n<p># rm \/etc\/localtime<br \/>\n# ln -sf \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<br \/>\n# vi \/etc\/selinux\/config \u4fee\u6539 SELINUX=enforcing<br \/>\n# reboot<\/p>\n<p># \/usr\/sbin\/groupadd www<br \/>\n# \/usr\/sbin\/useradd -g www www<br \/>\n# passwd www #\u4fee\u6539\u5bc6\u7801\u4e3a\u5ba2\u6237VPS\u7684\u5bc6\u7801<br \/>\n# echo \"AllowUsers www\" &gt;&gt; \/etc\/ssh\/sshd_config<br \/>\n# systemctl restart sshd.service<br \/>\n# \/usr\/sbin\/groupadd mysql<br \/>\n# \/usr\/sbin\/useradd -g mysql mysql<br \/>\n# mkdir -p \/data\/htdocs<br \/>\n# chcon -R -t usr_t \/data\/htdocs<br \/>\n# chown -R www:www \/data\/htdocs<\/p>\n<p># yum -y install yum-fastestmirror<br \/>\n# yum clean all<br \/>\n# yum list<br \/>\n# yum -y install wget vixie-cron crontabs<br \/>\n# systemctl start crond.service<br \/>\n# systemctl enable crond.service<\/p>\n<h3>\u5b89\u88c5mysql\uff1a<\/h3>\n<p># rpm -qa | grep mysql \/\/\u627e\u5230\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\uff0c\u7528rpm -e\u5168\u90e8\u5220\u9664<br \/>\n# rpm -e mysql-libs-5.1.73-3.el6_5.x86_64<br \/>\n# yum install perl libaio -y<br \/>\n# cd ~<br \/>\n# rpm -ivh http:\/\/repo.mysql.com\/mysql-community-release-el7-5.noarch.rpm<br \/>\n# yum install mysql-server -y<br \/>\n# vi \/etc\/my.cnf\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<blockquote><p>[mysqld]<br \/>\nlog-bin=mysql-bin<br \/>\nbinlog_format=mixed<br \/>\nperformance_schema_max_table_instances=6000<br \/>\ntable_definition_cache=512<br \/>\ntable_open_cache=512<br \/>\nslow_query_log<br \/>\nlong_query_time = 2<br \/>\n#slow_query_log_file=\"\/tmp\/mysql_slow.log\"<br \/>\n#log_slave_updates<br \/>\n#gtid-mode=ON<br \/>\n#enforce-gtid-consistency=ON<br \/>\nexplicit_defaults_for_timestamp=true<\/p><\/blockquote>\n<p># systemctl start mysqld.service<br \/>\n# systemctl enable mysqld.service<\/p>\n<h3>\u5b89\u88c5nginx\uff1a<\/h3>\n<p># yum -y install wget zip unzip gcc make pcre-devel openssl-devel git<br \/>\n# cd ~<br \/>\n# wget -c http:\/\/nginx.org\/download\/nginx-1.11.10.tar.gz<br \/>\n# tar -zxf nginx-1.11.10.tar.gz<br \/>\n# mkdir -p \/usr\/local\/nginx\/<br \/>\n# cd \/usr\/local\/nginx<br \/>\n# wget https:\/\/github.com\/cfsego\/ngx_log_if\/archive\/master.zip<br \/>\n# unzip master.zip<br \/>\n# git clone git:\/\/github.com\/yaoweibin\/ngx_http_substitutions_filter_module.git<br \/>\n# cd ~\/nginx-1.11.10<br \/>\n# .\/configure --prefix=\/usr\/local\/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-pcre --with-http_realip_module --add-module=\/usr\/local\/nginx\/ngx_log_if-master --add-module=\/usr\/local\/nginx\/ngx_http_substitutions_filter_module<br \/>\n# make &amp;&amp; make install<br \/>\n\/**<br \/>\n# vi \/etc\/init.d\/nginx \/\/<span style=\"color: #0000ff;\">\u521b\u5efaservice\u670d\u52a1\u811a\u672c\uff0c\u53ef\u4ee5\u53bb\u7f51\u4e0a\u641c\u7d22\u5185\u5bb9\uff0c\u6bd4\u5982<a style=\"color: #0000ff;\" href=\"http:\/\/blog.csdn.net\/baiquan17\/article\/details\/53304456\" target=\"_blank\" rel=\"noopener\">http:\/\/blog.csdn.net\/baiquan17\/article\/details\/53304456<\/a><\/span><br \/>\n#\u00a0vi \/usr\/local\/nginx\/conf\/nginx.conf \/\/<span style=\"color: #0000ff;\">\u7f16\u8f91nginx\u914d\u7f6e\uff0c\u5185\u5bb9\u53ef\u4ee5\u5230\u7f51\u4e0a\u641c\uff0c\u6bd4\u5982<a style=\"color: #0000ff;\" href=\"http:\/\/www.cnblogs.com\/chenjiahe\/p\/5956002.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.cnblogs.com\/chenjiahe\/p\/5956002.html<\/a>\uff0c\u6216\u8005\u56de\u590d\u672c\u6587\u7559\u4e0b\u90ae\u7bb1\u7d22\u53d6<\/span><br \/>\n**\/<\/p>\n<p># mkdir -p \/usr\/local\/nginx\/conf\/conf.d\/<br \/>\n# chmod +x \/etc\/init.d\/nginx<br \/>\n# chkconfig --add nginx<br \/>\n# chkconfig --level 2345 nginx on<br \/>\n# mkdir \/var\/log\/nginx<br \/>\n# touch \/var\/log\/nginx\/error.log<br \/>\n# mv \/usr\/local\/nginx\/conf \/etc\/nginx<br \/>\n# ln -s \/etc\/nginx \/usr\/local\/nginx\/conf<br \/>\n# systemctl restart nginx.service<\/p>\n<h3>\u5b89\u88c5php\uff1a<\/h3>\n<p># cd ~<br \/>\n# rpm -Uvh https:\/\/mirror.webtatic.com\/yum\/el7\/webtatic-release.rpm<br \/>\n# yum install php70w php70w-common php70w-opcache php70w-fpm php70w-gd php70w-mcrypt php70w-mysql php70w-mbstring -y<br \/>\n# rpm -qa | grep httpd<br \/>\n# yum remove httpd -y<br \/>\n# yum remove httpd-tools -y<br \/>\n# setsebool -P httpd_can_network_connect=1<\/p>\n<p># vi \/etc\/php.ini\u4fee\u6539\u53c2\u6570\uff1adefault_charset = \"gb2312\"<br \/>\n# vi \/etc\/php-fpm.d\/www.conf \u4fee\u6539\u4ee5\u4e0b\u53c2\u6570\uff1a<\/p>\n<blockquote><p>user=www<br \/>\ngroup=www<br \/>\nrequest_terminate_timeout = 30s<br \/>\npm.max_children = 50<br \/>\npm.start_servers = 16<br \/>\npm.min_spare_servers = 16<br \/>\npm.max_spare_servers = 50<\/p><\/blockquote>\n<p># vi \/etc\/php.d\/opcache.ini \u4fee\u6539\u5982\u4e0b\u53c2\u6570\uff1a<\/p>\n<blockquote><p>opcache.enable=1<br \/>\nopcache.enable_cli=1<br \/>\nopcache.memory_consumption=256<br \/>\nopcache.interned_strings_buffer=8<br \/>\nopcache.max_accelerated_files=2000<br \/>\nopcache.revalidate_freq=2<br \/>\nopcache.fast_shutdown=1<\/p><\/blockquote>\n<p># systemctl restart php-fpm.service<br \/>\n# systemctl enable php-fpm.service<\/p>\n<h3>\u914d\u7f6ejava\u548ctomcat\uff1a<\/h3>\n<p># yum list | grep openjdk \/\/\u641c\u7d22\u5230\u7c7b\u4f3c\u4e0b\u8fb9\u7684\u5b89\u88c5\u5305\uff0c\u7136\u540e\u5b89\u88c5\uff0c\u6839\u636e\u9700\u6c42\u5b89\u88c51.6.0<br \/>\n# yum install java-1.6.0-openjdk.x86_64 -y<br \/>\n# alternatives --config java \/\/\u6839\u636e\u9700\u6c42\u9009\u62e9\u4f7f\u75281.6.0\u8fd9\u4e2ajava\u73af\u5883<br \/>\n# java -version \/\/\u9a8c\u8bc1java\u73af\u5883\u751f\u6548<\/p>\n<p># cd ~;mkdir tools;cd tools<br \/>\n# wget http:\/\/archive.apache.org\/dist\/tomcat\/tomcat-6\/v6.0.39\/bin\/apache-tomcat-6.0.39.tar.gz<br \/>\n# tar -xzf apache-tomcat-6.0.39.tar.gz;cd apache-tomcat-6.0.39\/lib<br \/>\n# wget https:\/\/dev.mysql.com\/get\/Downloads\/Connector-J\/mysql-connector-java-5.1.44.zip<br \/>\n\/\/\u89e3\u538b\u540e\u628amysql-connector-java-5.1.44-bin.jar\u653e\u5728tomcat lib\u76ee\u5f55\u4e0b<br \/>\n# yum -y install apr apr-devel tomcat-native<br \/>\n# cd ~\/tools\/apache-tomcat-6.0.39\/conf<br \/>\n# vi server.xml \/\/\u5728\u6587\u4ef6\u5e95\u90e8\u524d\u52a0\u5165\u7f51\u7ad9\u914d\u7f6e\u4ee3\u7801<\/p>\n<p># ~\/tools\/apache-tomcat-6.0.39\/bin\/startup.sh<\/p>\n<h3>\u4fee\u6539\u7cfb\u7edf\u914d\u7f6e\uff1a<\/h3>\n<p># systemctl stop firewalld.service<br \/>\n# systemctl disable firewalld.service<br \/>\n# service iptables stop<br \/>\n# iptables -L -n<br \/>\n# iptables -F<br \/>\n# iptables -X<br \/>\n# iptables -L -n<br \/>\n# iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br \/>\n# iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT<br \/>\n# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT<br \/>\n# iptables -A INPUT -p icmp -j ACCEPT<br \/>\n# iptables -A INPUT -i lo -p all -j ACCEPT<br \/>\n# iptables -P INPUT DROP<br \/>\n# iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited<br \/>\n# iptables -A FORWARD -j REJECT --reject-with icmp-host-prohibited<br \/>\n# iptables -L -n<br \/>\n# yum install iptables-services -y<br \/>\n# service iptables save<br \/>\n# systemctl restart iptables<br \/>\n# systemctl enable iptables<br \/>\n# echo \"\/bin\/systemctl restart mysql.service\" &gt;&gt; \/etc\/rc.local<br \/>\n# echo \"\/bin\/systemctl restart php-fpm.service\" &gt;&gt; \/etc\/rc.local<br \/>\n# echo \"\/bin\/systemctl restart nginx.service\" &gt;&gt; \/etc\/rc.local<br \/>\n# echo \"\/bin\/systemctl restart iptables.service \" &gt;&gt; \/etc\/rc.local<br \/>\n# echo \u201c~\/tools\/apache-tomcat-6.0.39\/bin\/startup.sh\u201d &gt;&gt; \/etc\/rc.local<br \/>\n# reboot<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89c4\u5212\uff1a \u8f6f\u4ef6\u7248\u672c\uff1a centos 7.3 64bit mysql 5.6.35 nginx 1.11.10 \u5b89...<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19510,7,15330,15329,15331],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-lnmp","category-linux","category-mysql","category-nginx","category-php"],"_links":{"self":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=236"}],"version-history":[{"count":0,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/236\/revisions"}],"wp:attachment":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}