Related configuration optimization after LNMP is installed in Linux

Source: Internet
Author: User
Related configuration optimization after LNMP is installed in Linux: 1. enable Nginx + PHPvim/etc/rc upon startup. local/home/mysql/mysqlstartulimit-SHn65535/usr/local/webserver/php/sbin/php-fpmstart/usr/local/webserver/n... related configuration optimization after LNMP is installed in Linux: 1. enable Nginx + PHPvim/etc/rc upon startup. local/home/mysql startulimit-SHn 65535/usr/local/webserver/php/sbin/php-fpm start/usr/local/webserver/nginx/sbin/nginx 2, optimize Linux kernel parameters vi/etc/sysctl. add # Addnet. ipv4.tcp _ m Ax_syn_backlog = 65536net. core. netdev_max_backlog = 32768net. core. somaxconn = 32768 net. core. wmem_default = 8388608net. core. rmem_default = 8388608net. core. rmem_max = 16777216net. core. wmem_max = 16777216. net. ipv4.tcp _ timestamps = 0net. ipv4.tcp _ synack_retries = 2net. ipv4.tcp _ syn_retries = 2 net. ipv4.tcp _ tw_recycle = 1 # net. ipv4.tcp _ tw_len = 1net. ipv4.tcp _ tw_reuse = 1 net. ipv4.tcp _ mem = 94500000 91500 0000 92700w.net. ipv4.tcp _ max_orphans = 3276800 # net. ipv4.tcp _ fin_timeout = 30 # net. ipv4.tcp _ keepalive_time = 120net. ipv4.ip _ local_port_range = 1024 65535/sbin/sysctl-p set immediately. 3. if Nginx does not end up, Nginx settings are changed to/usr/local/webserver. /nginx/conf/nginx. conf uses this command to test/usr/local/webserver/nginx/sbin/nginx-t. If the screen displays the following two lines of information, the setting file is accurate: the configuration file/usr/local/webserver/nginx/conf/nginx. co Nf syntax is okthe configuration file/usr/local/webserver/nginx/conf/nginx. conf was tested successfully indicates that no questions are set, you can rest assured that 4. smoothly restart NGINX/usr/local/webserver/nginx/sbin/nginx-s reload 5. write the daily script vi/usr/local/ webserver/nginx/sbin/cut_nginx_log.sh #! /Bin/bash # This script run at 00:00 # The Nginx logs pathlogs_path = "/usr/local/webserver/nginx/logs/" mkdir-p $ {logs_path} $ (date- d "yesterday" + "% Y ") /$ (date-d "yesterday" + "% m")/mv $ {logs_path} access. log $ {logs_path} $ (date-d "yesterday" + "% Y")/$ (date-d "yesterday" + "% m ") /access _ $ (date-d "yesterday" + "% Y % m % d "). logkill-USR1 'cat/usr/local/webserver/nginx. add the pid to the scheduled task

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.