-1

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.

2 Answers2

0

If you using /var/www/ and home/juninho/workspace/vhosts-projects/torpedogratis

Then

need to add 2 DocumentRoot entry for each once

And Check is the AllowOverRide option allow on which location .

Then If Centos or Redhat then disable selinux .

Kernelv5
  • 1,732
  • 1
  • 10
  • 17
-1

Seems like you're missing ServerName torpedogratis.work.

Koby
  • 139
  • 2
  • 5
  • 2
    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](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – kdopen May 21 '15 at 13:42
  • I am obviously new at this, but saying "This does not provide an answer to the question." doesn't prove it does not answer the question. I did not wish to critique or ask for clarification from the author, because I (think I) totally understand him. To me it seems he is one directive away from getting his vhost to work, which is a proper `ServerName`. If you believe I am wrong, and that is always a possibility in life, please include an explanation. – Koby May 22 '15 at 10:13
  • This is a canned comment from the review process. A single line answer like yours is often an attempt to comment by someone with insufficient rep to do so. It is also not a very good answer. Which file is missing this line? What does adding this line achieve? How does it solve the problem? "Seems like" sounds like a guess, or a comment, not an answer – kdopen May 22 '15 at 14:07
  • canned = automatic? You seem like a regular SO user to me. My answer is in the question's context. Since the user asking the question has displayed the contents of two files, only one of which holds similar directives to the one I presented, and one existing directive even begins the same (`ServerAdmin`), it is obvious what I am referring to. To me, "Seems like" is equal to "To the best of my knowledge". I chose to phrase myself this way so I wouldn't sound like my answer is bulletproof. It is modesty mixed with politeness mixed with insecurity, not related to commenting or guessting. – Koby May 22 '15 at 20:40