Virtualhost AWS Ubuntu

Asked

Viewed 70 times

-1

Hello big linux ninjas.

I’m working on the AWS ec2 Ubuntu, and I need to create a subdomain. I saw some tutorials but none worked.

I created a file on:

/etc/apache2/sites-available/

called admin.conf. In the file I put:

<VirtualHost *:80>  
    ServerAdmin [email protected]
    ServerName subdominio.site.com.br
    ServerAlias www.subdominio.site.com.br
    DirectoryIndex index.html
    DocumentRoot /var/www/site2
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

In the 000-default.conf is:

<VirtualHost *:80>  
    ServerAdmin [email protected]
    ServerName site.com.br
    ServerAlias www.site.com.br
    DirectoryIndex index.html
    DocumentRoot /var/www/site1
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

The site is opening normally, but the domain is not opening. Says: "It is not possible to access this site. Could not find server IP address"

Could you help me? Thank you very much!

1 answer

0

You need to create the DNS entry for the subdomain.

The subdomain concept requires you to associate an address in the case of a type A record or the root domain name, or any other, if the record is of the type CNAME.

If you are using register.br create an entry like CNAME with the name of your subdomain and the address enter the root of your domain.

  • Talk to me, Henry! When the question is not clear enough, the ideal is to request details via comment in the question, and then formulate an answer. Once you have enough reputation you can comment anywhere. The most you can do is specify the cases in your reply (see editing that I did). If it is not in accordance with your goal, you can also reverse the editing. ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.