Somdip Dey
Somdip Dey

Reputation: 3386

Not able to deploy Django app on AWS Lightsail using Apache server based on provided tutorial

I followed the tutorial (https://aws.amazon.com/getting-started/hands-on/deploy-python-application/) on deploying Django website in AWS Lightsail. When I use the

python3 manage.py runserver 0.0.0.0:8000

to deploy the website then it works perfectly and I can access the website at http://AWS.INSTANCE.PUBLIC.IP.ADDRESS:8000

However, if I follow the Host the application using Apache part of the same tutorial, I am getting the following error when I try to access http://AWS.INSTANCE.PUBLIC.IP.ADDRESS:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

How to successfully deploy the Django website/app using Apache on AWS Lightsail instance?

Upvotes: 0

Views: 1373

Answers (1)

headfat
headfat

Reputation: 85

I was able to run Django on lightsail by following the tutorial.

Make sure all paths in bitnami.conf file is correctly configured. Also, you need to retain the below part.

# Let Apache know we're behind a SSL reverse proxy
SetEnvIf X-Forwarded-Proto https HTTPS=on 

This is the part where the tutorial asks to delete but don't delete this part. Below this part, should start.

If you were able to put up the correct paths, you should be able to run Django application on LightSail.

However, there is a bigger problem later on when you try to get HTTPS on lightsail instance;;;

Upvotes: 1

Related Questions