Tomcat6 - 2 wars, 2 hosts - configuration

I have 2 war files app1.war and app2.war.
I have 2 hostnames domain1.com and domain2.com.
I have one desk top running ubuntu and tomcat6.
I would like to know how to configure tomcat to serve app1 for domain1.com and app2 for domain2.com.
Thanks in Advance.

You need apache-httpd in front of your tomcat, then you need to configure the rewrite module.

Related

WSGI path doen't work with Amazon Linux 2

I'm trying to get going with Elastic Beanstalk and Amazon Linux 2. One thing I've noticed is that the WSGI path seems to be a little different.
For a Django app I would usually set <<app_name>>.wsgi.py
Instead, the new way to define it is with a namespace like this. This, however, does not seem to work from the eb config buy only from .ebextensions
<<app_name>>.wsgi:application
I feel like, I'm doing something wrong here or not getting this namespace concept?
Why do I suddenly have to add a namespace?
Since other people may run into this issue.
Here is the fix to my problem:
Amazon Linux 2 uses Gunicorn as it's default webserver. Gunicorn expects a certain syntax when specifying the Path to the WSGI config. This syntax does not only include the path to the file but also the name of the exported function (or class) accepting the WSGI parameters.
This is why you have to use the syntax above.
There are several ways to specify the WSGI path for your project. You can do it via the AWS gui but my recommendation would be to add a Procfile to your project.
My Procfile looks like this:
web: gunicorn --bind :8000 --workers 3 --threads 2 <<my_app>>.wsgi:application

Make served Jekyll project accessible within local network

I'm creating a website locally with Jekyll from my desktop Linux. It's connected to the same router as my other devices, I would like to test the site directly from my android but it's inaccessible.
I also tried to serve the _site directory with darkhttpd and it works, I can access it from android. Is there a way to do that with only Jekyll?
You can do this by starting the server with this:
bundle exec jekyll serve --host 0.0.0.0
You can then access the site locally by going to the servers IP and port 4000. It might look similar to this:
http://192.168.1.100:4000
Source: https://zarino.co.uk/post/jekyll-local-network/

How to setup/configure laravel project on cloud server

I have this laravel application on /var/www/html/application-folder/public_html
When I enter the apache server IP it doesn't load the laravel application instead it displays the Apache home page
How can I display the url /var/www/html/application-folder/public_html ?
When I type the full url I get the following error:
Forbidden
You don't have permission to access /folder/public_html/index.php on this server.
Apache/2.2.15 (CentOS) Server
If you have full root access to your server then you can
Step 1
upload your laravel project from the development machine(local) to the /var/www on your server - upload all folders except vendor and node_modules
Step2
once the project is uploaded, run composer install, if you need any of the node packages run npm install
Step 3
create virtual host for your site with DocumentRoot /var/www/yourProjectFolder/public
Step 4
Ensure storage folder has write permissions for your apache/webserver user - recursively
Step 5
Ensure that public folder has appropriate permissions - recursively, if you have uploaded the project as root then you will need to change the owner/permissions
Following this workflow you will be able to get your Laravel site up and running.
Important distinction to make here is that you have full root access to your server and that you can install composer and/or npm on your server before proceeding with the workflow.
If you can't install composer and/or npm on your server, then you have to upload the vendor directory to your server as well (and if you need any node packages then the node_modules as well) - following the documentation link in my comment above will help you.
Refer Virtual Host on Cent Os 6

phpstorm project folder upload ignore path

I've got a project that has 2 different modules on git which are in two different folders on the server.
Example:
/webClient/this_is_the_root_of_web_client/
/serverSide/this_is_the_root_of_server_side/
I want to upload the client files to Apache root, but it still sent the webClient folder.
I tried to set the webClient folder as resource root, but still got the same result.
Its SOLVED!
I configured 2 mappings:
local Server
--/localPath/projectFolder/webClient/ | /apachePath/
--/localPath/projectFolder/serverSide/ | /serverPath/
And it worked like a charm!
Thanks #LazyOne.

How can I 'hg clone' from another machine?

I have 2 Ubuntu laptops in the same WiFi network. I would like to 'hg clone' from 1 laptop to another.
In my source laptop,
I have a 'hg' repository in ~/work/myserver
and my source laptop ip address inet addr:192.168.1.2.
So what should i do on my dest laptop so that I can clone my hg repository?
Thank you.
Like so:
hg clone ssh://your-user#192.168.1.2//home/my-user/work/myserver/
Note: If you're running a firewall on 192.168.1.2, you'll need to open port 22 for SSH. I believe Ubuntu uses ufw by default.
Note 2: Replace your-user with the user you use to login when you're sitting at 192.168.1.2
My choice between two Linux computers would also be going through ssh, as suggested by Zack.
One alternative that also works on Windows machines is to use the integrated web server to expose your repository, then clone from there.
First you run hg serve that will by default get you a web server on port 8000, then you just hg clone http://machine1:8000, with the added benefit that you get a nice graphical view of your history. (more information here)