bitnami / vms

Bitnami VMs
https://bitnami.com
Other
200 stars 44 forks source link

Setting up Virtual Hosts in LAMP with Bitnami #1562

Open rhastingsNEKLS opened 3 weeks ago

rhastingsNEKLS commented 3 weeks ago

Describe your issue as much as you can

My instructions for creating new servers in AWS Lightsail with Bitnami include editing 2 files in the bitnami installation that don't seem to be there any more. I'm supposed to edit /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf /opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf in order to set up the virtual hosts for the server (I have about 25 sites that are served from this machine). In the server that currently exists, I just added the hosts to the vhosts.conf file above and edited the prefix file to point to the correct conf files and things worked, but when I am trying to get the new server I just provisioned in order to get PHP 8 going, those files don't exist and I'm not sure what changes were made in the bitnami application that would allow me to do the same thing - point many vhosts to their appropriate folders - in the current installation. Any help would be appreciated!

rhastingsNEKLS commented 3 weeks ago

I did find a document from Bitnami that showed how to put vhost blocks into a file in the vhost directory, but the instructions weren't terribly clear and it didn't work for me, so I'm still looking for a good explanation of how to set up multiple vhosts for Bitnami's current architecture.

gongomgra commented 3 weeks ago

Hi @rhastingsNEKLS,

The bitnami-apps-prefix.conf and bitnami-apps-vhosts.conf files are present in very old images that we no longer support. We recommend you to launch a new one and migrate your data there. In the new instance, you can follow the next guide to install custom applications using virtualhosts.

https://docs.bitnami.com/aws/infrastructure/lamp/administration/create-custom-application-php/

My instructions for creating new servers in AWS Lightsail with Bitnami include editing 2 files in the bitnami installation

About that, can you share with us the docs you are referring to in case they are public? As mentioned above, those files are no longer present in our images (for a long time already)

rhastingsNEKLS commented 3 weeks ago

Ok, thanks - that's a little bit more detailed than the documentation I'd found the other day, so I'll go through and try that. I'm running about 25 Wordpress sites on the server I'm provisioning so the "myapp" part of the file name should be wordpress? Does it matter? I have a wordpress-vhosts.conf file now that I'd set up with all of the site's vhost blocks included in it (though I need to go back and make sure the ServerAlias * is not in any of them. That might be causing issues) but the site is still showing the Bitnami default application screen for each domain that I have tested. I'll go through the process in the documentation you've provided and see if that fixes the issue. As for the documentation I'm working from - it's a Google Doc that we'd received from the consulting company who set up our Lightsail implentations and is not public. We did this about 8 years ago and I've just been using the docs I had until this server update, which is the first time I'd run into the new architecture. Thanks for the pointers!

rhastingsNEKLS commented 3 weeks ago

Actually working through the process, I have another question - should I be creating all of these under the "apps" vhost file (as in the old Bitnami architecture, all of my web folders are in the apps directory under /opt/bitnami/) or should I create a separate vhost file for each app in that directory - the folders in the apps directory are the ones that hold the wordpress sites. So I have CKLS1 for one site, CKLS2 for another site, etc. - should I be creating CKLS1-vhost.conf, CKLS2-vhosts.conf files with the virtual host block inside of it for each site I'm hosting? Or is my single apps-vhost.conf file with all of the blocks inside of it right? I did remove the server alias line and tried it again - still no luck, so now I'm wondering if each site should be it's own app with it's own vhost (and ssl) conf file?

gongomgra commented 2 weeks ago

@rhastingsNEKLS Bitnami installations follow a whole new structure in newer servers where each app is hosted at the /opt/bitnami/app-name directory, where app-name is any valid name for a Linux directory (I highly recommend to avoid using white spaces though). The guide I shared covers this new way of adding apps. You will have to add separate Apache configuration for each app into Apache vhosts config folder. Also remember to restart Apache for changes to take effect.

As for the documentation I'm working from - it's a Google Doc that we'd received from the consulting company who set up our Lightsail implentations and is not public. We did this about 8 years ago and I've just been using the docs I had until this server update, which is the first time I'd run into the new architecture. Thanks for the pointers!

Thanks for confirming. We updated the filesystem structure some time ago, and the docs as well, but I was wondering if we missed to update anything.

rhastingsNEKLS commented 2 weeks ago

Ok, thanks for the clarification - that was how I thought it should be set up from the guide you sent, but I wanted to be sure. That helps a lot - thanks!!

On Mon, Jun 17, 2024 at 10:37 AM Gonzalo Gómez Gracia < @.***> wrote:

@rhastingsNEKLS https://github.com/rhastingsNEKLS Bitnami installations follow a whole new structure in newer servers where each app is hosted at the /opt/bitnami/app-name directory, where app-name is any valid name for a Linux directory (I highly recommend to avoid using white spaces though). The guide I shared covers this new way of adding apps. You will have to add separate Apache configuration for each app into Apache vhosts config folder. Also remember to restart Apache for changes to take effect.

As for the documentation I'm working from - it's a Google Doc that we'd received from the consulting company who set up our Lightsail implentations and is not public. We did this about 8 years ago and I've just been using the docs I had until this server update, which is the first time I'd run into the new architecture. Thanks for the pointers!

Thanks for confirming. We updated the filesystem structure some time ago, and the docs as well, but I was wondering if we missed to update anything.

— Reply to this email directly, view it on GitHub https://github.com/bitnami/vms/issues/1562#issuecomment-2173735887, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUQHG4AVNZIWY2BSEKCN5TZH37C5AVCNFSM6AAAAABJCHRRB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZTG4ZTKOBYG4 . You are receiving this because you were mentioned.Message ID: @.***>

-- Robin Hastings My pronouns are she/her Library Services Consultant - NEKLS www.nekls.org 785-838-4090

github-actions[bot] commented 1 day ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.