0

I needed to run virtual server and I uncommented Include "conf/extra/httpd-vhosts.conf" As soon as i did that and restarted Wamp, it gives me "The requested URL / was not found on this server" Error. When I add the comment again it works.

I even tried editing drivers and adding all the necessary steps to have a virtual host.

Server configuration Windows 10. Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80

Contents of the httpd-vhosts.conf file:-

# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
Tharaka Nuwan
  • 702
  • 2
  • 7
  • 21
  • How do you expect us to help with your configuration, if you do not post it inside the question? – arkascha Jun 26 '16 at 13:52
  • Please read the last line. Also I did not have to add anything to the vttpd-vhosts.conf. error gives even before adding anything to that file. – Tharaka Nuwan Jun 26 '16 at 13:55
  • I am not interested if you added anything to that file. We need to see the contents. So that we can tell you what causes the issue. You see: we are good, but we are not _that_ good that we can somehow magically _guess_ what is in that file on your system. And no, just because you say that you installed some distribution of the apache http server on some MS-Windows system does _also_ not tell us the contents of that file. – arkascha Jun 26 '16 at 13:57
  • Contents of which file are you interested in? httpd.conf file is a fresh one and I only uncommented above mentioned line. I'am bit new to wamp so I really dnt have an idea of what information you need other than details I've added here. – Tharaka Nuwan Jun 26 '16 at 14:03
  • Obviously the contents of the file `conf/extra/httpd-vhosts.conf`, since that content apparently causes the issues as soon as it gets included. – arkascha Jun 26 '16 at 14:04
  • Added it to the question. Please check. – Tharaka Nuwan Jun 26 '16 at 14:08
  • Thanks. I added an answer. Might not be final, but I assume that this at least brings you closer to solving your issue. – arkascha Jun 26 '16 at 14:13
  • Check out this post. What is in the `httpd-vhosts.conf` file is demo example code. Remove it all. http://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/23990618#23990618 – RiggsFolly Jun 27 '16 at 11:50

1 Answers1

1

Thanks for adding the contents of the configuration file to the question. Given that the situation looks like that: two virtual hosts are defined in there, the first will be treated as "default host", so that hosts configuration will is relevant for all incoming requests that can not be matched on a specific defined http host.

That default host defines the DocumentRoot as: c:/Apache24/docs/dummy-host.example.com. So if you get the mentioned error message then most likely there is no content defined in that folder...

arkascha
  • 41,620
  • 7
  • 58
  • 90