0
I set up a Vhost for my project as follows:
1 - I added a line to the file /etc/hosts
containing local address, url and alias
127.0.0.1 meuprojeto.com meuprojeto
2 - I added the file meuprojeto.conf in /etc/apache2/sites-enabled/meuprojeto.conf containing the following information:
<VirtualHost www.meuprojeto.com>
ServerAdmin webmaster@localhost
ServerName wwww.meuprojeto.com
ServerAlias meuprojeto
DocumentRoot "/var/www/html/meuprojeto"
</VirtualHost>
There is a copy of this file on /etc/apache2/sites-available
I can access my project from the normally declared url.
The problem is that all requests now point to the root of the project. In case you enter the address http://localhost the request falls in the /var/www/html/meuprojeto.
I’ve checked the apache root directory on /etc/apache2/apache.conf
and it points to:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Thank you for your attention.
The Host Apparently wrong, try to put it like this:
127.0.0.1 meuprojeto.com
and127.0.0.1 www.meuprojeto.com
bottom. Not Counting that in config there, is with 4wwww
.– Raphael Caldas
@Raphaelcaldas, I think it was a typo, hehe. I made the suggested changes but had no change. Ai tried to use a2ensite meuprojeto, somehow the browser started to display the default index that exists in localhost ("it, Works!"). But when I try to access another localhost/project2 project, there is still redirection to
/var/www/html/meuprojeto
– Iago Gutierre