You don't have permission to access /test on this server.
Posted by: JudgedCurtis (2.30.203.---)
Date: June 18, 2016 04:53PM

I've started using WAMPserver, it works fine from the host PC, but any other PC on the same network will get the following error message.

"You don't have permission to access /test on this server."

"Apache/2.4.17 (Win64) PHP/5.6.16 Server at 1**.***.*.** Port 80"

how do I make it so that other computers on the network can access the website?

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: Otomatic (Moderator)
Date: June 18, 2016 05:25PM

Hi,

You need to use VirtualHost : The need for Virtual Host
With Wampserver 3.0.4 this will be done with three clicks : Wampserver 3 - Create or add a VirtualHost

then you allow the IP of network stations to access one or more VirtualHost like this:
<VirtualHost *:80>
   ServerName mydomain
   DocumentRoot "path_to_domain"
  <Directory "path_to_domain/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    <RequireAny>
      Require local
      Require ip xxx.xxx.xxx.xxx
    </RequireAny>
  </Directory>
</VirtualHost>
See [httpd.apache.org]

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 06/18/2016 05:30PM by Otomatic.

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: JudgedCurtis (2.30.203.---)
Date: June 18, 2016 05:57PM

After I followed that guide, I couldn't even go onto the website on the host computer.

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: Otomatic (Moderator)
Date: June 18, 2016 06:51PM

Hi,

Please, post here the contents of:
- C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file
- C:/windows/system32/drivers/etc/hosts file
- Result of Right-Click Wampmanager Tray icon -> Tools -> Show VirtualHost examined by Apache

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: JudgedCurtis (2.30.203.---)
Date: June 18, 2016 07:10PM

C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file: [pastebin.com]

I haven't edited the hosts file yet. Is that part needed to access on the same PC?

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: JudgedCurtis (2.30.203.---)
Date: June 18, 2016 10:46PM

by the way when connecting from another PC, i've been using my ip on the network.

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 19, 2016 12:17AM

Before I go any futhere, I'd like to go back to you original question, you said you were getting the error message:

"You don't have permission to access /test on this server."

Exactly what are you entering in the browser address bar?

When I have seen that message about permission, it is when I enter a URL for a directory on a server in which there is no default file - index.html, index.htm, index.php, etc.

The server is telling you that it is configured to NOT provide directory listings of web site directories. If there is not default file, and a file name is not specified in the URL, it assumes you want a listing of the directory contents and forbids it.

Go to [wp-mytake.com]

You will get the same sort of error but for just the / directory. That is a site I'm working on, the domain exists, points to the correct location on the hosting server, but I am testing things under a sub diredtory and the root directory is empty - there is no default file in the directory.

Just to double check - is there a default file in that /test directory? Is there an index.html or default.html or one of the names this page -> [support.tigertech.net] page speaks of?

It would appear that the /test directory exists, but is there a default file in it? Again, what are you entering in to the browser address bar?

Just a thought -

=== Now on to my response to your latest reply:

What do you mean when you say:

"After I followed that guide, I couldn't even go onto the website on the host computer."

I assume "host" computer refers to the computer on which WAMP is installed - correct?

What steps of the "guide" did you perform? If you are running WAMP 3, did you use the instructions in the post Otomatic pointed you to - [forum.wampserver.com]

Did you make the changes manually?

You say you can't you can go onto the website on the host computer- what happens when you try?

Please give details when you say something like that, none of us are psychics and there are far too many possible errors and messages from any action on a computer for us to guess what is happening.

Exactly what happens when you try to go to the site on your via your local computer?


A virtual host is the preferred way to access a web site under WAMP on a local machine and I suspect, but can't confirm, that it may be the only way to access a WAMP hosted site on another computer.

If you are running WAMP 3, you can make a virtual host very easily. Go to this post and read it [forum.wampserver.com]

Here are the steps described differently:

1 - You must know the complete path to the web site. If it is stored under say, C:\wamp\www\mywebsite - that is the complete path, the path you would use to access the site's file via, for example, Windows Explorer.

2 - You must choose a virtual site name - like mywebsite.com

3 - Left click the WAMP icon in the Windows system tray (the right hand side of the Windows taskbar).

