user nginx;
worker_processes 8;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
worker_rlimit_nofile 100000;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 65000;
multi_accept off;
use epoll;
accept_mutex off;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
gzip_min_length 0;
gzip_buffers 8 32k;
gzip_http_version 1.1;
gzip_comp_level 5;
gzip_types text/plain application/javascript application/json application/x-javascript text/javascript text/css application/xml applicati
on/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
#include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name localhost;
root /home/talentwalker/wwwroot/;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
# root html;
}
location ~ \.php {
add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
add_header Access-Control-Allow-Headers CHANNELID,SID,SERVERCODE;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$; #pathinfo模式
fastcgi_param PATH_INFO $fastcgi_path_info; #pathinfo模式
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
location /jenkins {
proxy_pass http://127.0.0.1:8080/jenkins;
}
}
}
cmake -DCMAKE_INSTALL_PREFIX=/usr/share/mysql -DMYSQL_DATADIR=/mnt/data -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306 -DWITH_DEBUG=1
make
make insatll
初始化mysql数据库 数据存储目录必须有
/usr/share/mysql/scripts/mysql_install_db --user=mysql --datadir=/mnt/data
mysql配置文件
cp /usr/share/mysql/support-files/my-default.cnf /etc/my.cnf
[client]
#password = your_password port = 3306 socket = /data/mysql/mysql.sock default-character-set=utf8
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
character_set_server=utf8
basedir=/data/mysql
datadir=/data/mysql/data
socket = /data/mysql/mysql.sock
log-error=/var/log/mysql/error.log
log=/var/log/mysql/mysql.log
long_query_time=2
log-slow-queries= /usr/local/mysql/log/slowquery.log
将MySQL执行命令添加入PATH 如果有多个用:隔开
PATH=$PATH:/usr/share/mysql/bin export PATH
将MySQL设置为系统服务并启动服务
cp support-files/mysql.server /etc/init.d/mysqld
最后可直接通过系统服务开启mysqld serveice mysqld start|stop|restart
设置mysql管理员密码
mysqladmin -u root password "123456";
环境搭建基本就完成了