Showing posts with label Java Server. Show all posts
Showing posts with label Java Server. Show all posts

Thursday, 7 May 2015

Deploying Java Web Application on AppFog - FREE Cloud Hosting Account


What is AppFog?
If you don’t have an account with AppFog yet, you can create one from here – easiest signup process. You will have an active account in seconds!
appfog free cloud hosting account signup
Sign into your AppFog account and from top menu click on “Create App” or from bottom click on “New App”
appfog home page
Choose an application type:
appfog - new app - step one - choose an application
Choose infrastructure type:
appfog - new app - step two - choose an infrastructure
Go to Apps details page and Download Source Code:
appfog - app - details
Unzip source code at a location on your local machine.
{ If you have not installed Ruby and “af” RubyGem, install it now – How to Install Ruby and “af” RubyGem }
Start Command Prompt with Ruby:
appfog - run af command line tool
appfog - af - command line utility
Run login command : ‘af login’
‘cd’ to your project directory
Run update command to synchronize your remote project with your local one.
appfog - af - update
All your local files will be packaged and uploaded to your remote cloud space.
appfog - af - update 2
Go to your AppFog’s App Page and Click on ‘View Live Site’:
appfog - app - view live site
appfog - live site


Related Tag :
FREE Cloud Hosting Account
Deploying Java Web Application on AppFog
how to Deploying Java Web Application on AppFog
how to deploy java web application on AppFog
how to get free cloud hosting account
Read More »

Friday, 1 May 2015

Change Tomcat port numbers in server.xml file

By default, Tomcat is listening on the port number 8080 (for HTTP Connector) and 8009 (for AJP Connector), as shown in the following screenshot of Tomcat’s console when the server is started:



Sometimes, one needs to change these default port numbers because of conflict with other applications or just for convenience, e.g. change HTTP port number from 8080 to 80 in order to type the URL without specifying the number.

It’s very easy to change the port numbers in Tomcat, by doing the following steps:

  • Make sure the server is stopped, or shutdown it if it is running.
  • Open the server.xml file which can be found under TOMCAT_INSTALL_DIR\conf  directory:




  • If we want to change the HTTP port number, search for the following lines: 

<Connector port="8080" protocol="HTTP/1.1"
    connectionTimeout="20000"
              redirectPort="8443" />
  •  Now change the port 8080 to 80: 

<Connector port="80" protocol="HTTP/1.1"
    connectionTimeout="20000"
              redirectPort="8443" />

  •  Save the server.xml file (make sure you have write permission) and restart Tomcat. Now, we can see the HTTP port number gets changed in the console:




Read More »

Change port numbers for Tomcat in Eclipse

By default, Tomcat is configured to listen on the following port numbers:

  • Tomcat admin port: 8005
  • HTTP/1.1: 8080
  • AJP/1.3: 8009

Of course, most of the time we are only interested in the HTTP port number - which is the port we have to type in the URL to access a deployed application, for example:
http://localhost:8080/MyCoolApp
Eclipse allows us to change these port numbers easily with just a click of mouse. In the Servers view, double click on the server name:

That will open a configuration page for Tomcat as follows:

Notice the port numbers are shown in the table on the right. Click to edit, for example:

That will change port number for HTTP from 8080 to 80. Press Ctrl + S to save the change and restart the server. We can spot the change of port number in the Console view:

Now, with port 80 we can remove the port number in the URL:
http://localhost/MyCoolApp
NOTES: Changing the Tomcat’s port numbers in Eclipse does not affect the default Tomcat installation on your computer (outside Eclipse IDE). It is because Eclipse makes a copy of Tomcat configuration in its workspace, by default.
If we notice, there is a node called “Servers” in the Project Explorer/Package Explorer view. Expand this node, we will see:

Under the hood, Eclipse updates the server.xml file when we make change to the port numbers, just like the way we change Tomcat’s port numbers in general.
Read More »