Multiple Tomcat sessions on Windows Server - windows

I've been asked to put together a Tomcat webserver on a Windows server that can host numerous instances of an application for our development, UAT, training and sandboxes systems. We had them all running on one instance of Tomcat 7 however that was causing the application to crash due to the number of them running and made it hard to update just one environment without bringing them all down. These sites are all internal use only and not public facing so we are using short DNS names to reach the sites.
What I am planning to do now is have multiple sessions that are started using batch files which is working apart from the fact that to reach the sites I have use the full IP, port number and directory name. If I try to access the sites using the short name it displays the main Tomcat sessions default page (running on port 80).
What I am hoping to do is have it so when we use the short name it redirects to the correct session (example below using 127.0.0.1 as an example IP address)
Typing site1 should redirect to 127.0.0.1:8081/site1
Typing site2 should redirect to 127.0.0.1:8081/site2
Typing site3 should redirect to 127.0.0.1:8082/site3

Related

Hosting multiple websites on the same IP address (different machines)

So, my setup is:
Windows server - Already hosting a website in IIS (web1.example1.com)
Windows 10 PC - Want to host another website using Xampp (web2.example2.com)
I don't own either of these domain names, only the subdomains (not sure if this matters)
I have got this to work by setting up another site in IIS then using a reverse-proxy, however, I ran into a problem using this method. I'm using Laravel on my windows 10 PC, and I when try to access my resources it uses my internal IP rather than the domain name (therefore doesn't work externally). I can get around this by using URL::forceRootUrl() in my routes/web.php however then I can't redirect to other sites (need to use OAuth).
I have tried searching around for solutions that will let me use both of these, but I'm starting to think using a reverse-proxy just isn't going to work for what I want.

How to access an Orchard multi-tenant site externally on the same network

I've got multi tenancy set up on my Windows 7 machine using Orchard 7.1 and IIS 6.1 which I can access locally no problem.
They relevant sites are all added within the bindings of the applicationhost.config file, as well as the computers' host file and therefore show up as they should by accessing the url.
I have previously had a single tenant set up on my machine that meant I could access on my network, which was done by adding the site to IIS then binding to localhost/my ip address etc.
However the issue I am having is how to access these sites via a mobile device/another computer (on the same network) now that I have set it up for multiple tenants.
Any help appreciated
Liam
You'd need some sort of naming service inside your network, something like Bonjour.
Short of that, I guess you'd have to configure those other machines one by one so their hosts files point to the server.
One final possible possibility may be to simply use DNS. There is no reason why you couldn't use a domain that you control to map several names to local addresses such as that of your server.

SONAR not working on Web Browser

I am trying to access Sonar through web browser. I already started it on my terminal but when I try to access it on web browser through , it shows nothing. However, the status shows Sonar is running. How can I make it running on the web browser ?
The configuration for Sonar web is:
sonar.web.host=127.0.0.1
sonar.web.context=/sonar
sonar.web.port=9000
sonar.web.host=127.0.0.1
I think this is the problematic line in your conf. This line indicates which IP address the Web Server will bind to. If you set it to 127.0.0.1, then Server will only respond if you reach to it through the IP 127.0.0.1, that is, you'll only be able to access it from localhost, though IPv4. (Your browser will probably prefer IPv6, with ::1 being the host)
Comment out the line (prepending a #) in order to have it listen to every IP the machine is called by.
If you can verify access from the host machine itself, but the above doesn't help, then you might want to check if your firewall is blocking requests.
With the settings you provided, make sure you're using this URL and trying to access the server from the same box: http://127.0.0.1:9000/sonar/
If you're attempting to reach http://127.0.0.1:9000/ and getting the empty page, it's due to the sonar.web.context value you're using.
Note: unless you're hosting SonarQube in an external webserver, you don't need to set the sonar.web.context, in which case, you would just go to http://127.0.0.1:9000/
If this URL isn't working for you, I would suggest looking at the SonarQube server logs in the /logs folder to determine if there were any errors starting the server. If so, you'll want to update this posting with the details from the log, including which operating system you're running.

Slow access to Tomcat web application from another PC

The access to my web application running Windows 2008 Server on localhost is fast; however, when I tried to access the web application through another PC (exp: http://xxx.xxx.xxx.xx:8080/appname) is takes about one minute to load a simple login page. Any input regarding this matter is much appreciated.
Further information, the firewall is already off and the setup within a LAN environment without Internet access.
With this little information it is almost impossible to debug your situation. However, I'll take a guess based on what you've provided.
If you're running on an internal LAN, the problem is likely that you don't have reverse DNS configured for your server. Your server has some made-up name for which only forward-DNS exists. When Tomcat receives a request it tries to look up the hostname based on the IP address, and this can take a long time to time-out.

Different domains to different pages in IIS7

I have a Default Web Site and another web application (let's call it Application2) inside the Default Web Site in IIS7.
I have 2 registered domain names, let's say www.example.com and www.example.net.
I would like to configure things that when I open www.example.com I get Default Web Site, when I open www.example.net I get Default Web Site/Application2.
www.example.com -> Default Web Site
www.example.net -> Default Web Site/Application2
How can I do that?
First you need to decide if your going to use Name Based or IP Based hosting.
IP-Based uses unique ip's to determine which virtual host it will serve and Name Based will actually use the host header which is sent by your client browser.
So let's see two scenarios:
Scenario # 1 (ONE IP TO SHARE)
You have a server with only one IP, could be either private or public as long as the domains you are serving are properly configured in the dns serving you internally or your client externally (NAT).
I suggest that for the sake of this tutorial you stop the default website. Ok.
You will set up one site in II7 and name it accordingly. Go to the right hand side of the manager and look for "Bindings" under actions menu; making sure you have the new site selected on your left pane. Now under "Site Bindings" select the ip address you will be sharing between the sites (name based hosting). Under "Hostname" enter domain # 1 "www.example.com", hit ok.
Follow the same procedure above with the other domain or domains, making sure they have diferent hostnames and same ip's.
That's it. You will now be able to start those sites and run them at the same time.
The same principle above applies if your using the "Default Site". "Default Site" is just a name MS gave the default created one.
Scenario # 2 (MULTIPLE IP TO SHARE)
If you have either some private or public ip to spare, or at least until you do the exercise the only diference here is that sites you will set up and don't have to specify the "Hostname" per each site, as this is basically done in the DNS zones itself. The sites will respond for any request made to those ip's on port 80 regardless.
When will you need to use multiple Ip's to serve websites. Well it all depends.
Some reasons are: Network Isolation (Security), Applications which don't work well under name based hosting, SSL Certificates Bindings 443(PRE II7), and mostly complete control over site. There are of course more reasons, but I'll let others write a bit also.
Have fun.
Edit... upon further investigation I found that if you can set up multiple sites and run them simultaneously. Just need to stop and start the sites after setting the host values to get them to both run at the same time.
Original post:
The straight-forward way to do this would be to add another application by opening IIS and right-clicking Sites then select Add Web Site. In there you can specify the physical path of Application2 and also set the "host" to "www.example.net" which will filter all those requests to your second site. Any requests that don't match "www.example.net" will still go to the default web site.
That approach will work fine on Windows Server using IIS, but on Vista's IIS7 it won't work since you can only have one site running at a time. To start the second site, you'd first have to stop Default Web Site.

Resources