Apache add subdomain

0

I need to add a subdomain to this server, i added this

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName images.login.acorn.lt
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName login.acorn.lt
</VirtualHost>

config to /etc/httpd/conf/httpd.conf and restarted with apachectl -k graceful , without error. But images.login.acorn.lt is down

Ben

Posted 2014-06-26T10:35:41.723

Reputation: 227

Which effect do you expect? Both virtual hosts have the same document root. They will show the same content. – Matteo – 2014-06-26T10:41:24.850

images.login.acorn.lt doesn't work at all, i added same root just for the test @Matteo – Ben – 2014-06-26T10:42:36.450

Answers

0

In order to have images.login.acorn.lt to work you have to assign the same IP as login.acorn.lt (they have both to point to your address).

At the moment images.login.acorn.lt is not registered.

$ host login.acorn.lt
login.acorn.lt has address 79.98.30.58
$ host images.login.acorn.lt
Host images.login.acorn.lt not found: 3(NXDOMAIN)

Matteo

Posted 2014-06-26T10:35:41.723

Reputation: 6 553

so how do i get it to do that? – Ben – 2014-06-26T10:56:17.187

By your DNS registrar. In the same way you registered login.acorn.lt – Matteo – 2014-06-26T10:57:45.757

1

You have register your custom sub-domain name with dns registrar to make it it working. I mean you need a valid DNS record for your subdomain too. You can accomplish this by either setting up an individual DNS entry for each new subdomain, But every namebasedvirtualhost has to have a valid DNS entry. Moreover custom domain name must be allowed on server.For Custom sudomain domain name you have to specify and register proper dns.

Innovator

Posted 2014-06-26T10:35:41.723

Reputation: 204

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.

– Fazer87 – 2014-06-26T12:11:57.870

improved the answer @Fazer87 – Innovator – 2014-06-26T12:16:15.110

Much better :) Generally people are asking for help because they dont know how or why. Just answering HOW may not help them or others in the long run – Fazer87 – 2014-06-26T12:17:31.913

got it...might be upvoted now :) – Innovator – 2014-06-26T12:18:44.800