1.上传下载
yum install lrzsz
sz下载
rz上传
2.安装压缩命令
yum install -y unzip zip;
3.安装java
rpm -ivh jdk-8u161-linux-x64.rpm
4.安装mysql
yum install libaio
yum -y remove mariadb-libs-5.5*
rpm -ivh mysql-community-common-5.7.21-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.21-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.21-1.el7.x86_64.rpm
启动配置mysql
vi /etc/my.cnf
在[mysqld]下添加:
skip-grant-tables=1
service mysqld restart
mysql -u root -p
update user set host='%' where host='localhost';
update user set authentication_string = password('xxx'), password_expired = 'N', password_last_changed = now() where user = 'root';
再把上面的skip-grant-tables=1去掉,这样就可以密码登录了。
mysql5.7默认分组字段必须在查询字段里,修改这个配置:
mysql命令行,执行命令
select @@sql_mode;
这样就可以查出sql_mode的值,复制这个值,在my.cnf中添加配置项(把查询到的值删掉only_full_group_by这个选项,其他的都复制过去):
sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION;
再加一行,设置默认编码
character-set-server=utf8
设置innodb缓存,加快查询速度,其值按自己机器定:
innodb_buffer_pool_size=256M
5.安装nginx
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
下载并解压nginx-1.10.2,进入nginx-1.10.2目录
chmod a+x ./configure
./configure
make
make install
安装成功了,查找安装路径:
whereis nginx
cd /usr/local/nginx/sbin/
启动: ./nginx
退出:./nginx -s quit
nginx的负载均衡:
cd /usr/local/nginx/conf
vi nginx.conf
http{
include /usr/local/nginx/conf.d/*.conf;
}
进入conf.d文件夹,编辑自己网站xx.conf,假如域名是www.xx.com,本地启动了两个端口8280 8281:
upstream tomcats{
server 127.0.0.1:8280;
server 127.0.0.1:8281;
}
server {
listen 80;
server_name www.xx.com;
index index.html;
location / {
#上面配置的服务器组
proxy_pass http://tomcats;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout90;
proxy_send_timeout90;
proxy_read_timeout90;
client_max_body_size10m;
client_body_buffer_size1m;
proxy_buffer_size64k;
proxy_buffers 32 32k;
proxy_busy_buffers_size128k;
proxy_temp_file_write_size1m;
limit_conn perip 5;
limit_conn perserver 20;
limit_rate 100k;
index index.html index.htm index.jsp;
}
}
漏洞修复
yum -y install wget
评论:
提交