Change the default port number for go server

7,839 views
Skip to first unread message

tvijay

unread,
Dec 29, 2014, 1:42:54 AM12/29/14
to go...@googlegroups.com
I had been using GO CD server installed on Windows server platform and running on default port 8153 and now i want to change the port.
So is there any config where i can change the port number directly and restart the GO server. Of course i would have update all the running AGENTS also with the latest configuration.

Md. Ali Ejaz

unread,
Dec 29, 2014, 3:39:45 AM12/29/14
to tvijay, go...@googlegroups.com
You cannot change this port. All the Go server and agent communication happens over this port. Well, to be exact, the initial handshake during agent registration on 8153, and then further communication over 8154.

I would like to know the use case on why you would want to change the port? Would configuring a proxy solve your problem?

On Mon, Dec 29, 2014 at 12:12 PM, tvijay <taru...@gmail.com> wrote:
I had been using GO CD server installed on Windows server platform and running on default port 8153 and now i want to change the port.
So is there any config where i can change the port number directly and restart the GO server. Of course i would have update all the running AGENTS also with the latest configuration.

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
- Ali
@mdaliejaz

tvijay

unread,
Dec 29, 2014, 4:38:24 AM12/29/14
to go...@googlegroups.com, taru...@gmail.com
Thanks for the quick response.
Do you want to say that there is no way to change the PORT once installed (possible only if we re-install the server and agent).

I thought there would be simple configuration and change to that will be in effect the next time server starts, same sort of config for the agents too .

Please confirm/correct my understanding as mentioned that will really help me to describe the exact problem.

Md. Ali Ejaz

unread,
Dec 29, 2014, 6:54:54 AM12/29/14
to tvijay, go...@googlegroups.com
The agent server communication is bound on these ports. So you cannot change them.

Kief Morris

unread,
Dec 29, 2014, 7:07:49 AM12/29/14
to Md. Ali Ejaz, tvijay, go...@googlegroups.com

You can change the ports by reconfiguring them on the server and the agents. As long as they match it will work.

On Linux this is done by editing /etc/defaults/go-[server|agent]. I don't know how it's done on windows, I'm sure a bit of poking around in the docs should find the answer.

Md. Ali Ejaz

unread,
Dec 30, 2014, 5:13:26 AM12/30/14
to Kief Morris, tvijay, go...@googlegroups.com
Sorry, my bad. Thanks Kief :) I myself run one server on port 8253/8254, but somehow this slipped off my mind!

You can change the PORT by changing the "GO_SERVER_PORT"  (for HTTP) and "GO_SERVER_SSL_PORT" (for HTTPS) environment variables on the server, and "GO_SERVER_PORT" (for HTTP) on the agent. The port for HTTPS on agent is communicated by server to the agent, you need not provide it.

Following are the locations of the file you would need to change:
Linux: /etc/default/go-server & /etc/default/go-agent
Zip: server.sh & agent.sh
Windows: wrapper-server.conf & wrapper-agent.conf (in config directory of respective installations)

After changing the port numbers just restart the server and agents, and it should work.
One thing to keep in mind is wrapper-[server|agent].conf gets overwritten on upgrades. As such I would recommend using wrapper-properties.conf for setting these properties.

tvijay

unread,
Dec 31, 2014, 9:21:32 AM12/31/14
to go...@googlegroups.com, kmo...@thoughtworks.com, taru...@gmail.com
Thanks Kief, Ali.

Worked.

tvijay

unread,
Jan 1, 2015, 4:48:12 AM1/1/15
to go...@googlegroups.com, kmo...@thoughtworks.com, taru...@gmail.com
Is there anything else that needs to be configured since after restarting the server and agent on port other default.

but when i click any pipeline name to show it build history it gives me a blank page (please see attached screenshot). 

tvijay

unread,
Jan 1, 2015, 5:13:17 AM1/1/15
to go...@googlegroups.com, kmo...@thoughtworks.com, taru...@gmail.com
Is there anything else that needs to be configured since after restarting the server and agent on non-default port build history for the pipeline is not visible, it shows a loading image only. please see the image attached in last comment

tvijay

unread,
Jan 1, 2015, 1:40:58 PM1/1/15
to go...@googlegroups.com, kmo...@thoughtworks.com, taru...@gmail.com
 
Its working fine.. firewall was blocking something.. disabled fire wall on system and it worked well.
Thanks for the support.

Just one suggestion:
@Ali: Why such things(changing port) are not documented somewhere.

Md. Ali Ejaz

unread,
Jan 2, 2015, 12:42:50 AM1/2/15
to tvijay, go...@googlegroups.com, Kief Morris
Just one suggestion:
@Ali: Why such things(changing port) are not documented somewhere.

I think this got missed. It should be documented. I'll add it. Or you can send a PR :)
If you plan on sending a PR, it could be added somewhere here. May be a new file?
Thanks for pointing it out.

Srihari Bobilla

unread,
Jul 12, 2016, 11:13:52 PM7/12/16
to go-cd
Hello Folks!

I need some help on the same issue with changing go-server port. When I tried to change the default port#s to http#80/https#443, I am seeing following error in logs. I wonder if any one run into this kind of issue before. Appreciate your help!

2016-07-13 03:09:03,680  WARN [main] AbstractLifeCycle:212 - FAILED org.eclipse.jetty.server.Server@1b9e1916: MultiException[java.net.SocketException: Permission denied, java.net.SocketException: Permission denied]
MultiException[java.net.SocketException: Permission denied, java.net.SocketException: Permission denied]
        at org.eclipse.jetty.server.Server.doStart(Server.java:329)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at com.thoughtworks.go.server.Jetty9Server.start(Jetty9Server.java:89)
        at com.thoughtworks.go.server.GoServer.startServer(GoServer.java:72)
        at com.thoughtworks.go.server.GoServer.go(GoServer.java:64)
        at com.thoughtworks.go.server.util.GoLauncher.main(GoLauncher.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.simontuffs.onejar.Boot.run(Boot.java:306)
        at com.simontuffs.onejar.Boot.main(Boot.java:159)

Zabil C M

unread,
Jul 13, 2016, 1:14:28 AM7/13/16
to go-cd
This happens when you try accessing ports 80/443 as a non root user.
 
Have you  tried setting up a proxy instead?


--
Reply all
Reply to author
Forward
0 new messages