Hello,

I am searching the net for hours now trying to find a solution to my problem, found tutorials and forums posts but can't solve my problem.

Please help.

windows 7, WAMP 2.2 (apache 2.4.2)

Trying to set up a virtual host outside of the wamp directory getting the error:
You don't have permission to access / on this server.

What I have now:
directory: c:\sites
Permissions:
Full Control:
Authenticated Users
SYSTEM
Administrators(MYUSERNAME\Administrators)
Users(MYUSERNAME\Users)

In my httpd-vhosts.conf file, under:

<VirtualHost *:80>
    DocumentRoot "C:/sites/highland"
    ServerName highland.local
    Options Indexes FollowSymLinks
</VirtualHost>

In my httpd.conf file:

DocumentRoot "c:/wamp/www/"
<Directory "c:/wamp/www/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    # Online --> Require all granted

    #   onlineoffline tag - don't remove

    Require local

</Directory>

DocumentRoot "c:/sites/"
<Directory "c:/sites/">
    AllowOverride All
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

In my hosts file:
127.0.0.1 highland.local

What am I doing wrong?

Go to C:\wamp\alias. Open the file phpmyadmin.conf and change

<Directory "c:/wamp/apps/phpmyadmin3.5.1/"> // This depends on the version of php u r using
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

TO

<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Allow,Deny
    Allow from all
</Directory>

I hope thet works out for you

Hi,
Sorry saw your answer only now. Didn't help.

Posting what I did again as I am trying to do it for a few days now and the situation might have changed:

I am trying to create Virtual hosts for 3 days now.

I even managed to break WAMP totally and had to reinstall it.

I read lots of tutorials and forum posts.

Nothing works !!!

PLEASE HELP ME

Windows 7, WAMP 2.2e

I have 2 local sites, ruthrudincom and thinklocal.
If I leave them both in wamp/www - ruthrudincom is working thinklocal gives me access denied.
Thinklocal is developed with codeigniter and has htaccess file.

If I move them to c:/www none is working - access denied. (I went to c:/www and gave all permissions to all users)

My files:
httpd_conf:

<Directory "c:/wamp/www/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    # Online --> Require all granted

    #   onlineoffline tag - don't remove

    Require local

</Directory>
<Directory "c:/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory> 

hosts file I added these lines:
127.0.0.1 ruthrudincom.dev
127.0.0.1 thinklocal.dev

httpd_vhosts: (DocumentRoot tried with wamp and without wamp)

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@ruthrudincom.dev
    DocumentRoot c:/wamp/www/ruthrudincom
    ServerName ruthrudincom.dev
    ErrorLog "logs/ruthrudincom.dev-error.log"
    CustomLog "logs/ruthrudincom.dev-access.log" common
</VirtualHost>

#Think local
<VirtualHost *:80>
    ServerAdmin admin@thinklocal.dev
    DocumentRoot c:/wamp/www/thinklocal
    ServerName thinklocal.dev
    ErrorLog "logs/thinklocal.dev-error.log"
    CustomLog "logs/thinklocal.dev-access.log" common
</VirtualHost>

The htaccess file:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    #RewriteCond $1 !^(index\.php|assets|images|robots\.txt|captcha|favicon\.ico)
    #RewriteRule ^(.*)$ /thinklocal.dev/index.php/$1 [L]  


    # Send request via index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    RewriteRule ^(.*)$ /index.php?/$1 [L]   
</IfModule>

Please, can someone help?

I evern tried installing php, mysql, apache by themeselves with no WAMP, nothing works.

As suggested before you have to enable the reading of .htaccess, so inside Thinklocal add:

#Think local
<VirtualHost *:80>
    ServerAdmin admin@thinklocal.dev
    DocumentRoot c:/wamp/www/thinklocal
    ServerName thinklocal.dev
    ErrorLog "logs/thinklocal.dev-error.log"
    CustomLog "logs/thinklocal.dev-access.log" common

    <Directory /> # relation with DocumentRoot
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All # allow .htaccess
        Order allow,deny
        Allow from all
    </Directory>

    # prevent remote access to .htaccess and .htpasswd
    <FilesMatch "^.ht">
        order allow,deny
        deny from all
    </FilesMatch>

</VirtualHost>

You can do the same with ruthrudincom.dev, once edited reload the server and it should work. Bye!

cerel, thanks but adding your code just makes the Apache server stop working.

Restarting WAMP, and apache does not start and there is no error in the error log file.

I tried 3 ways:
<Directory /> # relation with DocumentRoot
<Directory "c:/wamp/www/thinklocal"> # relation with DocumentRoot
<Directory c:/wamp/www/thinklocal> # relation with DocumentRoot

Unfortunately I cannot access to a Windows box to try WAMP by myself, however the suggested configuration is working well for me on linux. Just try to test the config removing all the comments, or test thinklocal.dev alone:

NameVirtualHost *:80
Listen 80

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "C:/wamp/www"
    ServerName localhost
    ServerAlias localhost
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@ruthrudincom.dev
    DocumentRoot c:/wamp/www/ruthrudincom
    ServerName ruthrudincom.dev
    ErrorLog "logs/ruthrudincom.dev-error.log"
    CustomLog "logs/ruthrudincom.dev-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@thinklocal.dev
    DocumentRoot c:/wamp/www/thinklocal
    ServerName thinklocal.dev
    ErrorLog "logs/thinklocal.dev-error.log"
    CustomLog "logs/thinklocal.dev-access.log" common
    <Directory />
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    <FilesMatch "^.ht">
        order allow,deny
        deny from all
    </FilesMatch>
</VirtualHost>

Make sure that logs directory exists under the declared ServerRoot and has write permissions.

So, while waiting for help by others members, all I can do is to suggest you to post the complete httpd_vhosts and troublueshooting to get some output from Apache, you can try to run Apache manually, by opening the command prompt (Start > Run > cmd.exe) as Administrator and running httpd.exe:

httpd.exe -S
httpd.exe -t -D DUMP_VHOSTS

The command httpd.exe can be found somewhere under the installation "Wamp directory\...\bin", but you can also use dir to get the correct path: dir /s httpd.exe

The first command will:

Show the settings as parsed from the config file (currently only shows the virtualhost settings).

The second instead:

Run syntax tests for configuration files only. The program immediately exits after these syntax parsing tests with either a return code of 0 (Syntax OK) or return code not equal to 0 (Syntax Error). If -D DUMP_VHOSTS is also set, details of the virtual host configuration will be printed. If -D DUMP_MODULES is set, all loaded modules will be printed.

Here you can find more information & configuration examples:

Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.