centos 6.9 快速部署lnmp网站

来源:互联网 发布:js获取相同class的值 编辑:程序博客网 时间:2024/05/21 17:09

安装软件

yum install -y php php-mysql php-fpm nginx mysql mysql-server

mysql配置

/etc/my.cnf[client]port=3306[mysql]default-character-set=utf8[mysqld]skip-name-resolveport=3306character-set-server=utf8default-storage-engine=MyISAM#支持 INNODB 引擎模式。修改为 default-storage-engine=INNODB 即可。#如果 INNODB 模式如果不能启动,删除data目录下ib开头的日志文件重新启动。sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"max_connections=512query_cache_size=0table_cache=256tmp_table_size=18Mthread_cache_size=8myisam_max_sort_file_size=64Gmyisam_sort_buffer_size=35Mkey_buffer_size=25Mread_buffer_size=64Kread_rnd_buffer_size=256Ksort_buffer_size=256Kinnodb_additional_mem_pool_size=2Minnodb_flush_log_at_trx_commit=1innodb_log_buffer_size=1Minnodb_buffer_pool_size=47Minnodb_log_file_size=24Minnodb_thread_concurrency=8
  • 建立账号
grant all privileges on *.* to root@'%' identified by 'xxx';grant all privileges on *.* to root@'localhost' identified by 'xxx';flush privileges;

nginx配置

server {    listen               80 default;    server_name          www.xxx.com;    client_max_body_size 4M;    client_body_buffer_size 128k;    root /opt/www/www.xxx.com;    index index.php;    location ~ \.php$ {        #try_files $uri $uri/ /index.php;        include fastcgi_params;        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        fastcgi_param REDIRECT_STATUS 200;       # fastcgi_pass unix:/var/run/php5-fpm.sock;        fastcgi_pass 127.0.0.1:9000;    }}

php-fpm配置

nothing configure

启动

/etc/init.d/php-fpm restart/etc/init.d/mysqld restart/etc/init.d/nginx restartchkconfig php-fpm onchkconfig mysqld onchkconfig nginx on
原创粉丝点击