首页 > 数据库 > MySQL > 正文

基于gentoo安装Nginx php mysql的方法

2019-11-02 16:10:58
字体:
来源:转载
供稿:网友
1、先在/etc/make.conf加入sync站点,待会儿要用emerge进行同步。

复制代码 代码如下:

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

在执行 emerge --sync 同步portage树。

2、升级portage 版本,要不待会儿安装mysql的时候会提示portage 版本旧的!

复制代码 代码如下:

emerge portage

先定义USE:

复制代码 代码如下:

/etc/portage/package.use

dev-lang/php cli ming xml ftp curl pdo mysqli mysql sqlite json cgi ctype gd hash

www-servers/nginx fastcgi

编辑/etc/portage/package.keywords

www-servers/spawn-fcgi ~x86

3、安装 mysql nginx php spawn-fcgi pecl-apc pecl-memcache。

复制代码 代码如下:

emerge mysql nginx php spawn-fcgi pecl-apc pecl-memcache

4、配置mysql。

复制代码 代码如下:

mkdir -p /data0/mysql/data

mysql_install_db --user=mysql --basedir=/usr --datadir=/data0/mysql/data

配置my.cnf

复制代码 代码如下:

rm -f /etc/mysql/my.cnf

vim /etc/mysql/my.cnf

[client]

port = 3306

socket = /var/run/mysqld/mysqld.sock

[mysql]

prompt="(/u:s135[/d]> "

no-auto-rehash

[mysqld]

bind-address = 173.252.207.109

user = mysql

port = 3306

socket = /var/run/mysqld/mysqld.sock

basedir = /usr

datadir = /data0/mysql/data

open_files_limit = 600

back_log = 20

max_connections = 100

max_connect_errors = 200

table_cache = 60

external-locking = FALSE

max_allowed_packet = 16M

sort_buffer_size = 128K

join_buffer_size = 128K

thread_cache_size = 10

thread_concurrency = 8

query_cache_size = 0M

query_cache_limit = 2M

query_cache_min_res_unit = 2k

default_table_type = MyISAM

thread_stack = 192K

transaction_isolation = READ-UNCOMMITTED

tmp_table_size = 512K

max_heap_table_size = 32M

/var/log/slow.log

/var/log/error.log

long_query_time = 1

log_long_format

server-id = 1

#log-bin = /usr/local/mysql/data/binlog

binlog_cache_size = 2M

max_binlog_cache_size = 4M

max_binlog_size = 512M

expire_logs_days = 7

key_buffer_size = 4M

read_buffer_size = 1M

read_rnd_buffer_size = 2M

bulk_insert_buffer_size = 2M

myisam_sort_buffer_size = 4M

myisam_max_sort_file_size = 10G

myisam_max_extra_sort_file_size = 10G

myisam_repair_threads = 1

myisam_recover

[mysqldump]

quick

max_allowed_packet = 16M

mysqladmin -uroot password ""

启动mysql

/etc/init.d/mysql start

5、配置nginx

vim /etc/nginx/nginx.conf

复制代码 代码如下:

user nginx nginx;

worker_processes 1;

error_log /var/log/nginx/nginx_error.log crit;

pid /var/run/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表