Discussion:
newly added subdomain does not work
(too old to reply)
GH
2015-03-24 02:10:23 UTC
Permalink
Dear,
I'm puzzled that my newly added subdomain does not work. httpd.conf read like the following before my change:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/web/www2/public_html
ServerName www2.my-cool-domain.com
ServerAlias www2.my-cool-domain.com
</VirtualHost>
<Directory /www/web/www2>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

<VirtualHost *:80>
DocumentRoot /www/web/www3/public_html
ServerName www3.my-cool-domain.com
ServerAlias www3.my-cool-domain.com
</VirtualHost>
<Directory /www/web/www3>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

And both www2.my-cool-domain.com and www3.my-cool-domain.com worked ok.

Now I added the following to httpd.conf, created /www/web/www4/public_html/index.html, and ran httpd -k graceful

<VirtualHost *:80>
DocumentRoot /www/web/www4/public_html
ServerName www4.my-cool-domain.com
ServerAlias www4.my-cool-domain.com
</VirtualHost>
<Directory /www/web/www4>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

But access to www4.my-cool-domain.com failed with a message "cannot find www4.my-cool-domain.com".

I wonder if I missed something. Can someone shed some light?
Thank you.
GH
2015-03-24 02:13:23 UTC
Permalink
PS: information about my environment:

$ /www/wdlinux/apache/bin/httpd -V
Server version: Apache/2.2.22 (Unix)
Server built: Jan 8 2013 10:51:04
Server's Module Magic Number: 20051115:30
Server loaded: APR 1.4.5, APR-Util 1.4.1
Compiled using: APR 1.4.5, APR-Util 1.4.1
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/www/wdlinux/httpd-2.2.22"
-D SUEXEC_BIN="/www/wdlinux/httpd-2.2.22/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

$ uname -r
2.6.32-431.23.3.el6.x86_64

And yes, I checked that httpd -k graceful started successfully and I got a new set of child httpd's.
GH
2015-03-24 02:16:58 UTC
Permalink
PS2: I had a second machine with similar but not exact versions/configs, which worked ok with newly added subdomains. Unfortunately the first machine is a production machine and I cannot reconfigure exactly the same way as the second machine.
D. Stussy
2015-03-24 06:31:37 UTC
Permalink
"GH" wrote in message news:bcfc534b-061f-434f-9305-***@googlegroups.com...
I'm puzzled that my newly added subdomain does not work. httpd.conf read
like the following before my change:
...
===========
Did you add the hostname to your DNS, bump the SOA serial, and reload your
DNS server?
Swifty
2015-03-24 07:08:27 UTC
Permalink
Post by D. Stussy
Did you add the hostname to your DNS, bump the SOA serial, and reload
your DNS server?
More or less what I was about to say.

A simple test: Can you "ping www4.my-cool-domain.com" ?
Or "traceroute www4.my-cool-domain.com" ?

Try it with www3.my-cool-domain.com first, as the server(s) may not
respond to ping, in which case the test has no value.
--
Steve Swift
http://www.swiftys.org.uk/
GH
2015-03-24 10:19:35 UTC
Permalink
First of all, thank you all for your reply.

Ping and tracert to both www2.my-cool-domain.com and ww3.my-cool-domain.com worked fine. But ping to www4.my-cool-domain.com returned error "could not find host", and tracert to www4.my-cool-domain.com returned error "Unable to resolve target system name".

I guess DNS handles only the main domain name like my-cool-domain.com, and subdomain like www2.my-cool-domain.com is handled by the host my-cool-domain.com itself. Or did I understand it incorrectly?
Swifty
2015-03-26 18:07:48 UTC
Permalink
Post by GH
I guess DNS handles only the main domain name like my-cool-domain.com,
and subdomain like www2.my-cool-domain.com is handled by the host
my-cool-domain.com itself.
It's been long and long since I last managed a DNS, but as I recall
every distinct IP name has to be added as a specific entry, even if it
maps to the same IP address as other entries. There's no wildcard mechanism.

The DNS protocol may have been updated since my time, but in general DNS
definitions are much like the entries in a "hosts" file. One entry for
each different IP name.

So, you'd need to track down what's resolving www2.my-cool-domain.com
and arrange for www3... and www4... entries to be added as required.

As an example, www.swiftys.org.uk was defined for me by the ISP which
hosts my website. When I wanted to add a "play" server running on my PC
at home, I chose that to be simply http://swiftys.org.uk
The site hosting my http://www.swiftys.org.uk webserver has a webpage
for adding other hostname/IP address pairs, so that was very easy.
--
Steve Swift
http://www.swiftys.org.uk/
D. Stussy
2015-04-06 20:08:59 UTC
Permalink
Post by GH
I guess DNS handles only the main domain name like my-cool-domain.com,
and subdomain like www2.my-cool-domain.com is handled by the host
my-cool-domain.com itself.
It's been long and long since I last managed a DNS, but as I recall
every distinct IP name has to be added as a specific entry, even if it
maps to the same IP address as other entries. There's no wildcard mechanism.
...
================

Actually, there is a DNS wildcard mechanism, but it often works in a manner
contrary to what is expected and is therefore considered dangerous.
Loading...