# Gateway restarting is failed, and starting script is not working too, after changing HTTP/HTTPS port from 8080/8043 to 80/443

**URL:** <https://forum.inductiveautomation.com/t/gateway-restarting-is-failed-and-starting-script-is-not-working-too-after-changing-http-https-port-from-8080-8043-to-80-443/79060>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [September 13, 2023, 7:52am UTC](https://forum.inductiveautomation.com/t/gateway-restarting-is-failed-and-starting-script-is-not-working-too-after-changing-http-https-port-from-8080-8043-to-80-443/79060 "2023-09-13T07:52:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![UnSuk\_Song](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@UnSuk\_Song](https://forum.inductiveautomation.com/u/UnSuk_Song)\
**Post date:** [September 13, 2023, 8:35am UTC](https://forum.inductiveautomation.com/t/gateway-restarting-is-failed-and-starting-script-is-not-working-too-after-changing-http-https-port-from-8080-8043-to-80-443/79060/2 "2023-09-13T08:35:48Z")

</div>

Solved it myself by referencing other posts.  
Thanks to those posts and others.

> [@Unable to set port 80 on Ubuntu 20.04](https://forum.inductiveautomation.com/t/unable-to-set-port-80-on-ubuntu-20-04/53307):
>
> Trying to set the default port to 80 on a gateway but getting the following error message: The Entered http port 1-1023 is not allowed by the system. Please enter a different one I am fairly certain its just a linux issue, but I cannot seem to find the command to fix it! I found the following command referenced, but I can’t figure out what the path to ignitions executable is, I tried /usr/local/bin/ignition/ignition-gateway but no luck setcap cap\_net\_bind\_service=ep /path/to/server/executabl…

> [@\[BUG-5735\] Upgrade Bug with AmbientCapabilities](https://forum.inductiveautomation.com/t/bug-5735-upgrade-bug-with-ambientcapabilities/57368):
>
> I upgraded a system from v7.9 to v8.1.15 this morning and ran into an annoyance. The system runs on the default HTTP and HTTPS ports but with the standard “ignition” service user name. This is possible by adding AmbientCapabilities=CAP\_NET\_BIND\_SERVICE to the [Service] section of the SystemD unit file. After upgrade, instead of just running as expected, I was diverted to the ports page of Commissioning. That page was served up from the standard ports, pre-filled with the running values (stan…

**[Causes]**  
Ports 80 and 443 are 'privileged' or 'well-known' ports commonly used at the system level.  
End-user or end-of-life applications cannot bind directly to these ports, **usually requiring administrator privileges(`sudo`)**.  
When Ignition Gateway attempted to bind to these ports, an error such as `Failed to bind to 0.0.0.0/0.0.0.0:80` occurred because it did not have the required privileges.

**[Trouble shooting]**  
On wrapper.log, there are noticeable log in it.

```auto
INFO | jvm 2 | 2023/09/13 15:35:06 | I [g.WebServerManager] [06:35:05]: Starting setup 
INFO | jvm 2 | 2023/09/13 15:35:06 | I [g.WebServerManager] [06:35:05]: Setup complete 
INFO | jvm 2 | 2023/09/13 15:35:06 | I [g.WebServerManager] [06:35:06]: Starting up 
INFO | jvm 2 | 2023/09/13 15:35:06 | I [g.SslManager] [06:35:06]: State refreshed state=SELF_SIGNED_CERTIFICATE
INFO | jvm 2 | 2023/09/13 15:35:06 | I [C.SecureRandomProvider] [06:35:06]: Secure random seed generated in 1ms 
INFO | jvm 2 | 2023/09/13 15:35:06 | I [o.e.j.s.Server] [06:35:06]: jetty-10.0.13; built: 2022-12-07T20:13:20.134Z; git: 1c2636ea05c0ca8de1ffd6ca7f3a98ac084c766d; jvm 11.0.18+10-LTS 
INFO | jvm 2 | 2023/09/13 15:35:06 | WrapperSimpleApp: 
INFO | jvm 2 | 2023/09/13 15:35:06 | WrapperSimpleApp Error: Encountered an error running main:
INFO | jvm 2 | 2023/09/13 15:35:06 | WrapperSimpleApp Error: MultiException[java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:80, java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:443]

```

Judging from these logs, it is clear that I changed the HTTP/HTTPS port caused the error.

Search for forums with these phrase:  
`java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:80`  
`java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:443`.

I found posts above and edited service file on `/etc/systemd/system/Ignition-Gateway.service`.

Add following string: `AmbientCapabilities=CAP_NET_BIND_SERVICE`

```auto
[Unit]
Description=Ignition-Gateway
After=syslog.target

[Service]
Type=forking
ExecStart=/usr/local/bin/ignition/ignition.sh start sysd
ExecStop=/usr/local/bin/ignition/ignition.sh stop sysd
User=fci
KillMode=process
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

```

As this service file is updated, following command is required:  
`sudo systemctl daemon-reload`

Restart the Ignition Gateway again:

```auto
me@myserver:~$ /usr/local/bin/ignition/ignition.sh start
Starting Ignition-Gateway with systemd...
Waiting for Ignition-Gateway...
running: PID:11935

```

Now I can see the process listening on 80/443

```auto
me@myserver:~$ sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 11956 me xxxx IPv6 72669 0t0 TCP *:http (LISTEN)

me@myserver:~$ sudo lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 11956 me xxxx IPv6 72670 0t0 TCP *:https (LISTEN)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/gateway-restarting-is-failed-and-starting-script-is-not-working-too-after-changing-http-https-port-from-8080-8043-to-80-443/79060)._
