linux一键安装包去掉禅道访问地址中的zentao 分享链接

最后编辑:柳婷婷 于 2022-12-05 12:35:31

修改Apache配置

/opt/zbox/etc/apache/httpd.conf 删除注释“#”  

修改前

# If you want visit zentao like http://localhost/, uncomment these lines.
#<VirtualHost *:80>
#  ServerAdmin zentao@local.net
#  DocumentRoot "/opt/zbox/app/zentao/www"
#  ServerName localhost
#  <Directory />
#    AllowOverride all
#    Require all granted
#  </Directory>
#  ErrorLog "/opt/zbox/logs/apache_error.log"
#  CustomLog "/opt/zbox/logs/apache_access.log" combind
#</VirtualHost>

修改后

# If you want visit zentao like http://localhost/, uncomment these lines.
<VirtualHost *:80>
  ServerAdmin zentao@local.net
  DocumentRoot "/opt/zbox/app/zentao/www"
  ServerName localhost
  <Directory />
    AllowOverride all
    Require all granted
  </Directory>
  ErrorLog "/opt/zbox/logs/apache_error.log"
  CustomLog "/opt/zbox/logs/apache_access.log" combind
</VirtualHost>

重启服务

/opt/zbox/zbox restart

修改配置文件

/opt/zbox/app/zentao/config/my.php 

//修改前
$config->webRoot         = getWebRoot();
//修改后
$config->webRoot         = '/';

重写规则配置

/opt/zbox/app/zentao/www/.ztaccess

#修改前
  RewriteRule (.*)$ /zentao/index.php/$1 [L]
#修改后
  RewriteRule (.*)$ /index.php/$1 [L]


柳婷婷 5175