Map multiple domains to single karaf instance - amazon-web-services

I have created a server in AWS with Ubuntu installation. I have 3 domains with me. Now I want to host all three domains in that same server in the same Karaf instance. Just like we can do it in Apache Tomcat using Host tag in some configuration XML file.
I have already installed Karaf on the server, installed webconsole to test the configuration in the beginning.
Update
Due to the confusion factor, I am adding an image to explain what I want to achieve.

Karaf uses Jetty (assuming you've installed pax-http feature). Jetty is configured in your <KARAF_HOME>/etc/jetty.xml where you can add virtual hosts. Jetty's documentation regarding virtual hosts is here.

Related

Deploying LB4 appplication on Apache server

I have tried deploying my Loopback 4 application on Apache running on a CentOS 7 server. I followed the instructions given here for Nginx but the proxy pass through is not working on Apache. Is there any documentation on how to deploy a LB4 application on Apache?
This is not a complete answer as there was no response on the equivilent GitHub issue to better understand the user requirements.
The official Apache 2 docs This should be a good starting point to mapping NGINX's configuration to Apache 2.

Can't connect remote jetty ajp service

How can I allow public access to jetty-ajp service? I am able to connect locally ajp://localhost:8009/ but not from a remote node using schema ajp://192.168.2.1:8009/ . I achieved it with port forwarding but want to know if there is an another way.
Thanks,
AJP is not supported by Eclipse Jetty.
If you must use Apache Httpd as a front end of Eclipse Jetty, know that the Eclipse Jetty project recommends using the mod_proxy services of Apache Httpd.
See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=425244
https://github.com/eclipse/jetty.project/issues/134
If you are running an older version of Jetty that had AJP support, know that all of those versions are now EOL (End of Life).
https://www.eclipse.org/jetty/documentation/current/what-jetty-version.html

Installing beaker server

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.

How to configure Elastic IP with django app in aws?

I am building an app using django in EC2-ubuntu and i have associated Elastic ip with my instance.
i have done following steps :
1. first created instance of ubuntu in ec2 free tier.
2. installed python.
3. installed pip.
4. installed django.
5. create a django project using django-admin startproject.
6. run server using these commads python manage.py runserver 0.0.0.0:80
7. created an elastic ip and associated to the instance.
8. configure security inbound settings with http 0.0.0.0:80 address.
9. able to ping my project using any browser.
But the problem is when i am closing my putty session where i supplied runserver command, django project is also stopped. i did not stop it manually.
Please, help me to keep on running after closing putty session as well.
Thanks,
Kripa Sharma
Take a look at this Answer
I highly recommend that you start using Elastic Beanstalk (Python instance) to take care of all these steps for you. Very simple to setup, and no need to worry about any of the steps you listed.
You can use this instruction to see how you can deploy a Django app in less than 5 minutes.
The problem
You are trying to persist the debug server for a remotely deployed application.
You probably need to review the runserver command documentation. Here are the relevant parts:
django-admin runserver [addrport]
Starts a lightweight development Web server on the local machine. By default, the server runs on port 8000 on the IP address 127.0.0.1. You can pass in an IP address and port number explicitly.
...
DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making Web frameworks, not Web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)
A webserver
Having skimmed the above docs, you may want to look at "How to deploy with WSGI" section, which gives a few recommendations for commonly used Web servers. My favorite, Gunicorn, includes a usage example:
$ pip install gunicorn
$ gunicorn myproject.wsgi
Having decided, and installed a webserver, you'd need to "daemonize" it and expose it to the world.
The former is usually done by creating a service on your OS, for ubuntu it would be either upstart or systemd depending on the version. Gunicorn docs have examples for both.
The latter is usually achieved with an http-server/proxy such as nginx or apache httpd. And again, Gunicorn has an example for us.
You can see why I like it so much ☺️
Epilogue
While technically possible to run the debug server as a service or even in a terminal multiplexer such as GNU screen or tmux, it's not a recommended or stable long term solution.
That said, these are very useful to know about, so read on the above tools and learn to use them, since they would be invaluable to have in your toolset in the future, for example to avoid accidentally terminating a long running command (such as migration), etc.

deploy bitnami django

I am quite computer-illiterate, but I have managed to utilize the Django framework on my own machine. I have had an account on Amazon Web Service (AWS) for some time, but it appeared rather complex to set-up and to make use of, so I put it of for a while. Then I decided to give it a try, and it was not so hard as I first thought to load a AMI and connect to the server with PuTTY. But since I were already using BitNami's Django-Stack, I decided to take a look at their hosting offer (which builds on AWS). Since they appeared to offer "one-click deployment", I set up a new server through their interface. But then, it seems like the "one-click deployment"-promise is with regard to the server itself. There does not seem to be any interface for deploying Django projects through their site. Having used PuTTY already, and adding WinSCP to my machine, I can acceess the server and load my Django-code unto the server. But then I am lost. The documentation seems a bit thin (look here).
The crux of this is the following: Can anyone make this part of the process more understandable. I.e., how to deploy a Django project on a Linux server with Apache/mod_WSGI?
The other question is: I want to use Postgres. Am I free to install this on the server. Should I opt for EBM (EMB?) for this, or what is the downside of not having EBM?
I hope I am not too unworthy of your attention, thanks!
how to deploy a Django project on a Linux server with Apache/mod_WSGI The Bitnami AMI already comes with all this configured. Once installed try going to the EC2 public url on the default 8000 port and you will see the demo django project setup there. You can add your own project once you have logged into the machine via putty check the /home/bitnami/ directory for the demo project. Copy your project, configure your database The other question is: I want to use Postgres. Am I free to install this on the server Postgres and Mysql are already installed the same way you would do on your local machine. The in your project do ./manage.py runserver 0.0.0.0:9000 since the 8000 port is already running another application.