What's new

Configuring a web server on RT-N66U

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

vfrvulcan

Occasional Visitor
I'm trying to get a web server running on my RT-N66U but whatever way I turn I get connection refused when trying to connect to localhost:82

I've updated to the latest alpha firmware for Entware-ng support, uninstalled downloadmaster, installed Entware and lighttpd following the guide at http://www.snbforums.com/threads/tutorial-lighttpd-web-server-with-php-support-through-entware.9310/ and it's updated guide at https://www.hqt.ro/lighttpd-web-server-with-php-support-through-entware-ng/

I've installed lighttpd on port 82 and when I couldn't get that to work (on any port) I installed Nginx with that listening on port 83.

The syslog shows both services failed to start on boot and attempts to restart them fail, with one exception: issuing a start command shows "Starting lighttpd.... done." but still doesn't work locally or from WAN.

lighttpd -t -f lighttpd.conf returns Syntax OK but lighttpd -f returns (Network.c.410) can't bind to port: 80 Address already in use

I have index.html and info.php files in share/www and share/nginx folders, port forwarding set up in gui i/f and iptables entries made in firewall-start.

I'm not from a Linux background so it may be something obvious! lighttpd error log doesn't exist and the only entry in nginx log is
Code:
2015/12/16 19:51:53 [emerg] 1179#0: invalid number of arguments in "fastcgi_param" directive in /opt/etc/nginx/nginx.conf:24

Any help on this would be appreciated.

Aaron

Code:
#lighttpd.conf (all default apart from port #):

server.modules = (
)

server.document-root        = "/opt/share/www"
server.upload-dirs          = ( "/opt/tmp" )
server.errorlog             = "/opt/var/log/lighttpd/error.log"
server.pid-file             = "/opt/var/run/lighttpd.pid"
#server.username             = "http"
#server.groupname            = "www-data"

index-file.names            = ( "index.php", "index.html",
                                "index.htm", "default.htm",
                                "index.lighttpd.html" )

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

### Options that are useful but not always necessary:
#server.chroot               = "/"
#server.port                 = 82
#server.bind                 = "localhost"
#server.tag                  = "lighttpd"
#server.errorlog-use-syslog  = "enable"
#server.network-backend      = "write"

### Use IPv6 if available
#include_shell "/opt/share/lighttpd/use-ipv6.pl"

#dir-listing.encoding        = "utf-8"
#server.dir-listing          = "enable"

include       "/opt/etc/lighttpd/mime.conf"
include_shell "cat /opt/etc/lighttpd/conf.d/*.conf"
Code:
#nginx.conf (all default apart from port #):

user nobody;
worker_processes 1;
events {
worker_connections 64;
}
http {
include mime.types;
default_type application/octet-stream;
server {
listen 83;
server_name localhost;
location / {
root /opt/share/nginx/html;
index index.html index.htm index.php;
}
error_page 500 502 503 504 /50x.html;
location = /opt/share/nginx/50x.html {
root html;
}
location ~ \.php$ {
root /opt/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME ;
include fastcgi_params;
}
}
}

Code:
#firewall-start

#!/bin/sh
#

iptables -I INPUT -p tcp --destination-port 82 -j ACCEPT
iptables -I INPUT -p tcp --destination-port 83 -j ACCEPT
 
You need to uncomment (remove "#" at beginning of line) the port line.

By the way, why are you doing all of this? There has to be a better way than overloading your poor router.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top