设置时间
yum install ntpdate -y
ntpdate cn.pool.ntp.org
hwclock --systohc
允许开启的文件数量
echo fs.inotify.max_user_watches = 524288 | sudo tee -a /etc/sysctl.conf
安装ssh
yum install openssh-server -y
vi /etc/ssh/sshd_config
放开port,ListenAddress,PermitRootLogin
开端口
firewall-cmd --zone=public --add-port=8889/tcp --permanent
网络工具
yum install net-tools.x86_64 -y
安装java
yum install java-1.8.0-openjdk.x86_64 -y
安装wget
yum install wget -y
安装mysql
wget http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm
rpm -ivh mysql57-community-release-el7-10.noarch.rpm
rpm --import repo.mysql.com/RPM-GPG-KEY…
yum -y install mysql-server
systemctl enable mysqld
systemctl start mysqld
查看密码
cat /var/log/mysqld.log |grep password
set global validate_password_policy=0;
set global validate_password_length=1;
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
允许远程连接
use mysql;
update user set host = '%' where user = 'root';
grant all privileges on . to 'root'@'%' identified by 'root';
flush privileges;
去掉大小写敏感
vi /etc/my.conf
添加
lower_case_table_names = 1
systemctl restart mysqld
安装redis
yum install epel-release
yum install redis
service redis start
chkconfig redis on
安装nodejs14
yum -y install curl
curl -sL rpm.nodesource.com/setup_14.x | sudo bash -
yum install -y nodejs
npm --registry registry.npm.taobao.org install
//内部npm私服
npm --registry http://172.25.78.106:4873/ install
安装nginx
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum -y install nginx
systemctl start nginx
目录/etc/nginx/nginx.conf
开nginx的HTTP权限
首先查看selinux状态
sestatus
如果是enable可以先去配置文件关闭,然后把enable换成disable,下次重启生效
vi /etc/selinux/config
临时关闭
setenforce 0
开启允许http访问
setsebool -P httpd_can_network_connect 1
安装nvm
curl -o- https://gitee.com/mirrors/nvm/raw/master/install.sh | bash
source ~/.bashrc
安装maven
curl -O https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
tar -xvf apache-maven-3.6.1-bin.tar.gz
mv apache-maven-3.6.1
vi ~/.bashrc