CentOS7 服务器简单安装(Ngnix+MySql)
安装Nginx
安装Pcre
下载https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
解压,进入目录
./configure
make
make install
安装Zlib
下载http://www.zlib.net/zlib-1.2.11.tar.gz
解压,进入目录
./configure
make
make install
安装Nginx
下载http://nginx.org/download/nginx-1.16.1.tar.gz
解压,进入目录
用默认配置
./configure
make
make install
安装目录/usr/local/src
安装完成后生成一个目录/usr/local/nginx
打开阿里云服务器ESC的80端口(http/https)8080(自定义端口)
启动Nginx
进入/usr/local/nginx/sbin
./nginx #启动
./nginx -s quit #安全退出
./nginx -s stop #强制停止
浏览器访问http://(服务器IP)
Nginx静态文件放在html文件夹,通过修改conf/nginx.conf改变目录
安装Java
参照博文https://blog.csdn.net/ayoungyeah/article/details/99681175
解压
配置环境变量
vim /etc/profile
末尾添加
export JAVA_HOME=(java目录)
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
使环境变量生效
source /etc/profile
建立软链接
ln -s /usr/local/java/jdk1.8.0_141/bin/java /usr/bin/java
验证
java -version
安装MySQL
下载https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
yum参考https://www.cnblogs.com/gmlkl/p/9354254.html#_label6_0
yum安装
yum install mysql80-community-release-el7-3.noarch.rpm
查看是否安装成功
sudo yum repolist all|grep mysql
#查看MySQL状态
/bin/systemctl status mysqld.service
#启动MySQL
/bin/systemctl start mysqld.service
#查看mysql日志文件,找到初始密码
vim /var/log/mysqld.log
进入mysql命令行
mysql -u root -p
输入初始密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码'
#密码尽量复杂
#否则报错:Your password does not satisfy the current policy requirements
#(您的密码不符合当前的策略要求)
‘root’@‘localhost’ IDENTIFIED BY ‘新密码’
#密码尽量复杂
#否则报错:Your password does not satisfy the current policy requirements
#(您的密码不符合当前的策略要求)
未完待续······
上一篇: 表达式树