0

I'm having no luck finding this question answered so I'm asking this myself.

To get my VHost working, I followed this answer. My (working) "httpd-vhosts.conf" file looks like this

<VirtualHost *:80>
    ServerAdmin jesuscc1993@gmail.com
    DocumentRoot "Z:/Projects/Web/MetalTxus Site"
    ServerName metaltxus.test
    ServerAlias www.metaltxus.test
    <Directory "Z:/Projects/Web/MetalTxus Site">
        #Options FollowSymLinks
        Options Indexes FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

As far as I know, I should change "Indexes" with "-Indexes" to make the web load "index.html" instead of the web directory.

However, when I did that, my WAMPServer wouldn't start. It would if I removed "FollowSymLinks" option but then all I got was a "403 - Forbidden" page ("you don't have permission to access "/" on this server").

As looking for a solution got me nowhere, I used this as my last resource.

I'm using latest WampServer version in Windows 8.1. I want to test an AngularJS application.

If you need any more information, go ahead and ask.

Community
  • 1
  • 1
Jesús Cruz
  • 192
  • 2
  • 18

1 Answers1

1

Try this :-

<VirtualHost *:80>
    ServerAdmin jesuscc1993@gmail.com
    DocumentRoot "Z:/Projects/Web/MetalTxus Site"
    ServerName metaltxus.test
    ServerAlias www.metaltxus.test
    <Directory "Z:/Projects/Web/MetalTxus Site">
        AllowOverride All
        Options Indexes FollowSymLinks
        Require all granted
    </Directory>
</VirtualHost>

The Require all granted is Apache 2.4 syntax where you were using Apache 2.2 syntax when using

Order deny,allow
Allow from all

Now all you need to do is place a file called index.html or index.php in the "Z:/Projects/Web/MetalTxus Site" folder.

I would suggest removing the space in the folder name MetalTxus Site its not absolutely necessary but it removes another possible complexity.

Also if you dont actually mean to give access to the site to The Universe try using

Require local

And if you want to be able to access the site just from other PC's on your internal network use

Require local
Require ip 192.168.1  

ADDITIONAL SUGGESTION:

Also check httpd.con has thi sline uncommented

LoadModule dir_module modules/mod_dir.so

An has this

<IfModule dir_module>
    DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • Tried with: ` ServerAdmin jesuscc1993@gmail.com DocumentRoot "Z:/Projects/Web/MetalTxus" ServerName metaltxus.test ServerAlias www.metaltxus.test AllowOverride All Options Indexes FollowSymLinks Require local ` It works exactly the same as before. Using `Options -Indexes` still gives me `Forbidden You don't have permission to access / on this server.` – Jesús Cruz Jun 05 '15 at 21:09
  • If `index.html` exists in the correct folder it will be run instead of doing a directory listing. so either `index.html` is not its real name or its in the wrong folder. If you use notepad to edit this file its probably actually called `index.html.txt` turn on full extension view in explorer. – RiggsFolly Jun 06 '15 at 22:46
  • It's got the proper name and extension. It works fine in [the online server](http://metaltxus.altervista.org/). Here's a [screenshot of what the directory on local looks like](http://i63.photobucket.com/albums/h151/MetalTxus/directory.gif). – Jesús Cruz Jun 07 '15 at 08:50
  • The web on the server is an old version without angular though. The important fact is that it's loading `index.html`. – Jesús Cruz Jun 07 '15 at 09:12
  • It's got both features enabled. – Jesús Cruz Jun 07 '15 at 14:23
  • My fault. I dunno what I was doing wrong but after playing for a bit with the settings I got it working with the ones you provided. – Jesús Cruz Jun 10 '15 at 13:07