It is the first time I create a Virtual Host and am having trouble because it is pointing to my main directory of Apache (/var/www/html) and not to the directory that I want (/home/juninho/workspace/vhosts-projects/torpedogratis).
Below is my /etc/apache2/sites-available/torpedogratis.work.conf file:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/juninho/workspace/vhosts-projects/torpedogratis.work
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Below is my /etc/hosts file:
127.0.0.1 localhost
127.0.0.1 torpedogratis.work
127.0.1.1 Juninho-Dell
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
When I go into http://torpedogratis.work/ content that appears is the / var/www/html. Why is this happening?
-
I thought the error was in my /etc/hosts file, so I added the second line (127.0.0.1 torpedogratis.work), but still did not work.