1.编辑mysql的配置文件my.cnf,这个文件通常在/etc目录下,但我用rpm装mysql的时候这个配置文件是在/usr目录下,但我测试过,无论是放在/etc目录下,还是放在
/usr目录下,都可以生效,不过由于习惯,我还是将my.cnf文件放到/etc目录下
vim /etc/my.cnf
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
log-error=/alidata/log/mysql/error.log //错误日志
key_buffer_size = 128M
max_allowed_packet = 20M
table_open_cache = 1024
sort_buffer_size = 2048K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
wait_timeout = 86400
log-slow-queries="/alidata/log/mysql/mysql-slow.log"//慢日志
long_query_time = 2
2.php.ini
error_log = /alidata/log/php/error.log//错误日志
3.php-fpm.conf
error_log = /alidata/log/php/php-fpm.log
4.nginx.conf
access_log /alidata/log/nginx/access/default.log main;
error_log /alidata/log/nginx/error.log crit;
转载于:https://www.cnblogs.com/zuochuang/p/7886807.html