General NAS-Central Forums

Welcome to the NAS community
It is currently Tue Jan 16, 2018 5:31 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: lighttp problems
PostPosted: Sat Nov 19, 2011 3:36 pm 
Offline

Joined: Sat May 08, 2010 6:08 pm
Posts: 3
some one now how change the default interface to another port or only for 443, and left free the port 80 to make a personal webpage


Top
 Profile  
 
 Post subject: Re: lighttp problems
PostPosted: Sun Nov 20, 2011 9:57 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6122
You have different options. Changing the port number is done by editing /etc/lighttpd/lighttpd.conf: server.port = 80
When you change this to, let's say 81, you can run a different website on port 80 by adding the lines:
Code:
$SERVER["socket"]=="192.168.1.1:80" {
   server.document-root = "/var/www/alternate-website-root/"
}
where the ip address is the ip address of your box. Lighty will automatically listen on port 80.

Option 2: You can use virtual servers. When you expose your website using a dyndns address, yourdomain.dyndns.org, then you can offer a different website for people accessing using this url:
Code:
$HTTP["host"]=~"(^|\.)yourdomain.\.dyndns\.org$" {
        server.document-root = "/var/www/yourdomain.dyndns.org/"
}
This way you can host as many websites as you want, all using port 80, providing you have different urls al pointing to your box.
If you want to go for the virtual servers, it's a good idea to provide a catch-all. In my server logs I see lots of scans for known vulnerabilities, all pointing to my public IP. So I provided a catch-all, which is just an empty index.html.

So change the lines
Code:
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root       = "/var/www/"
in
Code:
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root       = "/var/www/catchall/"

$HTTP["host"]=~ "(^|\.)yourdomain.\.dyndns\.org$" {
        server.document-root = "/var/www/yourdomain.dyndns.org/"
}

$HTTP["host"]=~ "Iomega-09681e$" {
        server.document-root = "/var/www/"
}
This way you will get the firmware webinterface when you access the box in your lan by it's name (of course you'll have to provide the right name in the script file), and get your own website when you access it via yourdomain.dyndns.org. All other ways gives the catch all.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group