标签:jdk8 lib oracl sample 内存不足 创建 download out move
mkdir -p /data
cd /data
tar -zxvf jdk-8u211-linux-x64.tar.gz
wget http://mirrors.gigenet.com/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
tar -zxvf apache-maven-3.6.1-bin.tar.gz
vi /etc/profile
#找到最后一行,插入以下内容
JAVA_HOME=/data/jdk1.8.0_211
MAVEN_HOME=/data/apache-maven-3.6.1
PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
export PATH JAVA_HOME CLASSPATH
#wq!保存退出,并更新
source /etc/profile
yum install -y gcc-c pcre pcre-devel zlib zlib-devel openssl openssl-devel
wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar -zxvf nginx-1.12.2.tar.gz
cd nginx-1.12.2
./configure --prefix=/usr/local/nginx --with-http_ssl_module
make && make install
/usr/local/nginx/sbin/nginx
打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to nginx! 则表示 Nginx 已经安装并运行成功
#校验Nginx配置文件是否正确
/usr/local/nginx/sbin/nginx -t
#开启Nginx
/usr/local/nginx/sbin/nginx
#重启Nginx
/usr/local/nginx/sbin/nginx -s reload
#停止Nginx
/usr/local/nginx/sbin/nginx -s stop
cd /usr/local/nginx/conf
#新建自定义配置目录
mkdir conf.d
#备份nginx配置
cp nginx.conf nginx.conf.bak
vi nginx.conf
#在最后一行加入自定义配置目录
include /usr/local/nginx/conf/conf.d/*.conf;
#自定义配置
cd conf.d
vi sample.conf
内容示例如下:
server {
# https 配置
listen 443;
server_name dev.xueshitang.cn;
ssl on;
#证书地址
ssl_certificate cert/2450982_dev.xueshitang.cn.pem;
ssl_certificate_key cert/2450982_dev.xueshitang.cn.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
#小程序
location /HtXLqKtu1d.txt {
root /usr/local/nginx/html;
}
error_page 500 502 503 504 /repaire.html;
location = /repaire.html {
root /usr/local/nginx/html;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:8098/;
root html;
index index.html index.htm;
}
}
/usr/local/nginx/sbin/nginx -s reload
yum list installed | grep mysql
如果有,就先全部卸载,命令如下:
yum -y remove mysql-community-client.x86_64
rpm -qa | grep -i mysql
find / -name mysql
rm -rf /var/lib/mysql /usr/share/mysql /usr/lib64/mysql /usr/bin/mysql /etc/logrotate.d/mysql /etc/selinux/targeted/active/modules/100/mysql /var/lib/mysql/mysql
wget http://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
sudo rpm -ivh mysql80-community-release-el7-3.noarch.rpm
yum clean all
yum makecache
sudo yum install mysql-server
systemctl start mysqld.service
cat /var/log/mysqld.log | grep password
如果没有密码,则直接 mysql -u root 登录
use mysql;
update user set host = '%' where user ='root';
FLUSH PRIVILEGES;
# navicat连接报错解决 Client does not support authentication protocol requested by server; consider upgrading MySQL client
alter user 'root'@'%' identified by 'password' password expire never;
alter user 'root'@'%' identified with mysql_native_password by 'passd';//passd是自己新修改的密码。
flush privileges;再次刷新一下权限配置。
cat /proc/swaps
top
free -m
dd if=/dev/zero of=/swap_file bs=1M count=8192
mkswap /swap_file
swapon /swap_file
free -m
vi /etc/fstab
/swap_file swap swap defaults 0 0
cat /proc/sys/vm/swappiness
sysctl -a | grep swappiness
sysctl -w vm.swappiness=50
swapoff /data/swap
swapoff -a >/dev/null
rpm -qa|grep git
rpm -e --nodeps git
yum install git
wget http://download.redis.io/releases/redis-4.0.6.tar.gz
tar -zxvf redis-4.0.6.tar.gz
cd redis-4.0.6
make MALLOC=libc
cd src && make install
mkdir -p /usr/local/redis/etc/
cd redis-4.0.6
cp redis.conf /usr/local/redis/etc/
vi redis.conf
将 daemonize no 改成 daemonize yes
#设置密码授权
requirepass <设置密码>
cd redis-4.0.6/src
./redis-server /usr/local/redis/etc/redis.conf
CentOS 7 下 JDK1.8+Maven+Nginx+MySql+Git+Redis环境安装
标签:jdk8 lib oracl sample 内存不足 创建 download out move
原文地址:https://www.cnblogs.com/pingyun/p/11456911.html