简体   繁体   中英

How to change routing in bitnami?

I have two custom php apps in bitnami. First one in apps/site and second in 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 ?

Now to access those two apps I need to go to domain.com/site and domain.com/forum .

Bitnami Engineer here,

If you are using the default paths, follow these steps (they use /opt/bitnami as installdir and pwd ):

  • Add the file site/conf/httpd-vhosts.conf with the content below:
<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:
 <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 :
#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 :
Include "/opt/bitnami/apps/site/conf/httpd-vhosts.conf"
Include "/opt/bitnami/apps/forum/conf/httpd-vhosts.conf"
  • Restart apache.

I hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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