Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WTP HTTP Preview server - How can I re-configure default server port?

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

like image 479
Steel Plume Avatar asked Apr 12 '09 14:04

Steel Plume


People also ask

What is HTTP Preview in Eclipse?

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.


2 Answers

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.
like image 75
Andres Rios Avatar answered Sep 29 '22 14:09

Andres Rios


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. :(

like image 1
Leonel Martins Avatar answered Sep 30 '22 14:09

Leonel Martins