0

I desesperate to get wamp working!

I've installed wampserver 2.5 on my win7 64bits machine.

In the httdp.conf file, I just commented out the line regarding vhosts:

Include conf/extra/httpd-vhosts.conf

The httpd-vhosts.conf contains:

<VirtualHost *:80>
    DocumentRoot "C:/Users/Alain/Dropbox/Website/exemples/Grafikart/Petsy_alain.dev"
    ServerName petsy.dev
    ServerAlias www.petsy.dev
    <Directory "C:/Users/Alain/Dropbox/Website/exemples/Grafikart/Petsy_alain.dev">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        <RequireAny>
            Require local
            Require ip 192.168.1
        </RequireAny>
    </Directory>
</VirtualHost>

(I also tried Require all granted)

I first installed wampserver 2.5 64 bits.

I was able, from my local machine to access http://petsy.dev But when I tried to access to http://192.168.1.16/petsy.dev from an other machine of my LAN, I was always getting a 403 error (Forbidden):

[Thu Dec 04 14:43:08.519329 2014] [authz_core:error] [pid 11088:tid 776] [client 192.168.1.15:39975] AH01630: client denied by server configuration: C:/Users/Alain/Dropbox/Website/exemples/Grafikart/Petsy_alain.dev
[Thu Dec 04 14:43:08.635335 2014] [authz_core:error] [pid 11088:tid 776] [client 192.168.1.15:39975] AH01630: client denied by server configuration: C:/wamp/www/favicon.ico

I got access remotely to petsy.dev when I added in the remote PC hosts file the line:

192.168.1.16  petsy.dev

In that case, I was able, on my remote machine, to access to the server using 'http://petsy.dev'.

First I don't understand what does it change on the server side and secondly I cannot be satisfied by this solution as I cannot use it on a smartphone.

As I wasn't able to find an answer anywhere, I finally tried to install wampserver 2.5 32 bits!

Same problem! But with a different error:

I can ALWAYS access to my petsy.dev website locally but now, when I try to access it remotely, I get a 404 error (not Found) !!!

Here are the access logs of apache From my local machine:

xxxx::7d1a:xxxx:9672:xxxx - - [05/Dec/2014:19:22:25 +0100] "GET / HTTP/1.1" 200 40438

From my remote machine:

192.168.1.15 - - [05/Dec/2014:19:22:30 +0100] "GET /petsy.dev/ HTTP/1.1" 404 295

httpd -T answers syntax OK

httpd -S says:

VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server localhost (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:23)
         port 80 namevhost localhost (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:23)
                 alias localhost
         port 80 namevhost petsy.dev (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:34)
                 alias www.petsy.dev
ServerRoot: "C:/wamp/bin/apache/apache2.4.9"
Main DocumentRoot: "C:/wamp/www/"
Main ErrorLog: "C:/wamp/logs/apache_error.log"
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex default: dir="C:/wamp/bin/apache/apache2.4.9/logs/" mechanism=default
Mutex authdigest-opaque: using_defaults
PidFile: "C:/wamp/bin/apache/apache2.4.9/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: APACHE24=Apache2.4

Please, please which stupid error did I make ????

fralbo
  • 2,534
  • 4
  • 41
  • 73

2 Answers2

0

You dont need the <RequireAny> so just try this

<VirtualHost *:80>
    DocumentRoot "C:/Users/Alain/Dropbox/Website/exemples/Grafikart/Petsy_alain.dev"
    ServerName petsy.dev
    ServerAlias www.petsy.dev
    <Directory "C:/Users/Alain/Dropbox/Website/exemples/Grafikart/Petsy_alain.dev">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require local
        Require ip 192.168.1
    </Directory>
</VirtualHost>

Additional Info I dont think you understand what is happening when you create Virtual Hosts.

Basically when Apache see's it has one or more Virtual Hosts configured, you are teling Apache that it is the server for more than one domain name. The important part in that sentence is more than one domain name.

This causes Apache to examine the domain name on each incoming connection. It will then match the domain name to one of its Virtual Hosts definitions and change the DocumentRoot and potentially other parameters to those set in that Virtual Host.

So the important thing is that you use a matching domain name in the browser of the other PC you are using to get to Apache with a domain name it knows about.

This would normally be done by a DNS Server on the real internet, but while you are inside your own local network i.e. safely behind your router you have to use another method. You could setup your own local DNS Server, but thats quite complicated.

So the simple solution is to use the HOSTS file on the other PC's in your network.

So on the other PC (not the PC running WAMPServer), edit the \windows\system32\drivers\etc\hosts file and add this

192.168.1.16  petsy.dev

Then either reboot or do this to reload the windows dnscache

Start a command windows using "Run as Administrator" and execute these 2 commands to reload the cache

net stop dnscache
net start dnscache

Now you can use the correct domain name from the browser on the non-wampserver pc like so

http://petsy.dev

And the browser will find that petsy.dev lives on ip address 192.168.1.16. When the connection is made with 192.168.1.16 it will be using the corretc domain name i.e. petsy.dev and apache will find the virtual host and set everything as per the VH config and server pages from the correct folder.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • Hi RiggsFolly, I tried, I think I unfortunately tried everything but I really cannot get wampserver 2.5 working in case of remote access using the wamp id address like http:// 192.168.1.16/petsy.dev or http://192.168.1.16/www.petsy.dev or I don't know what else... – fralbo Dec 06 '14 at 13:29
0

here is a great tutorial
Project Links do not work on Wamp Server
Answer #1 worked for me
I'm running windows 7 64 bit
I have wampserver2.5 (64 bit) installed on a hd assigned to letter A
All my dev sites are located on A:\websites
In A:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf I have this

<VirtualHost *:80>
    DocumentRoot "A:/websites"
    ServerName localhost
    ServerAlias localhost
    <Directory "A:/websites">
        AllowOverride All
        Require local
    </Directory>
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost.log" common
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "A:/websites/example.dev/www
    ServerName example.dev
    ServerAlias www.example.dev
    <Directory "A:/websites/example.dev/www>
        AllowOverride All
        Require local
        Require ip 192.168.10
    </Directory>
</VirtualHost>

On the computer running wamp I adjusted the host file as follows
127.0.0.1 example.dev
::1 example.dev
On the local remote computer I've added an entry to the host file as
192.168.10.100 example.dev (this is the ip address of the computer running wamp)
next step is to clear your dns cache
open a terminal on the windows box that's not the web server
type "net stop dnscache"
type "net start dnscache"
Open a browser and point it to example.dev and it works
hope this helps

Community
  • 1
  • 1