Can't access wiki site through other computers on my LAN
Posted by: Bradmack15 (---.pppoe-dynamic.High-Speed.ns.bellaliant.net)
Date: June 17, 2013 12:51PM

I am trying to set up an internal wiki site for my company. Product info, specs that sort of thing. I have downloaded and installed WAMP Server 2.2 (Apache 2.2.22 MySQL 5.5.24 PHP 5.3.13) as well as the newest version of the mediawiki software on my Windows XP SP3 machine. Installation went fine. I now have the directory c:\wamp\www\fpswiki and i can access the wiki site through:

htp://localhost/fpswiki

htp://computername/fpswiki

htp://computerip/fpswiki

but only from the server machine on which WAMP Server and Mediawiki are installed.

I have the firewall off and port 80 open (redundant i think) on both the server and the computer I'm using to test.

I have also tried changing the allow statements in the apache configuration file httpd.conf. I have tried:

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from all
</Directory>

and,

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.0.0
</Directory>

Neither of which worked. On the test computer I don't get an error message, just "Internet Explorer cannot display the webpage" and a Diagnose button that does nothing useful when pressed.

What I can see from the test computer are .php files in the www folder. I can also get to the WAMP Server splash screen through the browser on the test computer by typing in the server computer name or ip. Most interestingly (I think anyway) is that I can get all the info from the wiki page in an unformatted style by going to:

htp://computername etc../fpswiki/index.php/Main_Page

it just pops up in the browser.

Ive been reading about this for 3 days and have also gotten this far using XAMPP and EasyPHP. My WAMP Server is in online mode and the icon is green.

I have no need to broadcast this to the outside internet. I only want it to be accessible to computers on our network as it will be used for internal employee reference only.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: RiggsFolly (---.as13285.net)
Date: June 17, 2013 02:30PM

Try undoing the changes you made to the <Directory /> section

Try adding a new <Directory> section like this to allocate security/access to your wiki specifically.


<Directory "d:/wamp/www/fpswiki">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.0
Allow from 127.0.0.1
</Directory>

Add this after the <Directory "d:/wamp/www/"> section

Note: Allow from 192.168.0 only has 3 of the 4 quartets thus allowing access from any ip in the 192.168.0 subnet

Allow from 127.0.0.1 allows access from localhost as currently.


If you do this and replace the 'Deny from all' on <Directory /> then you keep your root C:\ folder secure. With Allow from all anybody could ( if they knew enough) get to your C:\ drive.
and <Directory "d:/wamp/www/"> should be
Deny from all
Allow from 127.0.0.1

this will keep the wamp homepage secure from prying eyes.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: Bradmack15 (---.pppoe-dynamic.High-Speed.ns.bellaliant.net)
Date: June 17, 2013 03:27PM

Thanks! That seems to do something. I am now getting a message on the test computer that says HTTP 403 Forbidden. Explorer says it is connected to the website but does not have permission to view it.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: RiggsFolly (---.as13285.net)
Date: June 17, 2013 04:41PM

Point 1. You may need to add 'Indexes' to the Options param

Options FollowSymLinks Indexes

Point 2. What address are you putting into the browser on the test machine?

I think you should be using 'http://192.168.0.X/fpswiki' , where X is the final quartet addressing the wamp box.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: Bradmack15 (---.fpsmedia.ca)
Date: June 17, 2013 05:27PM

In the <Directory "c:/wamp/www"> section i have;

<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
# [httpd.apache.org]
# 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.
#

# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all

</Directory>

after which I have added;


<Directory "c:/wamp/www/fpswiki">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.0
Allow from 127.0.0.1
</Directory>

Like you suggested.

Since the ip address of the server is in the 192.168.1.X subnet and the test computer is in the 192.168.2.X subnet I have also tried

<Directory "c:/wamp/www/fpswiki">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.0
Allow from 192.168.1
Allow from 192.168.2
Allow from 127.0.0.1
</Directory>

In the address bar of the test computer I have tried the following;

'http://192.168.1.X (server ip)/fpswiki'
'http://hpdesktop(server name)/fpswiki'

both give me the same HTTP 403 Error.

Thanks for helping me out.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: Bradmack15 (---.fpsmedia.ca)
Date: June 17, 2013 05:46PM

I have also just tried adding

Options FollowSymLinks Indexes

in the <Directory "c:/wamp/www/fpswiki">
section.

Still getting the 403 Error.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: RiggsFolly (---.as13285.net)
Date: June 17, 2013 06:37PM

