# httpServer app can't link to lighttpd

**URL:** <https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354>\
**Category:** Uncategorized\
**Created:** [August 13, 2020, 5:53pm UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354 "2020-08-13T17:53:15Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [August 13, 2020, 5:53pm UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/1 "2020-08-13T17:53:15Z")

</div>

When started httpServer fails with these messages:

```auto
Aug 13 12:31:54 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[910]/supervisor T=main | app.c CreateFileLink() 2140 | Could not create file '/legato/systems/current/appsWriteable/httpServer/bin/lighttpd'. Read-only file system
Aug 13 12:31:54 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[910]/supervisor T=main | app.c CreateFileLink() 2159 | Failed to create link at '/bin/lighttpd' in app 'httpServer'.

```

Relevant line in httpServer.adef (unmodified):

```auto
requires:
{
    file:
    {
      ....
        /legato/systems/current/apps/httpServer/read-only/bin/lighttpd /app/bin/lighttpd
    }

```

lighttpd is at the specified location on the WP7702 file system. Thanks for any ideas.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 14, 2020, 2:08am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/2 "2020-08-14T02:08:11Z")

</div>

how about changing the required directory like below:

dir:  
{  
/proc / // needed by `app` script, and for listing running processes  
/bin /usr/bin  
/sbin /  
/legato/systems/current/bin /legato/systems/current/  
/legato/systems/current/lib /legato/systems/current/  
/legato/systems/current/apps /legato/systems/current/  
}

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [August 14, 2020, 5:40pm UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/3 "2020-08-14T17:40:49Z")

</div>

Thanks server now runs and displays index.html. Original directory was:

```auto
    dir:
    {
        /proc / // needed by `app` script, and for listing running processes
        /bin /
        /sbin /
        /usr/lib /usr/
        /usr/bin /usr/
        /usr/include /usr/
        /legato/systems/current/bin /legato/systems/current/
        /legato/systems/current/lib /legato/systems/current/
        /legato/systems/current/apps /legato/systems/current/
    }

```

iptables commands for anyone interested:

```auto
iptables -A INPUT -p tcp --dport 8080 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 8080 -m conntrack --ctstate ESTABLISHED -j ACCEPT

```

However clicking on one of the links (to python script) gives “500 - Internal Server Error”. Unable to start script for some reason?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 15, 2020, 1:45am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/4 "2020-08-15T01:45:51Z")

</div>

Where do you run the python script?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 16, 2020, 5:21am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/5 "2020-08-16T05:21:54Z")

</div>

This httpserver should be working on 19.10.0.rc3\_WP76xx.  
Maybe you can give a try on this legato version or above.  
Also please check logread and see if there is SMACK issue.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 17, 2020, 2:44am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/6 "2020-08-17T02:44:48Z")

</div>

I found that you can modify as following to overcome “500 - Internal Server Error”:

dir:  
{  
/proc / // needed by app script, and for listing running processes

/\*  
/bin /usr/bin  
/sbin /  
\*/  
/usr/lib /usr/  
/usr/bin /usr/  
/usr/include /usr/

/legato/systems/current/bin /legato/systems/current/  
/legato/systems/current/lib /legato/systems/current/  
/legato/systems/current/apps /legato/systems/current/  
}

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [August 17, 2020, 7:15pm UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/7 "2020-08-17T19:15:23Z")

</div>

Thanks for the reply, I am still getting that HTTP 500 error message. And when I try to right click and save the .py on my computer it saves a web page with the HTTP 500 message.

I see this log message when I start up httpServer:

```auto
Aug 17 15:06:44 swi-mdm9x28-wp user.notice kernel: [22314.249780] audit: type=1400 audit(1597676804.719:13): lsm=SMACK fn=smack_inode_getattr action=denied subject="app.httpServer" object="admin" requested=r pid=8755 comm="lighttpd" path="pipe:[122222]" dev="pipefs" ino=122222

```

I am building the httpServer under Legato 19.07.0, the WP7702 is running 19.11.0\_293d1395d26f2a2b136ae78fe9885901\_modified. I tried building the httpServer under Legato 19.11.0 but I get this message:

