orion wrote:You can change those ports under ADM. ADM web -> Settings -> General (that's ADM web server) and ADM web -> Services -> Web server (that's apache).
Doesn't work. As soon as apache stops using 80/443 then something starts 'myhttpd' with it attached to those ports:
- Code: Select all
admin@nas:/etc/init.d $ sudo netstat -ntulp | grep 443
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 4100/myhttpd
admin@nas:/etc/init.d $ cat /proc/4100/cmdline
/usr/sbin/myhttpd-t1-p8001
If you look at the help for myhttpd then you see:
- Code: Select all
admin@CorrosionOfCode:/etc/init.d $ myhttpd
Usage:
httpd -t type -p port
type : 0(http), 1(https)
So the process that called "myhttpd -t1 -p8001" is what we need to find and kill...
If I start apache with ports 80/443 enabled then that process is killed, but now apache is using those ports. Even if apache is running, but on different ports, then something starts that process as soon as those ports are freed from apache.
I thought it was
- Code: Select all
/etc/init.d/S44httpredir
doing it, but I'm unsure now... And in any case, that service is restored when the nas reboots.
The library 'libservice' calls 'myhttpd' in a few ways, and that lib is linked to by various things in the webman.
- Code: Select all
./lib/libservice.so.0:135995:/usr/sbin/myhttpd -t %d -p %d
./lib/libservice.so.0:136002:/usr/bin/killall -TERM myhttpd>/dev/null 2>&1
./lib/libservice.so.0:136005:/usr/bin/killall -9 myhttpd>/dev/null 2>&1
./lib/libservice.so:135995:/usr/sbin/myhttpd -t %d -p %d
./lib/libservice.so:136002:/usr/bin/killall -TERM myhttpd>/dev/null 2>&1
./lib/libservice.so:136005:/usr/bin/killall -9 myhttpd>/dev/null 2>&1
./lib/libservice.so.0.0:135995:/usr/sbin/myhttpd -t %d -p %d
./lib/libservice.so.0.0:136002:/usr/bin/killall -TERM myhttpd>/dev/null 2>&1
./lib/libservice.so.0.0:136005:/usr/bin/killall -9 myhttpd>/dev/null 2>&1
- Code: Select all
./bin/lighttpdutil:1078:libservice.so
./webman/initial/sysreset.cgi:1402:libservice.so
./webman/initial/initial.cgi:3658:libservice.so
./lib/libservice.so.0:33733:libservice.so
./lib/libplugin.so:2384:libservice.so
./lib/libbuiltin.so.0.0:11025:libservice.so
./lib/libnasman.so.0:32123:libservice.so
./lib/libnasman.so.0.0:32123:libservice.so
./lib/libplugin.so.0:2384:libservice.so
./lib/libservice.so:33733:libservice.so
./lib/libbuiltin.so:11025:libservice.so
./lib/libplugin.so.0.0:2384:libservice.so
./lib/libbuiltin.so.0:11025:libservice.so
./lib/libnasman.so:32123:libservice.so
./lib/security/pam_google_authenticator.so:1759:libservice.so
./lib/libservice.so.0.0:33733:libservice.so
./sbin/httpredir:840:libservice.so
./sbin/recybind:1755:libservice.so
./sbin/nasmand:3057:libservice.so
./sbin/sftpmand:3425:libservice.so
./sbin/stormand:4836:libservice.so
./sbin/hostmand:3991:libservice.so
./sbin/logmand:2375:libservice.so
./sbin/netmand:2925:libservice.so
./sbin/dhcpserverctrl:1142:libservice.so
Bit hard to trace further without using a hex reader since the calls that actually call the function that starts myhttpd will be symbols (need nm/readelf/objdump to read them).
I've ended up using the router config to route ports from outside, and a redirect in the apache web root to redirect internal. But still, what a pain in the bottom it is not being able to claim those ports for other services.