Have a look in the apache error log.

Is it giving the 403 errors for an ip address from the IPV6 range rather than the ipv4 range?

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: Bradmack15 (---.pppoe-dynamic.High-Speed.ns.bellaliant.net)
Date: June 18, 2013 12:40PM

Hi Riggs,

From the apache error log I get this. The client ip being the address of my test computer.

[Tue Jun 18 06:32:08 2013] [error] [client 192.168.2.XX] client denied by server configuration: C:/wamp/www/fpswiki/


And from the access log I get this. Again, the ip is from the test machine.

192.168.2.XX - - [18/Jun/2013:06:32:08 -0300] "GET /fpswiki/ HTTP/1.1" 403 210

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: RiggsFolly (---.as13285.net)
Date: June 18, 2013 02:49PM

I am running out of ideas.

I must admit I would have created a Virtual Host for the wiki application, that could still be possible but as I dont know what you or the wiki may do if its location were change its difficult to recommend that as a possible solution.

Are you allowed to run Team Viewer so I could have a closer look at whats actually going on?

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: Bradmack15 (---.fpsmedia.ca)
Date: June 18, 2013 04:56PM

I've done a few things this morning.

First I tried a fresh install on WAMP Server. No Luck. It actually gave me quite a bit of trouble. I ended up having to put "Allow from all" statements in the httpd.conf file just to get it to work on the server. I know this isn't really what I want to be doing but I am not concerned with security at the moment.

Now if i try to access the wiki using the server ip or computer name, in the browser on the server machine, I get 'Forbidden You don't have permission to access /fpswiki/ on this server.' Very frustrating!

I have made the necessary alterations in the conf file to no avail. Even if i specify the server ip address it still wont go.

I am now using Chrome on the test machine (rather than iexplorer). I get the same error as above when trying to access using either 'http://server ip/fpswiki' or 'http://server name/fpswiki'

At this point I am just trying to see if this will work at all so I am open to using a Virtual Host as a solution. Only problem is I have no idea what I would be doing. Also Team Viewer is not an option.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: RiggsFolly (---.as13285.net)
Date: June 18, 2013 08:29PM

HowTo: Create Virtual Hosts in WAMP

BEFORE DOING ANY OF THIS PLEASE ENSURE APACHE AND MYSQL ARE WORKING PROPERLY FIRST!!!

1. Create a new folder outside the wamp directory structure.
for example
C:\websites
but this can be on any disk drive visible to the PC running wamp


2. Create a subfolder in c:\websites for each site you want to create.
for example:
C:\websites\site1
C:\websites\site2


3. Edit the file C:\wamp\bin\apache\apachex.y.z\conf\extra\httpd-vhosts.conf
where x,y and z are the version numbers of apache that you actually have installed.

NOTE: If you are switching between 2 or more versions of apache this will have to be done to all your versions of apache in turn.

SUGGESTION: I like to use the format sitename.dev to make it obvious to me that I am dealing with my localhost development copy of a site, you may prefer another notation, thats ok, the word dev has no actual defined meaning in this case, its just my way of naming my development versions of a live site.

