环境, centos 7, apache做web服务器, 面板最新版 8.0.6
问题描述
/www/server/panel/vhost/apache/a.com.conf 的内容如下:
```
<VirtualHost *:80>
...
ServerAlias a.com b.com
...
</VirtualHost>
<VirtualHost *:443>
...
ServerAlias a.com b.com
...
</VirtualHost>
```
面板中删除 b.com 之后, /www/server/panel/vhost/apache/a.com.conf 的内容如下:
```
<VirtualHost *:80>
...
ServerAlias a.com
...
</VirtualHost>
<VirtualHost *:443>
...
ServerAlias a.com b.com
...
</VirtualHost>
```
`<VirtualHost *:443>` 这个虚拟主机下的 b.com 没有被删除
解决办法:
/www/server/panel/class/panelSite.py 的 1502 行 的
`rep = r"\n*<VirtualHost \*\:" + port + ">(.|\n){500,1500}</VirtualHost>"`
改成下面的就解决了
`rep = r"\n*<VirtualHost \*\:" + port + ">(.|\n){500,3000}</VirtualHost>"`
然后重启宝塔服务 `/etc/init.d/bt restart` 再删除就删除干净了
|
|