lixuewei / rt-n56u

Automatically exported from code.google.com/p/rt-n56u
0 stars 0 forks source link

request for adding virtual host #1180

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
hi and thanks for all you have done in this project.!

is it possible to add a virtual host setting into n56u?
for example I had a domain name called n56u.com, and i had added a few cname,

host                       local host          port
site1.n56u.com      192.168.1.2      80
site2.n56u.com      192.168.1.2      8080
site3.n56u.com      192.168.1.3      80

is it a possible function could be add to the firmware? if not, sorry for my 
foolish.

Thank you and keep going on!

Original issue reported on code.google.com by pat...@gmail.com on 7 Mar 2014 at 2:47

GoogleCodeExporter commented 9 years ago
Hello,

I believe I can help answer part of your problem.  Try going to Advanced 
Settings->LAN.  Then go to the 'DHCP Server' tab.  Under Advanced Settings 
section, you will find a link to 'Custom Configuration File "hosts"'.  Click 
this link.  A text box will appear below that allows you to edit the hosts file 
used on the router.

As per your example,  try this:

192.168.1.2 site1.n56u.com
192.168.1.3 site3.n56u.com

Unfortunately, I'm not sure if it's possible (and if so, then how to go about) 
mapping the subdomains to a specific port.  Someone chime in if you know how.  
You can access the "site2" above by visiting 
http://site1.n56u.com:8080/url-continues-here

NOTE: See http://en.wikipedia.org/wiki/Hosts_(file) for explanation on hosts 
file.

Thanks,

Matt

Original comment by matt.ros...@gmail.com on 11 Mar 2014 at 4:56

GoogleCodeExporter commented 9 years ago
I won't ask why do need it =)))
You can add some virtual interfaces:
Fox example,
ifconfig br0:site1 192.168.1.2 up
...
ifconfig br0:site3 192.168.1.3 up

Again, I don't know what you are expecting to get, but there is a symlink:
/www/custom -> /opt/share/www/custom
If your disk is mounted to /opt (you're using Optware or smth. else), you can 
put some html to: /opt/share/www/custom. Let's say it is uptime.html:

<html>
<head>
<script type="text/javascript">
   var uptimeStr = "<% uptime(); %>";
   document.write(uptimeStr);
</script>
</head>
<body>
</body>
When you point your browser to http://site1.n56u.com:8080/custom/uptime.html 
you'll see something like: Sat, 15 Mar 2014 07:47:05 +0400(88357 secs since 
boot) 

Original comment by d...@soulblader.com on 15 Mar 2014 at 3:49