4 - Click Localhost in the menu that appears which you click the WAMP icon.

5 - The "Localhost" (I think of it as the WAMP local "home" page) page will be opened in your browser.

6 - On the left hand side, almost at the bottom, you will find a section titled "Tools", under that will be a link titled "Add a Virtual Host" - click that link.

7 - The "Add a VirtualHost" page will open. There are two text boxes on the window which you must fill in correctly.

8 - The first one is where you put the name of the virtual host, the "domain name" if you like. If you want to be able to enter mywebsite.com in the browser address bar to get to your site, then type mywebsite.com into the box on the Add VirutalHost window.

9 - The second text box is where you put the full path to the web site. Enter it as I discussed in step #1

10 - Click the very wide button labeled "Start the creation of the VirtualHost (May take a while...)" , located at the lower right hand corner of the Add Virtualhost window and wait.

11 - If the virtual host is successful a new window will open telling that and telling you that you need to restart the DNS. Do so by right clicking the WAMP icon, click Tools, and then Click Restart DNS -- it is the topmost menu item. Wait for the WAMP icon to go to red, then orange, and back to green and your virtual host should be ready for use.

If the vitural host is not successfully created, I assume some message will be displayed - I don't know because the operation has never failed the several times I've used it.

Once the virtual host is created, you can go to the site by typing, using the example, mywebsite.com OR you can go there via the WAMP icon - left click the icon, click Your Virtualhosts and then click the one you want to access.

******************* REMEMBER - the "automated" method of creating virtual hosts is ONLY available on WAMP 3 or higher.

If you are running an older version, I strongly suggest you consider install in WAMP 3. As I understand it, you have to uninstalled earlier versions before installing version 3 but I've installed 3 on this system to start with.

If you have to un-install the older version, it would follow that you must backup your web site files (if they are in a directory under the WAMP root) and export your databases using phpMyAdmin so that you can import them into the new WAMP 3 installed MySQL = these backups must, of course, be made before you un-install the current WAMP installation.

There may be other necessary steps to move from an older version of WAMP to the current version but I'm not sure - you need to check carefully before un-installling the old version and then be careful when installing the new version.

************** If you manually edited the virutal hosts file to create a virtual host - you will have to wait for Otomatic to look at the filies you uploaded to [pastebin.com] and reply to you.

I don't know enough about the manual creation method to be of any assistance to you.


********************** Regarding accessing a WAMP hosted site on a different computer on a network.

Let's say that WAMP and the site you want to access are on a computer named A and is on a network on which there is a computer named B.

If you want to access a WAMP hosted web site which resides on A from comptur B, the DNS that the Internet browser on B uses would have to have an entry for the site hosted on A.

Without that, how would the browser on A be able to get the IP address and thus send a request to the proper server - in this case, on A?

I do not know enough about the DNS matters to now exactly what would need to be done to setup a DNS for the site on computer B to offer any suggestions.

You can, of course, can go to a web site, on the internet, via it's IP address, but what would be the IP address of a site hosted on a WAMP server??

The DNS is used by the browser to get the IP address because in the final analysis the IP address of the site (not just the server) must be known to access files at that web site on computer A.

I don't know enough to be able to take those thoughts beyond the conjecture stage - sorry.

I do know, however, that computer B's browser has to get the IP address of the web site hosted on computer A in order to access that web site - whether by the user entering an IP or by the user entering a URL and the browser using a DNS request to get the IP address.

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: JudgedCurtis (2.30.203.---)
Date: June 19, 2016 02:04AM

On the host (yes the one running the WAMP server) PC I enter localhost/test

On Other computers on the same network, I will enter my ipv4, with the /test after.

The message I'm getting on both the host and other computers on the network is: "You don't have permission to access /test on this server." "Apache/2.4.17 (Win64) PHP/5.6.16 Server at localhost Port 80"

There is an index.htm file in my /test directory.

and the changes were made manually.

The instructions i followed was 1 and 2 on the need for a virtual host.

Options: ReplyQuote
Re: You don't have permission to access /test on this server.
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 19, 2016 03:49AM

Reread my long reply to you - print it out if it will make it easier to read.

You didn't answer my questions about what is now happening after you "followed the guide" and can't get to the site locally - Detail please.

