Ask Your Question

Hosting subdomains in Fedora Server 25

asked 2017-03-20 15:23:40 -0500

Dear friends, how are you? After several days reading and watching videos about how to host a subdomain in apache I've had no luck. I have one domain for test purposes, created the folders under /var/www/html and added to my httpd.conf the following code:

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /var/www/html/

<VirtualHost *:80>
    DocumentRoot /var/www/html/

httpd -S is showing:

[root@site conf]# httpd -S
[Mon Mar 20 17:19:00.518210 2017] [so:warn] [pid 2944] AH01574: module rewrite_module is already loaded, skipping
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:358
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::8bc:3d3d:7740:7241. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443                  fe80::8bc:3d3d:7740:7241 (/etc/httpd/conf.d/ssl.conf:56)
*:80                   is a NameVirtualHost
         default server (/etc/httpd/conf/httpd.conf:359)
         port 80 namevhost (/etc/httpd/conf/httpd.conf:359)
         port 80 namevhost (/etc/httpd/conf/httpd.conf:365)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex mpm-accept: using_defaults
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
PidFile: "/run/httpd/"
User: name="apache" id=48
Group: name="apache" id=48

But, I can only access the main domain, meanwhile the subdomain keeps showing ERRNAMENOT_RESOLVED.

Any help is much appreciated.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2017-03-20 18:17:43 -0500

Rabin gravatar image

Did you set a DNS record to point to the sub domain? try setting one up using /etc/hosts file to check locally.

edit flag offensive delete link more


Yes, I have. Here is my /etc/hosts   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
lspooky gravatar imagelspooky ( 2017-03-21 05:53:32 -0500 )edit

That is the /etc/hosts of your server or the computer you use to navigate to your server? it should be like that on your client computer not your server or on your dns.

aeperezt gravatar imageaeperezt ( 2017-03-21 11:20:11 -0500 )edit

It is in my server. So, how is it possible for me to register a domain and let it and his subdomains accessible to the public?

lspooky gravatar imagelspooky ( 2017-03-21 13:51:29 -0500 )edit

You need to use a domain registrar, and buy a domain, then register your subdomain and point it to your ip.

aeperezt gravatar imageaeperezt ( 2017-03-21 19:17:57 -0500 )edit

answered 2017-03-23 14:07:33 -0500

masteroman gravatar image

There are few requirements:

  1. You need FQDN (fully qualified domain name)
  2. You need that domain pointed to some DNS servers (many registrars provide their own DNS servers to use for free).
  3. You need to point wanted domains/sub-domains to your server IP address (by setting up A type record on DNS)

Once that is done you need to configure your Apache to have VirtualHosts. There are two kinds of Virtual Hosts:

  1. Name based virtual hosts
  2. IP based virtual hosts

You're using Name based virtual hosts and I see you've configured that good, although, general recommendation would be to have VirtualHost specified on only one IP address.

After you register domain and make modifications to zone records keep in mind that it may take some time to propagate those changes, depending on DNS server TTL (time-to-live).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-03-20 15:23:40 -0500

Seen: 592 times

Last updated: Mar 23 '17