1 安装宝塔
宝塔还是非常好用的
1.1 Linux安装
x
Windows版本的宝塔
在宝塔的主页:
2 安装运行环境
推荐安装的版本,请根据情况自己选择。
2.1 PHP7.4
- 推荐时间:2022-12
- 适配:zentao、wordpress、zdoo等
2.2 mysql8.0
- 推荐时间:2022-12
- 适配:zentao、eladmin、pearadmin、wordpress、zdoo等
2.3 Nginx
用于发布网站,如PHP网站,nodejs网站等
推荐时间:2022-12
Nginx 1.21.1
默认占用:80端口
本地访问:http://127.0.0.1/,显示:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.Thank you for using nginx.
修改nginx端口
如果80被占用,可以修改Nginx端口,比如修改到888
宝塔=》应用商店=》已安装=》Ngix=》配置修改:
http=》server=》listen ;修改为需要的端口
然后重启Nginx服务。
3 部署应用
3.1 zentao 18
- 通过宝塔创建站点,比如
zentao.kevin.com:8001
上传zentao18的源码
创建数据库 zentao
访问网站,一路安装OK
3.2 eladmin
前端VUE网站部署
- 通过宝塔创建站点,比如: eladmin.kevin.com:8002
- 上传 eladmin-web的打包disk到网站上
- 访问ok
后端部署
通过宝塔,创建Java项目网站,
上传jar
设置端口、命令等。
启动
3.2 pear admin boot
用宝塔的【网站】=》【Java项目】部署
选择添jar,设定端口,就可以启动
耗内存大约640M,还是比较大的,Linux、WIndows下,耗内存一样
运行
IP+端口号。例如:http://127.0.0.1:8002/
为了方便访问,可以进行下面的操作:
Window添加自定义hosts
修改:C:\Windows\System32\drivers\etc\hosts
# kevin local web by bt
127.0.0.1 zentao.kevin.com
127.0.0.1 zdoo8.kevin.com
127.0.0.1 zentao12.kevin.com
127.0.0.1 eladmin.kevin.com
就可以访问: http://zentao.kevin.com:8002
宝塔的Nginx主页修改
以window为例
- 编辑:
D:\BtSoft\nginx\html\index.html
<!DOCTYPE html>
<html>
<head>
<title>Kevin的本地服务器</title>
<style>
.btn{
width: 100%;
height: 50px;
text-decoration: none;
padding: 10px 30px;
background: green;
color: #fff;
font-size: 25px;
border-radius: 15px;
}
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
div{
width: 600px;
height:50px;
margin: 20px;
text-align: center;
vertical-align:middle;
}
</style>
</head>
<body>
<h1>Kevin的本地服务器</h1>
<p>Nginx 主页.</p>
<p>下面是安装的本地地址:</p>
<div><a class = "btn" href="http://eladmin.kevin.com:8070/" target="_blank">eladmin:http://eladmin.kevin.com:8070/</a></div>
<div><a class = "btn" href="http://zdoo8.kevin.com:8090/" target="_blank">zdoo 8 版本:http://zdoo8.kevin.com:8090/</a></div>
<div><a class = "btn" href="http://zentao12.kevin.com:8082/" target="_blank">禅道12版本:http://zentao12.kevin.com:8082/</a></div>
<div><a class = "btn" href="http://zentao.kevin.com:8081/" target="_blank">禅道18版本:http://zentao.kevin.com:8081/</a></div>
</body>
</html>
- 效果:
3.3 Docsify
安装node
安装 docsify
docify-demo
npm run start 启动服务
宝塔部署:正在研究
3.4 VuePress
简单官网。 宝塔上安装wordpress
推荐时间:2022-12
可以一键安装,可以同时创建wordpress的数据库
宝塔部署:正在研究