Saturday, August 29, 2009

EasyPHP VirtualHost for Eclipse PDT on Windows

I use eclipse PDT for my PHP development, and EasyPHP as the server on Windows.

And each time I want to set up a VirtualHost for it, I get misled by a forbidden message that I interpret to come from the Windows file permissions.

Here are the instructions to set up a VirtualHost on eclipse.localhost, allowed only from localhost, with directory listing enabled, that I grabbed from a few places.

  1. Add the following line to C:\windows\system32\drivers\etc\hosts :
    127.0.0.1 eclipse.localhost
  2. Add the following to C:\Program Files\EasyPHP 3.0\apache\conf\httpd.conf :
    <VirtualHost 127.0.0.1:80>
      DocumentRoot "C:/Users/xavier/workspace"
      ServerName eclipse.localhost
      <Directory "C:/Users/xavier/workspace">
        Options Indexes
        Order Allow,Deny
        Allow from all
      </Directory>
      ErrorLog "C:\Program Files\EasyPHP 3.0\apache\logs\eclipse.localhost.log"
    </VirtualHost>

The permissions problem, in my case, came from the listing of the directory being disabled by default.

Hope this helps some.

No comments:

Post a Comment