English
Ask Your Question
0

Hosting subdomains in Fedora Server 25

asked 2017-03-20 20:23:40 +0000

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/thalissonxavier.top
    ServerName www.thalissonxavier.top
    ServerAlias thalissonxavier.top
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/html/sub.thalissonxavier.top
    ServerName www.sub.thalissonxavier.top
    ServerAlias sub.thalissonxavier.top
</VirtualHost>

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 www.thalissonxavier.top (/etc/httpd/conf/httpd.conf:359)
         port 80 namevhost www.thalissonxavier.top (/etc/httpd/conf/httpd.conf:359)
                 alias thalissonxavier.top
         port 80 namevhost www.sub.thalissonxavier.top (/etc/httpd/conf/httpd.conf:365)
                 alias sub.thalissonxavier.top
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/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

But, I can only access the main domain, thalissonxavier.top 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
2

answered 2017-03-20 23:17:43 +0000

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

Comments

Yes, I have. Here is my /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
200.164.238.180     thalissonxavier.top           www.thalissonxavier.top
200.164.238.180     sub.thalissonxavier.top       www.sub.thalissonxavier.top
lspooky ( 2017-03-21 10:53:32 +0000 )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 ( 2017-03-21 16:20:11 +0000 )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 ( 2017-03-21 18:51:29 +0000 )edit
1

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

aeperezt ( 2017-03-22 00:17:57 +0000 )edit
0

answered 2017-03-23 19:07:33 +0000

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
1 follower

Stats

Asked: 2017-03-20 20:23:40 +0000

Seen: 39 times

Last updated: 17 hours ago