If you are entering localhost/test you are not using a virtual host to access the site.

Reread my long post and create a virtual host using the link on the WAMP localhost page.

If you are not running WAMP 3 - backup everything you have put in WAMP directories, export your databases, un-install WAMP and install WAMP 3.

Put your files back where they were, import your databases, and then create a virtual host and use it to access your site.

If you followed the steps I gave you and created a virutal host, my example was mywebstite.com, you could go to your browser, at least locally, and enter mywebsite.com to go to the site.

Where did you put your index.html file - what is the complete path to it? User Windows Explorer (not Internet Explorer - two different things) to get the full path.

Find the directory in Windows Explorer and click on it in the left hand folders list.

There is a long box at the top of Windows Explorer which shows the path - to get the exactly, complete, fully qualified path, click in that box at the far right end of the box. The display will change to an actual path.

That is the exact path to the the site.

What is it? Copy and paste it into a reply to me.

Is it something like c:/wamp/www/test or c:/wamp64/www/test?

I think \wamp is the directory for WAMP 32 bit and /wamp64 is for the 64 bit version.

What is the path where you put the site?

It sounds to me that you put the site in a subdirectory of WAMP's www directory - correct?

You named the directory \test - right?

Well, if you correctly create a virtual host, named mywebsite.com in my example, all that you have to enter, at least locally, is mywebsite.com -- for that matter, if the DNSs are set up correctly, that is all you should have to enter on a computer on your network.

That is all you'd enter, nothing more, that should take you to your "\test index file"

As regards remote access - as I said before, the DNS used by the browser on the remote computer must have an entry for mywebsite.com so that the DNS can return the IP address to the browser when it makes the DNS lookup request to find out how to get to mywebsite.com

Does DNS - the Domain Name Server - for your network have an entry in it for name of your virtual host.

I may be explaining something you already know, but maybe not:

When you tell the browser to go to a web site - by entering the URL in the address bar or by clicking a link, the browser creates a DNS lookup request and transmitts that request the the DNS the browser is configured to use. The DNS looks in its database for a site with the name provided by the browser.

If there is a name, the DNS returns the IP address for that URL to the browser. The browser then uses that IP to access the site.

If there is no entry for the URL in the DNS database, the DNS returns request response 404 and the browser displays some sort of message telling you it "can't find the server." People can change what sort of 404 messages are displayed and the differ from browser to browser.

Assuming that you get a virtual host correctly create on your computer, under WAMP, you would enter the name of that vitural host (like the mywebsite.com example) and the browser will do a DNS lookup, the local DNS (which WAMP installed) will find the name and give the browser the IP address.

If you enter the virtual host name on a remove computer, the DNS being used has to have an entry in its database for that URL. Without it you will get 404 errors.

I don't know what to do to make your network's DNS know where mywebsite.com is located - that is, the IP address.

I may be going to seem rude again - is the "network" you are talking about at a business? If so, are you an IT person responsible for the network or are you an employee just trying to set up a website on their computer and allow other employees to access it?

If it is a business network and you are not an IT employee, I suggest you stop what you are doing and turn to an IT employee for assistance. You may be violating company rules regarding network use and web site access.

If this is a personal network, well, follow my instructions and we will see if we can fix this bloody thing.

Have you Googled about tis?

Try the pages found by this search: [www.google.com]

Maybe one will contain something to help you. Look at the other pages of that search result. Change the keywords and try searching on other ways to describe the issue.

If there is any of this you don't understand - as me specific questions about it.

Closing remarks, not meant rudely -

When anyone asks a question on a forum like this, they need the full details of the answer. Not vague, non technical answers. If you are seeing some sort of message - give the complete text, even if you have to grab a pencil and paper to write it down before entering it in a response.

We get nothing from your saying:

"After I followed that guide, I couldn't even go onto the website on the host computer."

Tell us what is happening, are you seeing error messages, is your computer sticking out its tongue at you and saying "NO!"

What "guide?" What steps in the guide? What is happening? Be specific.

My crystal ball is in the shop for its 10,000 hour overhaul.

What is happening - I'm not physic and I don't think anyone else on this forum is.

Options: ReplyQuote


Sorry, only registered users may post in this forum.