一、安装JDK
推荐使用jdk1.8+
> yum search jdk
> yum install -y java-1.8.0-openjdk.x86_64
> yum install -y java-11-openjdk.x86_64
> yum install -y java-latest-openjdk.x86_64
[root@iZwz94p9y07ns86pck1l2jZ kuangstudy]# java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
使用yum安装jdk话,是全局安装,会自动写入环境变量中,也就说,你在任何的地方执行都可以运行的java程序。
二、安装宝塔
官网地址:https://www.bt.cn/
当前阿里云服务器是:centos7.x版本
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
然后在浏览器上:http://47.115.94.78:8888/54ee0a01
注意:在阿里云服务器的安全组中开放:8888端口(切记,切记!!!)
02、宝塔MysqL安装
在宝塔的面板中:【软件商店】 搜索 MysqL 点击安装即可。
MysqL -uroot -ppassword
可视化工具授权
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
刷新
flush privileges;
03、Redis安装
前提
> mkdir -p /www/kuangstudy/redis
> cd /www/kuangstudy/redis
安装:
/www/kuangstudy/redis> wget http://download.redis.io/releases/redis-5.0.9.tar.gz
/www/kuangstudy/redis> tar xzf redis-5.0.9.tar.gz
/www/kuangstudy/redis> cd redis-5.0.9
/www/kuangstudy/redis> make
启动redis服务
/www/kuangstudy/redis> cd redis-5.0.9
/www/kuangstudy/redis> ./src/redis-server
连接redis客户端
/www/kuangstudy/redis> cd redis-5.0.9
/www/kuangstudy/redis> ./src/redis-cli
守护进程启动redis
[root@iZwz94p9y07ns86pck1l2jZ redis-5.0.12]# ./src/redis-server ./redis.conf
25431:C 20 May 2021 10:56:30.812 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25431:C 20 May 2021 10:56:30.812 # Redis version=5.0.12, bits=64, commit=00000000, modified=0, pid=25431, just started
25431:C 20 May 2021 10:56:30.812 # Configuration loaded
修改配置redis.conf
daemonize yes
requirepass 123456
bind 0.0.0.0
客户端连接
[root@iZwz94p9y07ns86pck1l2jZ redis-5.0.12]# ./src/redis-cli
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> set name lly
OK
127.0.0.1:6379> get name
"lly"
连接失败就修改
protected-mode no
04、宝塔Nginx 安装
在宝塔的面板中:【软件商店】 搜索 Nginx点击安装即可。
1、手动安装Nginx
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
2、下载Nginx
> mkdir -p /www/kuangstudy
> cd /www/kuangstudy
> wget http://Nginx.org/download/Nginx-1.20.1.tar.gz
3、解压Nginx
tar -zxvf Nginx-1.20.1.tar.gz
4、开始进行Nginx的配置
配置的作用就是:告诉Nginx配置,静态资源在那个目录进行存放
> cd /www/kuangstudy/Nginx-1.20.1
> ./configure --with-http_ssl_module
Nginx path prefix: "/usr/local/Nginx"
Nginx binary file: "/usr/local/Nginx/sbin/Nginx"
Nginx modules path: "/usr/local/Nginx/modules"
Nginx configuration prefix: "/usr/local/Nginx/conf"
Nginx configuration file: "/usr/local/Nginx/conf/Nginx.conf"
Nginx pid file: "/usr/local/Nginx/logs/Nginx.pid"
Nginx error log file: "/usr/local/Nginx/logs/error.log"
Nginx http access log file: "/usr/local/Nginx/logs/access.log"
Nginx http client request body temporary files: "client_body_temp"
Nginx http proxy temporary files: "proxy_temp"
Nginx http fastcgi temporary files: "fastcgi_temp"
Nginx http uwsgi temporary files: "uwsgi_temp"
Nginx http scgi temporary files: "scgi_temp"
5、进行Nginx的编译和安装
也就是说吧Nginx包下的模块和对应相关文件,全部解压到.configuration指定的目录中去
> make
> make install
6:然后启动Nginx
> cd /usr/local/Nginx/sbin
# 启动Nginx
> ./Nginx
# 重启Nginx
> ./Nginx -s reload
# 停止Nginx
> ./Nginx -s stop
访问你的ip即可:http://47.115.94.78/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。