0
Today I have a PHP system that uses an IP, so it looks like this:
I’m setting up subdominios to answer the requests and stay that way
http://sistema1.empresa.com.br
http://sistema2.empresa.com.br
It turns out that the browser always goes to the main site, does not obey the subdomains... I already have these settings on other servers, but this insists not to obey
The only thing that is different is that on the other servers I delete the main site because I only use subdomains, the main site is hosted on other servers and the subdomains comes through A entries in DNS
This also turns by DNS entries, but for now I can not delete the main site... how to make him understand that there are subdomains?
The file 000-default.conf is like this:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Your Virtualhot has nothing configured besides the /var/www/html folder, there is no way to know if it is using virtualhost+/etc/hosts or if it is solving this in PHP, more details.
– Guilherme Nascimento
I thought the problem was the default setting, but I was making a crude mistake... you know when it makes you want to kick everything... it’s not possible that I lost hours on it... follow the solution in the answer, it’s even embarrassing :)
– Marcelo
Dear Marcelo, it’s not really a solution, since the question did not have this part mentioned and would have no other answer. Forgive me, but it is "typo" (confusion) only. But I’m glad you managed to solve it by yourself.
– Guilherme Nascimento
Possible duplicate of How to use several sites in Ubuntu Dedicated Server?
– Guilherme Nascimento