1

I have read a ton of threads here and elsewhere but none of the suggestions have worked. I installed the latest version of WAMP 64 bit on a fresh install of Windows Server 2012 R2.

  • I created a subdirectory within the www directory called andrew. In that is an index.html file.

  • I added the following to the hosts file:

    127.0.0.1 andrew
    ::1 andrew
    
  • I added the following to the httpd-vhosts.conf file:

    <VirtualHost *:80>
        DocumentRoot "c:/wamp64/www/andrew"
        ServerName andrew
        <Directory  "c:/wamp64/www/andrew">
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>
    
  • I uncommented the virtual hosts line in httpd.conf

  • I stopped and started net dnscache
  • I restarted the WAMP services
  • I "Put Online" the WAMP server

Regardless, when I access the server from another machine like [server IP address]*/andrew/index.html I get a 403 Forbidden error.

Here is the apache error log ("[SERVER IP]" is really the server's actual IP):

[Fri Apr 22 17:10:32.628356 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Apr 22 17:10:34.656507 2016] [mpm_winnt:notice] [pid 4444:tid 312] AH00364: Child: All worker threads have exited.
[Fri Apr 22 17:10:34.672087 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00430: Parent: Child process 4444 exited successfully.
[Fri Apr 22 17:10:34.921723 2016] [auth_digest:notice] [pid 4724:tid 416] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00455: Apache/2.4.17 (Win64) PHP/5.6.16 configured -- resuming normal operations
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00456: Apache Lounge VC14 Server built: Oct 11 2015 11:49:07
[Fri Apr 22 17:10:34.952892 2016] [core:notice] [pid 4724:tid 416] AH00094: Command line: 'C:\\wamp64\\bin\\apache\\apache2.4.17\\bin\\httpd.exe -d C:/wamp64/bin/apache/apache2.4.17'
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00418: Parent: Created child process 4388
[Fri Apr 22 17:10:35.140157 2016] [auth_digest:notice] [pid 4388:tid 312] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:35.171357 2016] [mpm_winnt:notice] [pid 4388:tid 312] AH00354: Child: Starting 64 worker threads.
[Fri Apr 22 17:10:49.899265 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/andrew/index.html
[Fri Apr 22 17:10:50.055249 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/favicon.ico, referer: http://[SERVER IP]/andrew/index.html

I am now thinking it has to do with some setting on Windows 2012 Server, but I can't figure it out. Help.

techraf
  • 64,883
  • 27
  • 193
  • 198
Crescent
  • 93
  • 2
  • 10

2 Answers2

4

Because Apache doesn't know to associate the IP address with your virtual host, it uses the main server settings. Probably you don't need a virtual host at all, but try this anyway:

<VirtualHost *:80>
    DocumentRoot "c:/wamp64/www/andrew"
    ServerName andrew
    #of course, enter your IP address here
    ServerAlias 1.2.3.4
    <Directory  "c:/wamp64/www/andrew">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
miken32
  • 42,008
  • 16
  • 111
  • 154
  • Well, that technically works. [Server IP]/andrew/index.html doesn't, but just entering http://[Server IP] goes straight to that folder. What I was hoping to do is have several different folders in the www directory, and set up vhost entries for each so users could visit IP/andrew, IP/foobar, etc. – Crescent Apr 23 '16 at 02:31
  • 1
    But you've set your `DocumentRoot` to include the `andrew` folder, so you don't put it in your URL. I think you misunderstand what a virtual host is. As I said, you probably don't need one at all. Look up the `Alias` command in [the documentation](https://httpd.apache.org/docs/current/mod/mod_alias.html) instead. As implied by the name, a [virtual *host*](https://httpd.apache.org/docs/current/vhosts/) allows you to have different host names on one server. – miken32 Apr 23 '16 at 02:35
  • Ah. I was reading an article that said to use vhosts instead of Alias. I am admittedly a n00b when it comes to the web. I am a SQL Server developer by trade. Here is the article I was referencing: https://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/23990618#23990618 – Crescent Apr 23 '16 at 03:04
0

please don't forget to edit phpMyAdmin.conf file. It will save your time to face 403 Error (403 Forbidden). You should set Require all granted into it as follows (indipendently by used phpMyAdmin version):

Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin5.0.2/"

<Directory "c:/wamp64/apps/phpmyadmin5.0.2/">
  Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
  Require all granted

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>