linux安装基本的开发环境
1、安装jdk11
yum install -y java-11-openjdk.x86_64
查看是否已安装jdk
java -version
2、安装nginx
//一键安装上面四个依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
下载nginx安装包并解压
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
//进入nginx目录
cd /usr/local/nginx
//进入目录
cd nginx-1.13.7
//执行命令 考虑到后续安装ssl证书 添加两个模块
./configure --with-http_stub_status_module --with-http_ssl_module
//执行make命令
make
//执行make install命令
make install
启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
3、安装redis
下载redis安装包
wget http://download.redis.io/releases/redis-6.2.6.tar.gz
解压缩文件
tar xzf redis-6.2.6.tar.gz
进入解压缩后的目录
cd redis-6.2.6
编译安装redis:
make
sudo make install
编辑配置文件
vim redis.conf
找到以下两行内容,将注释(#)去掉,并修改密码为自己的密码
# requirepass foobared
requirepass yourpassword
指定配置文件启动redis服务
sudo redis-server redis.conf &
4、安装mysql
下载rpm包
wget https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
yum方式安装
yum -y install mysql80-community-release-el7-7.noarch.rpm
安装mysql服务
yum install -y install mysql-community-server
启动mysql
systemctl start mysqld.service
查看mysql的运行状态
systemctl status mysqld.service
查看mysql生成的临时密码
grep "password" /var/log/mysqld.log
本地登录mysql
mysql -uroot -p
修改root用户密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';