Normally, I configured my Tomcat 7 to perform redirect from port 8080 to 8443. Below is the portion of the configuration and everything works as expected.
server.xml
<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443" />
<!-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the
JSSE configuration, when using APR, the connector should be using the OpenSSL
style configuration described in the APR documentation -->
<Connector SSLEnabled="true" clientAuth="false"
keystoreFile="conf/somestore" keystorePass="somekey"
maxThreads="200" port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
scheme="https" secure="true" sslProtocol="TLS" />
Only today, I decided to removed the first connector from configuration. However after I hit start the server button in Eclipse everything seems fine except the message says Starting Tomcat 7 never ends.
and eventually this:
By the way, this issue only appears in Tomcat within Eclipse. Is it possible that Eclipse is still trying to access the application through the old port ? Any pointers is much appreciated.
UPDATED
After I double clicked the server instance, I am only able to see two ports number under Ports section.
Tomcat Admin Port which is 8005
SSL Port which is 8443
I had the same issue. Originally I had both a secure and non-secure port open and when I removed the non-secure connector, I had the same issue with Eclipse saying it failed to start.
I resolved the issue by putting a non-secure connector back in.
I am guessing Eclipse tries to access the application to verify it is running and doesn't handle secure ports very well.
Just goto the tomcat configuration console by double clicking on tomcat under the servers .
Check the port specified there .
If it doesn't help , delete the server and install the tomcat again in eclipse. It only takes a matter of seconds .
Also please try exiting all the tomcat processes from windows and then try to start the tomcat from eclipse once again .
Eclipse makes a copy of the server configuration and saves it under the "Servers" project.
In the Server View, double clic your server name and when configuration window opens you can edit under "Ports" section.
Edited***
You can go further by opening the "Servers" project, then editing server.xml directly looking for the "Connector" tag that holds the current 8080 port.
http://farm8.staticflickr.com/7390/9559799161_3a152c1ac1_o.jpg
Related
I have a domain like www.example.com, I'm using Glassfish, which hosts my application at port 12544.
So I wonder two things :
How can I redirect this www.example.com:12544 to www.example.com ?
And the same way but for https ? I mean, https://www.example.com ?
I am really new to Glassfish any help will be very appreciated.
The best way is to place Glassfish behind Apache http server and configure apache to point requests to glassfish. Therefore http requests are handled by Apache and all www.example.com requests are pointed to www.example.com:12544 internally. Below is a brief explanation of how to do this.
Install Glassfish 3+ (make sure your listener is created and activated on 8009 and your jk is enabled)
Install Apache (2.2+)
get the mod_jk connector and place it into apache modules folder to do the configurations.
create a worker.properties file and place it into apache conf folder. It should contain the following properties:
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
Open httpd.conf file in apache conf folder and place the following commands (outside Virtual Host):
LoadModule jk_module modules/mod_jk.so
#location of the worker file
JkWorkersFile conf/worker.properties
#where to put jk logs
JkLogFile logs/mod_jk.log
#log level [deug/error/info]
JkLogLevel debug
#Log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# Indicate to send SSL KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# Set the request format
JkRequestLogFormat "%w %V %T"
# Send all jsp requests to Glassfish
JkMount /*.jsp worker1
# Send all webapp requests to Glassfish
JkMount /* worker1
You need also to add a VirtualHost section in your conf file. This maps your domain with the path in Glassfish so Apache will be able to see it. The following tells apache to map all /myapp/* links to glassfish
<VirtualHost 111.111.111.111:80>
ServerAdmin admin#domain
ServerName domain
JkMount /myapp/* worker1
</VirtualHost>
Note: if your Glassfish listener is not created you can created from cmd using glassfish asadmin with the following command:
asadmin create-network-listener --protocol http-listener-1 --listenerport 8009 --jkenabled true jk-connector
Restart Apache and Glassfish for the new configurations to be updated. Apache should now see your Glassfish on port 80. So your www.example.com:12544 will be served on www.example.com.
I have a Tomcat instance that is bound to the the IP address of my machine (10.100.10.63) as shown below:-
<Connector address="10.100.10.63" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
I have a RESTful web service developed using Jersey. The web service was created as a Dynamic Web Project using Eclipse and uses a Tomcat 6.0 as the target runtime server.
When I right click on the web service project in Eclipse and select Run As->Run on Server, the server fails to start.
However, when I remove the address binding from server.xml as shown below, the server starts successfully and I am able to use the web service using localhost.
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
How can I deploy the webservice in such a way that I can bind Tomcat to the IP Address of my machine so that it is accessible from other machines in my network as well.
Try changing the engine defaultHost property instead of the address in the connector, in server.xml:
<Engine name="Catalina" defaultHost="10.100.10.63">
<Host name="10.100.10.63" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
in my system i am using eclipse and tomcat server. I hav 3 different versions of tomcat servers.
But i am trying to run only one server at a time. But by default Already one server is running on port number 8080. When i am trying to start the tomcat server in 8081 port, the tomcat server is not getting start.
I have configured my tomcat home, and server.xml in eclipse properly. But I don't know what I am missing. please guide me.
It sounds like you don't have your port numbers defined and each tomcat instance is fighting to grab the port range first before the others.
Check your config file to make sure the port numbers are specified for each instance.
see how to change port in y=tomcat , may be you forgot to change some where
http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/
you can stop another tomcat service before you start your tomcat gets started , end process tomcatX(X is version) from task-manager
I'm trying to write a Servlet in eclipse configured to use Tomcat 5.5 and I get the following error when I try to run it:
Several ports (8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s)
As far as I know, Tomcat 5.5 is the one using port 8080, and when I go to http://localhost:8080 I do get the Tomcat success page, so it looks like eclipse tries to run another instance of Tomcat without shutting down the original and fails. How do I solve this?
like it says, something is using the port.
there are two solutions for your problem.
identify (on windows with netstat command) what is using the port (e.g. skype, ...) and stop it
change the port of your tomcat runtime in eclipse -> http://techteam.wordpress.com/2009/02/13/changing-the-tomcat-port-settings-in-eclipse/
hope this helps
I have used Eclipse 3.4 to create a Dynamic Web Project. I have also configured my server to use port 8443 with ssl. If I start my server I can access my test.jsp by going to it's address
https://localhost:8443/TestContext/test.jsp
In eclipse, I have installed this server and added my project to the server. If I Run test.jsp it always launches as
http://localhost:8080/TestContext/test.jsp
My question is: How can I set up eclipse to run this on https://localhost:8443/ rather than the default 8080? Thanks in advance.
You should have a project called "Servers". There your tomcat should have its folder - for example "Tomcat 6.0.20 at localhost-config". There is server.xml there, in which you can enable SSL.
When you enable the SSL, the server accepts requests on port 8443 as well as on 8080. The server is not run on a port - it accepts connections on multiple ports. So just type https://localhost:8443/