My goal is to host various sites (local virtualhosts) on my apache webserver in the LAN of my enterprise (Debian 9 server).
So that:
- openproject.myenterprise.local => /opt/openproject
- wiki.myenterprise.local => /var/www/location/wiki
- etc.
I configured virtualhosts on my apache2 webserver with
- /etc/apache2/sites-available/openproject.conf
ServerName openproject.myenterprise.local
- /etc/apache2/sites-available/000-main-static-site.conf
ServerName vmDebDevSrv1.myenterprise.local ServerAlias salado.myenterprise.local
- /etc/apache2/sites-available/001-wiki.conf
ServerName wiki.myenterprise.local
Now its working with a local configuration in /etc/hosts
172.16.12.171 openproject.myenterprise.local
172.16.12.171 wiki.myenterprise.local
When I add the DNS resolution with bind9 it doesn't work anymore. I guess it is because of the incapacity of my server to relay the FQDN I use.
- When I ping or put the url into my browser
wiki
it works but gives me the main directory of my webserver not the wiki virtualhost
Edit: ping wiki gives me:
ws1: ~$ ping wiki
PING ns1.myenterprise.local (172.16.10.174): 56 data bytes
64 bytes from 172.16.10.174: icmp_seq=0 ttl=64 time=0.282 ms
^C--- ns1.myenterprise.local ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.282/0.325/0.368/0.043 ms
/edit
- When I ping wiki.myenterprise.local it doesn't work
ping: unknown host
, Edit: nslookup works with FQDN /Edit
My /etc/resolv.conf
domain myenterprise.local
search myenterprise.local
nameserver 172.16.12.174
nameserver 172.16.12.1
nameserver ...
/etc/bind/db.myenterprise.local
$TTL| 604800
@| IN| SOA| ns1.myenterprise.local. root.vmDebDevSrv1.myenterprise.local. (
| | | 20181129| ; Serial
| | | 604800|| ; Refresh
| | | 86400|| ; Retry
| | | 2419200|| ; Expire
| | | 604800 )| ; Negative Cache TTL
;Name server information
@| IN| NS| ns1.myenterprise.local.
;IP Address of Domain Name Server(DNS) setted on line above
ns1| IN| A| 172.16.12.174
;CNAME Records
vmDebDevSrv1| IN| CNAME| ns1.myenterprise.local.
wiki| IN| CNAME| vmDebDevSrv1.myenterprise.local.
openproject| IN| CNAME| vmDebDevSrv1.myenterprise.local.
;tried too with
;wiki| IN| A 172.16.12.174
;openproject| IN| A 172.16.12.174
What Am I missing?!!! I thought the path would be short-name=>DNS=>FQDN=>Apache2=>well page returned
So I guess its impossible to get
When you only enter
wiki
in your browser window, I would say that even though the OS adds the search domains when trying to perform a DNS lookup, theHost
header sent in the HTTP request is just what you've put in the browser window, i.e.Host: wiki
. To make that work, put in aServerAlias wiki
in your Apache configuration.Can you paste the output of your ping commands? Some troubleshooting steps to consider: