Secured website on Tomcat 7 404 - tomcat7

I have configured an application on Tomcat 7 with BASIC authentication.
In development an Test works fine, but in Production environment I dont´t recive anything. In chrome console I can see a 404 not found error.
But If I execute a curl command I can reach the page.
curl -vv -u username:password http://10.XXX.XXX.21/historia/es/index.jsp
Could anyone helps me?
PS: If I edited Request Header, adding authentication (in Firefox) I recived a 200 status but page appears in white. I don't understand anything.
Thanks in advance!

I think in production you try to connect to service from external network. Try add address "0.0.0.0" to listen to all addresses.
In server.xml try edit like bellow.
<Connector port="8080" protocol="HTTP/1.1"
maxHttpHeaderSize="65536"
connectionTimeout="20000"
redirectPort="8443"
address="0.0.0.0" />
Shutdown and startup the tomcat after that

10.XXX.XXX.21 is private address you can call it from inside the network. You can forward connections to that host, but that is different story. Why you got 404 instead of host-not-found? Well, in that other network, the one with chrome - you can have same ip used.

Related

I am using Window Server 2008 VPS, how to make that when user type the IP address it will go to Tomcat page not IIS page?

I have just bought Godaddy Virtual Private Server plan with Window Server 2008.
I can login VPS Server via Remote Desktop Connection. Each VPS has an IPaddress. when user types my idaddress x.x.x.x it will show the default IIS7 page like this:
Ok, now I downloaded Tomcat7, JRE6 & can be able to see tomcat page at http://localhost:8080/ or x.x.x.x:8080. Now I want that when typing my idaddress x.x.x.x it will show the default Tomcat page rather than IIS7 page.
So here is what I did. I edited C:\tomcat7\conf\server.xml
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" /> //changed port from 8080 to 80
Ok, now when entered x.x.x.x:8080 it showed Unable to connect, when entered x.x.x.x it still shows the IIS7 page.
How to config so that when user types my idaddress x.x.x.x it will show the default Tomcat page rather than IIS7 page?
Extra info: Now I have just turned off World Wide Publishing service in WindowServer, & I expected that when entered x.x.x.x it will show the Tomcat default page but it showed nothing
Ok, i did, so simple just turn off World Wide Publishing service in WindowServer & then change port 8080 in C:\tomcat7\conf\server.xml to 80 & now when typing ipaddress it showed tomcat default page

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.

Worklight Console redirects to port 9080

I am using Websphere Liberty 8.5.5 with IBM HTTP Server 8.5.5 and Worklight Server 6.0.0.1.
I have configured IHS to redirect port 80 to Websphere port 9080.
The redirection works properly for the front page, and entering domain.com/worklight/console directly opens domain.com:9080/worklight/console page. However, when I provide the credentials and click Login, the address bar changes to domain.com:9080/worklight/console page which should not happen as port 9080 is blocked over the firewall.
I have applied the solutions given in this question "Mixed Port Numbers" but still the problem persists.
If I manually remove 9080 from the address bar and press enter, the page opens fine, is it possible that the port 9080 has been hard coded somewhere in the Authentication Console, if yes, where should I make that change?
I used WebSphere Plugin to internally forward the requests on port 80 to WebSphere port 9080.
worklight.properties
publicWorkLightHostname=subdomain.domain.com
publicWorkLightProtocol=http
publicWorkLightPort=
Plugin-Cfg.xml
<VirtualHostGroup Name="default_host"> <VirtualHost Name=":9080"/>
<VirtualHost Name=":80"/> <VirtualHost Name="*:9443"/>
</VirtualHostGroup> <Transport Protocol="http" Port="9080"
Hostname="11.11.11.11"/> <Transport Protocol="https" Port="9443"
Hostname="11.11.11.11">
Appreciate any ideas!
You need edit the server.xml (if you're using Liberty) to modify 2 elements:
jndiName="worklight/publicWorkLightProtocol"
and
jndiName="worklight/publicWorkLightPort"
to make their values same as what defined in worklight properties.
I'm looking at the infocenter, and it looks like Transport is supposed to be wrapped in ServerCluster -> Server.
How did you generate your plugin-cfg.xml?

Cannot load http://localhost/phptest:8080/

I decided to learn HTML so I installed apache on windows vista. Everything seems to work fine; when I go to http://localhost:8080 the sample webpage installed by apache shows. Apache is configured at port 8080.
So far so good. Since my DocumentRoot is c:\pub, I made another folder inside, e.g., c:\pub\test. What I'm trying to figure out is why the page at http://localhost/test:8080 cannot load? It has index.html and apache is working fine.
You are specifying port in the wrong location. The format is:
protocol://domain:port/path
So, try:
http://localhost:8080/test
The port goes right after the host: http://localhost:8080/test
try http://localhost:8080/test

Accessing TEAMCITY from a remote machine

I am having trouble browsing to my team city(JetBrains) from a remote machine. I have followed the install directions and the install went smoothly. I can browse the to application locally on the server, no problem at all. I changed the default server url in the config file to be http://my servername . I can browse to http://my server name and the application shows up no problem locally. The application is alos installed on the default 80 port of the server with no other web server installed.
If I browse to http://my servername from my laptop on the same domian nothing happens. When I run diagnostics it seems to pick up the webserve but it fails to respond.
As a test I uninstalled the app and installed IIS to see if I could browse to the default IIS page remotely. This worked no problems at all. I uninstalled IIS, ensured nothing was hogging port 80 on the server. Reinstalled the applicaiton, configured it exactly the same, still nothing. The application works fine locally, but I get nothing remotely.
I was just wondering if anybody knows anything else I can try? or is there a setting in tomcat I need to tweak?
I just updated TeamCity from 7.0 to 7.1, and now I have the exact same issue.
However, what turned out to be the cause had nothing to do w/ the TeamCity upgrade. It turns out our system administrators had setup a policy update to block all incoming connections other than port 80. When I started my upgrade, I noticed the server wanted to do some system updates. So I let that go first.
I suspect that had I tried to access the TeamCity server after the system update, I'd have realized I could no longer access the website remotely.
But since I only noticed it after the TeamCity update, I assumed it to be the culprit and wasted a bunch of time on that red herring.
The solution for me was to
Open Windows Firewall on the server
Click on the root level option in the left-hand pane
Make sure under each of the profile sections, that inbound connections are allowed.
(#3) was my problem.
Hope this helps someone else out in the future...
Verify that the server is running on port which is not blocked by the firewall. Change the port if necessary.
Tomcat also supports binding to specific IP addresses, in case your machine has multiple IPs, you can configure which one to use in server.xml, like:
<Connector port="80" address="10.10.10.10" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
Where 10.10.10.10 is the IP of the server which can be accessed from the remote machine.
Check the server logs to ensure that it's started on the correct IP/port and is accepting connections.
I just faced the same issue when evaluating TeamCity v10.0.
I solved it by changing the 'Server URL' value with the name of my computer that can be used from remote computer.
As they say, "make sure the server is accessible by the URL specified".
To reach this setting:
- Login to TeamCity interface then
- Click on the 'Administration' link
This is well explained in the TeamCity support page:
https://confluence.jetbrains.com/display/TCD10/Configuring+Server+URL
The problem is that TeamCity's default server.xml has localhost as the host name. You need to add an alias for it answer that name as well, as described here:
http://tomcat.apache.org/tomcat-4.0-doc/config/host.html#Host%20Name%20Aliases
Ryan

Resources