简体   繁体   English

如何在bitnami中更改路由?

[英]How to change routing in bitnami?

I have two custom php apps in bitnami.我在 bitnami 中有两个自定义 php 应用程序。 First one in apps/site and second in apps/forum .第一个在apps/site和第二个在apps/forum How can I make it so the site loads when you go to domain.com and forum when you go to forum.domain.com ?我怎样才能使网站在您访问domain.com时加载,而在访问forum.domain.com时加载论坛?

Now to access those two apps I need to go to domain.com/site and domain.com/forum .现在要访问这两个应用程序,我需要转到domain.com/sitedomain.com/forum

Bitnami Engineer here, Bitnami工程师在这里,

If you are using the default paths, follow these steps (they use /opt/bitnami as installdir and pwd ):如果您使用默认路径,请按照以下步骤操作(它们使用/opt/bitnami作为 installdir 和pwd ):

  • Add the file site/conf/httpd-vhosts.conf with the content below:添加具有以下内容的文件site/conf/httpd-vhosts.conf
<VirtualHost *:80>
    ServerName domain.com
    ServerAlias www.domain.com
    DocumentRoot "/opt/bitnami/apps/site/htdocs"
    Include "/opt/bitnami/apps/site/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
    ServerName domain.com
    ServerAlias www.domain.com
    DocumentRoot "/opt/bitnami/apps/site/htdocs"
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
    SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
    Include "/opt/bitnami/apps/site/conf/httpd-app.conf"
</VirtualHost>
  • Add the file forum/conf/httpd-vhosts.conf with the content below:添加文件forum/conf/httpd-vhosts.conf ,内容如下:
 <VirtualHost *:80>
    ServerName forum.domain.com
    ServerAlias www.forum.domain.com
    DocumentRoot "/opt/bitnami/apps/forum/htdocs"

    Include "/opt/bitnami/apps/forum/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
    ServerName forum.domain.com
    ServerAlias www.forum.domain.com
    DocumentRoot "/opt/bitnami/apps/forum/htdocs"
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
    SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"

    Include "/opt/bitnami/apps/forum/conf/httpd-app.conf"
</VirtualHost>
  • Comment out these lines from apache2/conf/bitnami/bitnami-apps-prefix.conf :apache2/conf/bitnami/bitnami-apps-prefix.conf注释掉这些行:
#Include "/opt/bitnami/apps/site/conf/httpd-prefix.conf"
#Include "/opt/bitnami/apps/forum/conf/httpd-prefix.conf"
  • Add these lines to apache2/conf/bitnami/bitnami-apps-vhosts.conf :将这些行添加到apache2/conf/bitnami/bitnami-apps-vhosts.conf
Include "/opt/bitnami/apps/site/conf/httpd-vhosts.conf"
Include "/opt/bitnami/apps/forum/conf/httpd-vhosts.conf"
  • Restart apache.重启阿帕奇。

I hope it helps我希望它有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM