# Restconf in confd

**URL:** <https://dmap-community.ductus.global/t/restconf-in-confd/2786>\
**Category:** Other Northbound Interfaces\
**Created:** [November 16, 2019, 12:57pm UTC](https://dmap-community.ductus.global/t/restconf-in-confd/2786 "2019-11-16T12:57:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsiddagangappa](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dsiddagangappa](https://dmap-community.ductus.global/u/dsiddagangappa)\
**Post date:** [November 16, 2019, 12:57pm UTC](https://dmap-community.ductus.global/t/restconf-in-confd/2786/1 "2019-11-16T12:57:23Z")

</div>

Hi,  
I’m trying to enable restconf in confd. Below is my config in confd.conf.

```
<rest>
<!--CFG_REST--><enabled>false</enabled>
  </rest>
  <restconf>
        <enabled>true</enabled>
        <rootResource>restconf</rootResource>
  </restconf>

  <webui>
      <enabled>true</enabled>
      <transport>
          <tcp>
              <!--CFG_REST--><enabled>false</enabled>
              <ip>127.0.0.1</ip>
              <port>8008</port>
              <extraIpPorts>[::1]</extraIpPorts>
          </tcp>
      </transport>
  </webui>

```

Still, when I send the request. It’s returning below error. I have reloaded the confd also rebooted the machine

```
curl -kisu ‘admin:admin’ -X GET -H "Accept:application/yang-data+xml" https://<ip>/restconf/data/restconf-state
HTTP/1.1 404 Not Found
Date: Sat, 16 Nov 2019 12:59:33 GMT
Server: Apache
Expires: Thu, 01 Jan 1970 05:30:00 GMT
Accept-Ranges: bytes
Last-Modified: Wed, 13 Nov 2019 10:07:44 GMT
Content-Type: text/html
Content-Length: 591
Content-Security-Policy: frame-ancestors 'self'
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Permitted-Cross-Domain-Policies: master-only
Strict-Transport-Security: max-age=31536000, includeSubDomains, preload
Cache-Control: no-cache, no-store, must-revalidate, private
Pragma: no-cache

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>Page Not Found</title>
    <link href="/core/ui/images/favicon.ico" rel="icon" type="image/ico">
    <link href="/core/ui/css/login.css" rel="stylesheet" type="text/css">
</head>
<body>
    <header>
        <div id="header_login"></div>
        <div id="header_app_name">EMA 8.2</div>
    </header>

    <h1>Sorry, there's been an error.</h1>

    <p><a id="login" href=""><-- Back</a></p>
    <script> document.getElementById("login").href="https://"+document.domain; </script>
</body>
</html>

```

Not sure, why this is happening. Any thoughts?

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [November 16, 2019, 1:37pm UTC](https://dmap-community.ductus.global/t/restconf-in-confd/2786/2 "2019-11-16T13:37:38Z")

</div>

You have configured ConfD to listen for tcp connections to 127.0.0.1 port 8008, and then use curl to connect to `https://<ip>/restconf/...`, i.e. an ssl connection to the default port 443 - that’s not likely to work. It seems there is an Apache server running on that port, nothing to do with ConfD.

Try using `http://127.0.0.1:8008/restconf/...` instead (obviously this will only work on the same host where ConfD is running).

---

<div class="post-metadata">

**Author:** ![dsiddagangappa](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dsiddagangappa](https://dmap-community.ductus.global/u/dsiddagangappa)\
**Post date:** [November 17, 2019, 6:57am UTC](https://dmap-community.ductus.global/t/restconf-in-confd/2786/3 "2019-11-17T06:57:08Z")

</div>

@per that TCP connection isn’t enabled.

```
<tcp>
              <!--CFG_REST--><enabled>false</enabled>
              <ip>127.0.0.1</ip>
              <port>8008</port>
              <extraIpPorts>[::1]</extraIpPorts>
          </tcp>

```

and the SSL connection to default port 443 port works fine with REST. It’s not working with RESTCONF.

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [November 17, 2019, 9:03am UTC](https://dmap-community.ductus.global/t/restconf-in-confd/2786/4 "2019-11-17T09:03:27Z")

</div>

> [@dsiddagangappa](#):
>
> @per that TCP connection isn’t enabled.

OK, so you have configured ConfD to not listen on _any_ port, since ssl is disabled by default (and would anyway use port 8888 unless told otherwise).

> [@dsiddagangappa](#):
>
> and the SSL connection to default port 443 port works fine with REST. It’s not working with RESTCONF.

I don’t know what you are running on port 443 - hopefully you do - but as you can see, it identifies itself as “Apache”:

> [@dsiddagangappa](#):
>
> Server: Apache

Is it supposed to run as a proxy in front of ConfD? If so, the problem is likely to be with the proxy configuration.

---

<div class="post-metadata">

**Author:** ![dsiddagangappa](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@dsiddagangappa](https://dmap-community.ductus.global/u/dsiddagangappa)\
**Post date:** [November 18, 2019, 1:30pm UTC](https://dmap-community.ductus.global/t/restconf-in-confd/2786/5 "2019-11-18T13:30:17Z")

</div>

Thanks @per  
I made little progress in this issue.

> [@per](#):
>
> Is it supposed to run as a proxy in front of ConfD? If so, the problem is likely to be with the proxy configuration.

Yes, Apache server is running as a proxy in front of confd.  
As you mentioned it was some configuration miss in Apache server.

Thanks.
