1

I am running OSMC on my raspberry p3 and was trying to set up a webpage for internal use.

I installed lighttpd and when I try to get to "osmc.local" the lighttpd page shows up just fine.Now I wanted to set up a subdomain, say "xyz.osmc.local".

I know that the file "/etc/lighttpd/lighttpd.conf" needs to be edited and lines like the following need to be added to create subdomain/virtualhost.

$HTTP["host"] == "sub.example.com" {
server.document-root = "/var/www/sub.example.com/public/htdocs"
server.errorlog = "/var/www/sub.example.com/logs/error.log"
accesslog.filename = "/var/www/sub.example.com/logs/access.log"
}

But no matter what I do, no subdomain works even though the domain "osmc.local" is working fine.

Any suggestions?

flide
  • 41
  • 4
  • Did you restart the service? What is it doing when you try to go to that web page? Does the error log say anything? – cutrightjm Sep 12 '16 at 05:44
  • Over the years I reached the conclusion that it is either Apache or NgINX. Have you defined the domain in DNS? – Rui F Ribeiro Sep 12 '16 at 10:05
  • @cutrightjm: Yes, I restarted the service, I restarted the pi too. The browser says "server not found", and ping says "ping: bad address 'xyz.osmc.local'" – flide Sep 12 '16 at 13:15
  • @RuiFRibeiro: I am not sure about the DNS defination, I have avahi-daemon running, no configuration file says that my domain is defined, but still when I browse to "osmc.local" the default lighttpd page serves up right, so I assumed that the domain is defined. – flide Sep 12 '16 at 13:15
  • You cannot make up names at random and expect them to work automagically. avahi propagates the name of machines and makes announcement of services. For more complicated setups, you need to define names in a DNS service. Some home routers allow to add names there. You may define an entry in an host files for testing, but just for testing. – Rui F Ribeiro Sep 12 '16 at 13:17
  • @RuiFRibeiro Are you saying that "If I have to set-up subdomain on my server, my server needs to have a DNS server running". – flide Sep 13 '16 at 03:41

1 Answers1

0

xyz.osmc this is the record you put in local machine DNS resolver or DNS host file not xyz Reason is Domain in local machine has name as local The rest is like create sub domain and sub subdomain etc.
It resolves as domain first then subdomain then subsubdomain