Arduino Forum

Products => Arduino Yún => Topic started by: KenNET on Sep 26, 2013, 08:49 pm

Title: Move config web
Post by: KenNET on Sep 26, 2013, 08:49 pm
Hi,

Is is possible to move the default site (/cgi-bin/luci/webpanel/homepage) to another port, lat say :81

Then I want my webpages on the SD card on the "root" of webserver, not like now "192.168.1.100/sd/mypage.html", I want "192.168.1.100/mypage.html"

And last how do I install PHP on Yun?  I'm not that good with linux.

Thanks!
Title: Re: Move config web
Post by: federicofissore on Sep 26, 2013, 09:08 pm

Hi,

Is is possible to move the default site (/cgi-bin/luci/webpanel/homepage) to another port, lat say :81

Edit file /etc/config/uhttpd, 5th row
Code: [Select]
list listen_http 0.0.0.0:80

Quote

Then I want my webpages on the SD card on the "root" of webserver, not like now "192.168.1.100/sd/mypage.html", I want "192.168.1.100/mypage.html"

Change
Code: [Select]
option home /www accordingly. Beware that your files will be the only one served by the webserver (ie: you'll lose access to the webpanel).

Quote

And last how do I install PHP on Yun?  I'm not that good with linux.

Thanks!


Access the yun via ssh or via the YunSerialTerminal. Be sure it's properly configured to access the internet then type
Code: [Select]
opkg update
opkg install php5-cgi
(or php4 if you prefer)

PS: once you're done with uhttpd configuration, don't forget to restart it:
Code: [Select]
/etc/init.d/uhttpd restart
Title: Re: Move config web
Post by: KenNET on Sep 26, 2013, 09:22 pm
Wow that was fast!

Ok I got PHP working

can I run multiple webservers? Yun admin on port 81, and my with pages from SD on port 80. How do I config that?


Thanks!
Title: Re: Move config web
Post by: federicofissore on Sep 26, 2013, 09:25 pm
I'm not sure that's possible. uhttpd is made for very constrained environments. Maybe google can help
Title: Re: Move config web
Post by: KenNET on Sep 26, 2013, 09:34 pm
I fond this and it works. Just put # on the original settings.

Code: [Select]


# Server configuration
config uhttpd main
    list listen_http    0.0.0.0:80
    option home        /www
    option cgi_prefix     /cgi-bin

config uhttpd secondary
    list listen_http    0.0.0.0:81
    option home        /mnt/sda1/arduino/www/
    option cgi_prefix     /cgi-bin

#

Title: Re: Move config web
Post by: federicofissore on Sep 26, 2013, 10:26 pm
ah, well done. good to know :)