```auto
WARNING: can't open config file: /opt/swi/SWI9X06Y_02.32.02.00/sysroots/x86_64-pokysdk-linux/usr/lib/ssl/openssl.cnf

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 18, 2020, 1:33am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/8 "2020-08-18T01:33:03Z")

</div>

I don’t see problem to run in WP76 FW R13 with legato 19.2 with above modifciation on adef file.  
No HTTP 500 error message is found.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/579784d94feaf3a63ab1c6639dfeeb9f4325b38e.png)

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [August 18, 2020, 4:33pm UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/9 "2020-08-18T16:33:44Z")

</div>

R13 is not released yet for the WP77/ mangOH loads, maybe I will wait and try again then as I do not need this functioning immediately. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [September 29, 2020, 6:37pm UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/10 "2020-09-29T18:37:58Z")

</div>

Rebuilt httpServer using source code from legato-19.07.0/apps/sample/ and installed under red\_wp77xx\_0.6.0.spk and it now works.

```auto
root@swi-mdm9x28-wp:~# cm info
Firmware Version: SWI9X06Y_02.35.02.00 5208b3 jenkins 2020/06/10 00:30:12
...
root@swi-mdm9x28-wp:~# legato version
19.11.2_625c7d1acfd1ca45b2dbe189b4cb1ce7_modified

```

Thanks again, hope this info will be useful.

---

<div class="post-metadata">

**Author:** ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)\
**Post date:** [April 10, 2021, 11:54am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/11 "2021-04-10T11:54:28Z")

</div>

> [@jyijyi](#):
>
> I don’t see problem to run in WP76 FW R13 with legato 19.2 with above modifciation on adef file.  
> No HTTP 500 error message is found.
> 
> ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/579784d94feaf3a63ab1c6639dfeeb9f4325b38e.png)

Sorry for replying to an old thread. But why is the python input from shell() missing? (Date, uptime, Legato version etc.) It’s working when I run the python script from command line but missing on my end as well.  
(My test system is WP7607 with R16.0 and Legato 20.08)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 10, 2021, 12:49pm UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/12 "2021-04-10T12:49:58Z")

</div>

You might run this and see what happens

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/httpServer/pages/diagnostics.sh>

---

<div class="post-metadata">

**Author:** ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)\
**Post date:** [April 12, 2021, 8:48am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/13 "2021-04-12T08:48:26Z")

</div>

Thanks @jyijyi for the fast reply.

I was on branch 20.08 and somehow had not noticed the changes to httpServer 2 months ago.  
Tried the updated files from httpServer master but got “ERR\_CONNECTION\_REFUSED”. Maybe it’s not compatible with legato 20.08 as there are som framework changes in the commit.

Also tried the updated diagnostics.sh wth the 20.08 version of httpServer but I get " 500 - Internal Server Error" when opening diagnostics.sh. Runs ok in command line.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 12, 2021, 9:00am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/14 "2021-04-12T09:00:16Z")

</div>

have you tried to shut down firewall by:

iptables -I INPUT -j ACCEPT

---

<div class="post-metadata">

**Author:** ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)\
**Post date:** [April 12, 2021, 9:06am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/15 "2021-04-12T09:06:39Z")

</div>

Yes, still 500 - Internal Server Error

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 12, 2021, 9:18am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/16 "2021-04-12T09:18:42Z")

</div>

are you using WP76?  
did you change as said above ?

> [@httpServer app can't link to lighttpd](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/6):
>
> I found that you can modify as following to overcome “500 - Internal Server Error”: dir: { /proc / // needed by app script, and for listing running processes /\* /bin /usr/bin /sbin / \*/ /usr/lib /usr/ /usr/bin /usr/ /usr/include /usr/ /legato/systems/current/bin /legato/systems/current/ /legato/systems/current/lib /legato/systems/current/ /legato/systems/current/apps /legato/systems/current/ }

---

<div class="post-metadata">

**Author:** ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)\
**Post date:** [April 12, 2021, 9:41am UTC](https://forum.legato.io/t/httpserver-app-cant-link-to-lighttpd/5354/17 "2021-04-12T09:41:17Z")

</div>

Yes, WP7607.  
Got it working now! 😀  
bin and sbin had to be added again:

> ```
> /proc / // needed by `app` script, and for listing running processes
> /bin /
> /sbin /
> /usr/lib /usr/
> /usr/bin /usr/
> /usr/include /usr/
> /legato/systems/current/bin /legato/systems/current/
> /legato/systems/current/lib /legato/systems/current/
> /legato/systems/current/apps /legato/systems/current/
> 
> ```

Thanks @jyijyi for pointing me in the right direction 👍
