17

Under Eclipse Ganymede how can I re-configure the default server port (8080) of the Eclipse WTP "HTTP Preview Server"?

@Leonel

I suppose you never saw the "view" linked to this question, I asked "HTTP Preview Server", not other server views where the port is obviously visible between any other settable option ;-) otherwise I would not have asked on StackOverflow if the real problem was only to search between form settings

@Leonel

Tnx for your reliability, it's not a common virtue in these days ;), in fact as read I'd like to know if there is some hidden configurable param :p

Steel Plume
  • 2,260
  • 3
  • 26
  • 35

4 Answers4

47

HTTP and J2EE Preview servers can be used as well, but as you have discovered, there isn't any UI to change the port used if there is a conflict. However, you can change it manually.

  1. Go into your workspace directory and open the file .metadata.plugins\org.eclipse.wst.server.core\servers.xml into a text editor or using File > Open File... in Eclipse.
  2. Find the <server> element for the Preview server in question and add a port attribute, e.g. port="8181".
  3. Restart Eclipse to pickup the change.
timgeb
  • 76,762
  • 20
  • 123
  • 145
Andres Rios
  • 471
  • 4
  • 3
1

Assuming you want to change the port for one server configuration, try this: open the configuration double-clicking the desired server on the list of servers (menu option Window/Show View/Servers)? There is a group named Ports with a list of ports. I think you want to change HTTP/1.1 (to edit it, click the port number. And dont forget to CTRL+s to save it. ;)
EDIT: First, sorry for the lazy reponse. You was right (kinda). I saw it but never used it. I use Jboss, Tomcat or Jerry as server. I created an HTTP Preview and noted that there inst a port to configure.

I ran my server test and eclipse complains

And looking at the help page you notice that you can change it:

The HTTP Preview server is a Hypertext Transfer Protocol (HTTP) embedded test server that is integrated with the workbench. It is intended for preliminary testing and saves you time to download, install, and set up an HTTP server. However, as your static Web project progresses through its development cycle you are encourage to test and run on an external HTTP server. You can use the HTTP Preview server as a convenient way to check for errors before you do a final test on an external HTTP server.

So, i think you cant do it. :(

eddie_cat
  • 2,527
  • 4
  • 25
  • 43
Leonel Martins
  • 2,713
  • 1
  • 21
  • 24
  • 1
    I suppose you never saw the "view" linked to this question, rember I asked "HTTP Preview Server", not other server views where the port is between any settable options ;-) otherwise I would not have asked on StackOverflow for searching on tabs – Steel Plume Apr 15 '09 at 22:43
0

Open Your .metadata where your project is stored on your workspace. brows upto the file path .metadata.plugins\org.eclipse.wst.server.core\servers.xml

open the file servers.xml and in server tag add the attribute port = "any port number". example: server.xml

0

In Eclipse menus , Go to window->show view--> servers

when you get list of server in server tab double click on the server that you have and change the port number manually.

Hope this will solve the problem.

SoSufi
  • 19
  • 1