Installing beaker server - beaker-testing

I have been trying to install Beaker server on Fedora 26 following the instructions in https://beaker-project.org/docs/admin-guide/installation.html#installing-the-beaker-server.I've done setting up Beaker database and enabling beakerd scheduler, but I'm stuck when I come to the step of configuring the URL for beaker server on Apache (as provided in the link and the image).the instruction i'm stuck on
I'm not sure what is the URL of my Beaker server (where to find it in the config file?). Should I config that URL in /etc/httpd/conf/httpd.conf or /etc/httpd/conf.d/beaker-server.conf? I gave a try on both but all I can manage is displaying the index.html file of the server, not the Beaker server UI as expected. I configured the server name to be the IP of the server since I want to test first before contacting the DNS provider.
Thank you for your help on the matter.

The default /etc/httpd/conf.d/beaker-server.conf file configures the Beaker web application to be served under the path /bkr/. That's this line (and all the related settings):
WSGIScriptAlias /bkr/ /usr/share/bkr/beaker-server.wsgi/bkr/
So you should find Beaker accessible at http://$YOURSERVER/bkr/. That's what the documentation means when it says "the URL configured in Apache".
If you just visit http://$YOURSERVER/ you will indeed see the Apache welcome page because nothing else is configured to be served at the root.

Related

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 you#example.com 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?
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;;;

Trying to deploy Django on SiteGround

I am trying to deploy a Django app on Siteground through SSH. I have transferred all the files through Filezilla. Everything is setup.
I have developed several apps on AWS using ubuntu. But in siteground Fedora OS is provided in SSH, I am not familiar with that much. I can't have superuser privileges.
Running my Django server on port 8000:
python manage.py runserver 0.0.0.0:8000
Host name is already added in ALLOWED_HOST of setting.py:
ALLOWED_HOSTS = ["himeshp7.sg-host.com","*"]
The server is running in SSH, but I am unable to open my web app on the browser. In AWS we get the option to enable ports in Security Groups, but I couldn't find anything like that on Siteground, I also talked with customer care but they are telling to upgrade, I still doubt that if it will work or not after that as I couldn't find anything proper for deploying Django on Siteground.
You need to add your server ip address to ALLOWED_HOSTS and do python manage.py runserver <your_server_ip_address>:8000 to simply run your app in Debug mode. (Replace <your_server_ip_address>). You can then access your app over port 8000
To host your app in production you need to do further more than running the app through command like installing WSGI HTTP Server, configuring to run your app on port 80 or some other port, etc.
Amazon AWS has UI for most of the things so that you could easily enable ports and such other things. This is not the case of other hosting providers.
Unless you don't have the sudo privileges there are no options to run Django app in shared hosting. Hosting providers that gives SSH/terminal access for shared hosting will not give sudo privileges for security reasons. You should be having a VPS/Dedicated account for that which costs higher to have higher control over your server.
Why do I need sudo privileges ?
You may need to install additional packages/dependencies.
To add additional apache/nginx config for your domain. etc
Otherwise you can go for hosting providers where they provide additonal "Setup Python App" in "Software" section in CPanel for their Shared Hosting Plans. You don't need to worry about server configuration.
There are many providers that gives this option in their Shared Hosting. Two of such providers that I know of:
namecheap refer
a2hosting refer
Based on the exp that I had on deploying python app on Hostgator VPS link.

Django API works locally but not when deployed on Elastic Beanstalk

I'm working with Django Rest Framework and Django Rest Framework JWT, but I'm running into an issue in regards to local behavior vs external behavior.
When I make a POST request to get a JWT token, everything works as desired both locally and on my EC2 instance. However, once I have the token, when I make a request to my server that requires authentication, only my local server returns the expected response. On my deployed server, I get the following error:
{"detail":"Authentication credentials were not provided."}
What I've tried so far:
Editing http.conf by sshing into my server and enabling WSGIPathAuthorization. (saw a similar post here and tried the solution)
What could be causing this behavior? My local machine and my deployed code are identical, leading me to believe that this has something to do with server-side configuration.
All help is appreciated. Thanks!
You mentioned ElasticBeanstalk.
You can add this to your container commands which will be executed during deployment.
01_wsgipass:
command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'
Simply restarting Apache after enabling WSGPPathAuthorization fixed my error. For those of you who encounter something similar, here's what I did:
SSH into the server
Navigate to where your http.conf file is stored (in Apache, this is usually
etc/httpd/http.conf)
Edit http.conf, adding WSGIPathAuthorization On.
Restart Apache by running sudo service httpd restart.
This problem usually occurs when you do configure wsgi with apache on EC2 instance.
Bascially its the problem in apache configuration,
it has nothing to do with AWS EC2.
As apache bydefault do not process Authorization headers, so in order to make that happen we need to configure its files.
For ubuntu
cd /etc/apache2/apache2.conf
paste the following line
WSGIPassAuthorization On

Django's development server on Ubuntu not accessible via browser, only via -curl

I am trying to set up a Django website on an Ubuntu server hosted on DigitalOcean.
After following the step-by-step DigitalOcean tutorial here: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
I remain stuck as I cannot seem to access Django's development server launched on 0.0.0:8000 with the browser of my local machine. However, I do have a response using -curl from the server's bash terminal. So it seems it can only be accessed from the server itself. Django does not return any error while launching the development server. It lists successful connections (code 200) every time I access it via -curl, but does not show anything when I try to access it via my external browser, as if it is actually not being acecssed.
What I did:
followed this tutorial step-by-step until the launch of Django's development server,
disabled Ubuntu's firewall and no DO firewall is used
added '*' in ALLOWED_HOSTS in settings.py
Any ideas? Thank you very much!

ubuntu django and apache, cannot find the site

I am brand new to web app development and thought I would try django as I am familiar with python. I followed the following guide: http://www.lennu.net/2012/05/14/django-deployement-installation-to-ubuntu-12-dot-04-server/ to deploy a django page to the letter. However, I now realize that this guide was for the server version of the OD and i'm running the desktop version. When I try to open my site in chrome (amitash.r) it fails with a page not found. Now when I open localhost, I get an internal server 500 error. All my config files are exactly as stated in the guide. Any fixes?
Can you post your mod_wsgi script and Apache VirtualHost file?
Following the instructions from the link you gave, the mod_wsgi script should be in:
/srv/my_project/app/conf/apache/django.wsgi
The VirtualHost file location from the link should be:
/etc/apache2/sites-available/DOMAIN
Make sure you enabled your site. If you named your file DOMAIN, like the instructions, you should enable the site using:
a2ensite DOMAIN