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 [email protected]
    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.

1 Answer 1

1

Try this :-

<VirtualHost *:80>
    ServerAdmin [email protected]
    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>
Sign up to request clarification or add additional context in comments.

6 Comments

Tried with: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "Z:/Projects/Web/MetalTxus" ServerName metaltxus.test ServerAlias www.metaltxus.test <Directory "Z:/Projects/Web/MetalTxus"> AllowOverride All Options Indexes FollowSymLinks Require local </Directory> </VirtualHost> It works exactly the same as before. Using Options -Indexes still gives me Forbidden You don't have permission to access / on this server.
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.
It's got the proper name and extension. It works fine in the online server. Here's a screenshot of what the directory on local looks like.
The web on the server is an old version without angular though. The important fact is that it's loading index.html.
It's got both features enabled.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.