0

I am having trouble in making virtual hosts in Apache to work. The virtual hosts were running fine but suddenly it stopped working today. To create virtual hosts I opened the httpd-vhosts file and typed in the configuration like one below:

<VirtualHost hello.dev:80>
ServerAdmin xyz@ty.com
DocumentRoot "H:\www\hello_webservice"
ServerName hello.dev
ServerAlias www.hello.dev
ErrorLog "logs/hello.dev-error.log"
CustomLog "logs/hello.dev-access.log" common
</VirtualHost>

By the way the apache is working since I am able to access htdocs via localhost.

I say Reinstate Monica
  • 25,487
  • 19
  • 95
  • 131
champ
  • 1
  • 1
    have a look at apache error log – suspectus Jan 10 '15 at 15:08
  • Do you have an entry for hello.dev in your host file or DNS server? Apache doesn't automatically configure your network. First get `ping hello.dev` to work from the command line then setup your vhosts. – krowe Jan 10 '15 at 15:29
  • Also, see this question: http://superuser.com/questions/286923/apache2-virtual-hosts-not-recognizing-properly?rq=1 – krowe Jan 10 '15 at 15:48

1 Answers1

-1

Try restarting the Apache server:

sudo service apache2 restart

On Windows:

httpd.exe -k restart
krowe
  • 5,493
  • 1
  • 24
  • 31
  • 1
    -1 Judging by the OP host file, this person is using Windows. Notice the location of `DocumentRoot`? You also had the command wrong, I've fixed that though. – krowe Jan 10 '15 at 15:23