NOTE: Remove ot better still comment out ( using the # in column 1 ) the lines that already exists in this file. They are just examples.

example contents:
	#
	# Use name-based virtual hosting.
	#
	NameVirtualHost *:80

	## must be first so the the wamp menu page loads when you use just localhost as the domain name
	<VirtualHost *:80>
    	DocumentRoot "C:/wamp/www"
    	ServerName localhost
    	ServerAlias localhost
    	<Directory  "C:/wamp/www">
			Order Deny,Allow
    		Deny from all
    		Allow from 127.0.0.1
			# You would never want a remote user to see this wamp config page.
		</Directory>
	</VirtualHost>


	<VirtualHost *:80>
	    DocumentRoot "C:/websites/site1"
	    ServerName site1.dev
	    ServerAlias www.site1.dev
	    Options Indexes FollowSymLinks
	    <Directory "C:/websites/www/site1">
			AllowOverride All
			Order Deny,Allow
			Deny from all
			Allow from 127.0.0.1
		    #If you want to allow access from your internal network
		    # For specific ip addresses add one line per ip address
		    #Allow from 192.168.0.100
	    	# For every ip in the subnet, just use the first 3 numbers of the subnet
	    	#Allow from 192.168.0
	    	# If you want to allow access to everyone
	    	#Allow from all
		</Directory>
	</VirtualHost>

Add as many <VirtualHost> as you require so each of your sites have one, changing the DocumentRoot, ServerName and any other of the parameters as appropriate.
This also allows you to make SITE SPECIFIC changes to the configuration.

NOTE: This will make the wamp manager "Put Online" function no longer have any effect on these new vhost'ed sites as the security for each one is now part of the vhost definition, so leave WAMP, OFFLINE.
If you want to put one or more sites online you will have to change the Allow commands MANUALLY in the httpd-vhosts.conf file.

To check your subnet do the following:
Launch a command window, and run
    >ipconfig
Look for the line "Default Gateway" in the output and use the third number in your Allow commands.


4. Edit your httpd.conf file and search for these lines, they are near the bottom of the file.
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

Remove the '#' comment character on this line to Include your newly changed vhosts, this will cause apache to register their existance.
eg
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

5. While still editing your httpd.conf file search for
	#   onlineoffline tag - don't remove
	    Order Deny,Allow
	    Deny from all
	    Allow from 127.0.0.1

	</Directory>
DO NOT CHANGE THESE LINES!

Add the following after the <\Directory> tag to secure your new C:\websites folder.

<Directory "C:/websites/">
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

This is to set security on your new directory structure so that access to these new sites is only allowed from 127.0.0.1 (localhost) unless amended from within a specific VHOST.
P.S. Your internal network will probably be something like 192.168.x.y, check your system first!


6. Now in order for your browser to know how to get to these new domain names i.e. site1.dev and site2.dev, we need to tell windows what IP address they are located on. There is a file called HOSTS that is a hangover from the days before Domain Name Servers (DNS) were invented. It is a way of giving nice easy rememberable names to IP address's, which of course is what DNS Servers do for us all now.

Edit your HOSTS file, this can be found in C:\windows\system32\drivers\etc , the file does not have an extension.
Windows protects this file so you must be an Administrator to be allowed to save changes to this file.

If you are using VISTA or Windows7/8 you may think you are an Administrator BUT YOU ARE NOT!!!!
So to edit this file you must launch your editor, or Notepad in a specific way to gain Administrator rights. To do this find your editors icon and launch it using the following key strokes:
Shift + Right Click over its icon, this will display a menu, click the item "Run as Administrator", and click "Allow" on the challenge dialog that will appear.

Now you are ready to edit the hosts file so navigate your editor to c:\windows\system32\drivers\etc\hosts

Add the following lines to this file

   127.0.0.1   site1.dev
   127.0.0.1   site2.dev
NOTE: You will need to add one line in this file for each of your new virtual hosts.


7. In order for Apache to pick up these changes you must bounce ( stop and restart ) apache.
Do this by: Wamp manager -> Apache -> Service -> Restart Service


You should now be able to use the address site1.dev in your browser to get to your new sites.
Copy your sites code into the "C:/websites/xxxx" folder if you already have a site coded or,
place a quick and simple index.php file into the "c:\websites\xxxx" folder to proove it all works.

example:
   <!DOCTYPE html>
   <html lang="en-US">
   <head>
   <meta charset="UTF-8">
   <title>SITE1</title>
   </head>
   <body>
   <?php
        echo '<div style="background-color:red;color;white;text-align:center;font-size:18px">HELLO FROM Site1</div>';
   ?>
   </body>
   </html>



TROUBLE SHOOTING:
If you have used the new domain name ( site1.dev ) and it has not found the site.
a. Check the changes to the hosts file.
b. Restart the "DNS Service" that runs in windows. This caches all doman names that you use in a browser so that the browser does not have to query a DNS Server each time you re-use a domain name. This may have cached your failed attempt but a restart is easy and should solve the problem and is quicker that re-booting windows, which should also work.
To do this launch a command window as an Administrator ( Shift + Left Click over the command window icon ) and run these 2 commands.

>net stop "DNS Client"
>net start "DNS Client"
Note: The quotes are required as there is a space in the services name.

Options: ReplyQuote
Re: Can't access wiki site through other computers on my LAN
Posted by: AntPe (---.transtelco.net)
Date: March 24, 2015 10:49PM

It's been awhile since the question was made, but this worked for me, the problem is in the wiki config side no in the apache config side,
In the LocalSettings.php file in the MediaWiki folder locate these lines:

## The protocol and server name to use in fully-qualified URLs
## Change from local to servername:<port>
$wgServer = "[localhost"];;

change this "[localhost"]; to $wgServer = "[];;

in my case I am using the 81 port

No need to restart the services just reload the Wiki page.

Options: ReplyQuote


Sorry, only registered users may post in this forum.