Apache Stop working after adding a Virtual Host file for Laravel application in AWS Lightsail LAMP 7

Keywords: LAMP/MAMP/WAMP - AWS - How to - Other
Description:
Dear all,
I am trying to host Laravel application on LAMP 7 of AWS Lightsail.
I try to follow the instruction by Bitnami ( https://docs.bitnami.com/virtual-machine/infrastructure/lamp/get-started/use-laravel/ ). But, after this instruction, apache stop working. Whenever, I just remove app-vhost.conf, apache starts working again.

Your help will be highly appreciated.

Thanks

Hi @chanthorn2010

Thanks for using Bitnami LAMP!

Can you please share the content of the app-vhost.conf you are trying to add?

Additionally, we have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:


  <VirtualHost 127.0.0.1:80 _default_:80>
    ServerAlias *
    DocumentRoot /opt/bitnami/projects/booking/public
    <Directory "/opt/bitnami/projects/booking/public">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

<VirtualHost 127.0.0.1:443 default:443>
ServerAlias *
DocumentRoot /opt/bitnami/projects/booking/public
SSLEngine on
SSLCertificateFile “/opt/bitnami/apache2/conf/bitnami/certs/server.crt”
SSLCertificateKeyFile “/opt/bitnami/apache2/conf/bitnami/certs/server.key” <Directory “/opt/bitnami/projects/booking/public”>
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride All
Require all granted

Hi @chanthorn2010

Thanks for sharing it! I cannot see anything wrong with the files you shared. Does the directory /opt/bitnami/projects/booking/public exist?

Could you please run the following commands:

sudo ls -la /opt/bitnami/projects/booking/public
sudo ls -la /opt/bitnami/apache2/conf/bitnami/certs/server.crt
sudo ls -la /opt/bitnami/apache2/conf/bitnami/certs/server.key

Additionally, try to add those files again and start the apache server. If the service fails to start, please run the following command and share the output:

sudo apachectl -t
sudo tail -n 30  /opt/bitnami/apache2/logs/error_log

Again, it would be nice if you could also execute the bnsupport-tool

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

1 Like

Thanks jcarmona, it works now. Thanks a lot.

Glad to see you were able to solve your issue! We are marking the previous answer as “Solution” and this topic as “Closed”.

If you have any other questions, please do not hesitate to let us know. Feel free to create a new topic referencing this one if necessary.

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.