Can't load web page externally.
Posted by: bkboggy (---.socal.res.rr.com)
Date: July 30, 2013 04:25AM

I've having problems getting to view my web page through the global IP address.

I use Windows 8 Pro 64-bit and Arris DG860 router.
I downloaded WAMPSERVER (64 BITS & PHP 5.4) 2.4 and installed Apache service.
I added a virtual server in my router:
Name: HTTP 80-80
Type: Both (UDP & TCP)
Private IP Address: My machine's IPV4 address
Local Port: 80-80
I opened port 80 through my Windows firewall for TCP and UDP under HTTP name.

I changed httpd.conf file fields as follows:

# Controls who can get stuff from this server.
#
# Require all granted
# onlineoffline tag - don't remove
Order Deny,Allow
# Deny from all <---- from this
Allow from all <---- to this
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>


When I type in localhost, my machine's IPV4 address or 127.0.0.1, the page comes up. However, when I type in my global IPV4 address on my Android Droid X Phone, my wife's Android Note 2 Phone or our all-in-one computer in the kitchen, none of them can load the page. At first I thought that it could be an issue with my ports not being forwarded properly... so I turned off firewall on router and windows side -- it didn't work. Something in httpd.conf or other configuration file is not set properly... maybe I missed a step. I haven't had any problems before with streaming videos from my security cameras, so I know that ISP is not blocking streaming traffic for port 80.

Could someone help me out?

Options: ReplyQuote
Re: Can't load web page externally.
Posted by: bkboggy (---.socal.res.rr.com)
Date: July 30, 2013 06:09AM

So.... I don't know what I did, but there was a lot of uninstalling, a lot of messing with httpd.conf... and it works now. What a nightmare, lol

Options: ReplyQuote
Re: Can't load web page externally.
Posted by: denver49 (---.hsd1.co.comcast.net)
Date: August 26, 2013 01:16AM

I would love to know what you ended up with. I attempted to add a virtual server to my wireless router after adding 4 Incoming Windows Firewall rules to allow Ports 80 and 81 for UDP & TCP.

Assigned IP addresses to various devices on my wireless network.

Not sure about Directory settings in httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.0.100
Allow from 192.168.0.101
Allow from 192.168.0.102
Allow from 192.168.0.103
Allow from 192.168.0.104
Allow from 192.168.0.105
</Directory>

Set the same Allow settings for web development Directory
<Directory "c:/apache/htdocs/">

Confusing stuff, especially looking at the Admin panel for the wireless router.

Options: ReplyQuote
Re: Can't load web page externally.
Posted by: bkboggy (---.socal.res.rr.com)
Date: August 26, 2013 02:36AM

I ended up placing port 80 and Wampserver as exceptions into the OS firewall, then configuring my router to open port 80 for server. When both of those didn't work, I uninstalled Wampserver completely, restarted my computer and reinstalled it. I think that did the trick. I'm not sure how that would have any effect, but it did. I hope you can get yours to work. What I will end up doing is dedicated one of my old computers to Ubuntu and doing things the right way, rather than doing it from within my Windows 8 all-purpose pc.

Options: ReplyQuote
Re: Can't load web page externally.
Posted by: denver49 (---.hsd1.co.comcast.net)
Date: August 26, 2013 03:22AM

I finally figured it out, after altering the Listen parameter in httpd.conf

So, from start to finish, for others who might be looking for a solution on Windows 7 Home Premium 64-bit with a recent version of WampServer:

Windows Firewall - add 4 Incoming rules to allow Ports 80 and 81 for UDP & TCP

Wireless Router admin panel - (quasi optional) assign IP addresses to various devices in my household (easy 1-click Assign option under Networking in a D-Link DIR836-L) to eliminate rotating IP addresses depending on which devices are On/Off at the time.

Windows Control Panel >> Networking - clicked my network to find the IP address of the PC with WampServer (192.168.0.100 was assigned by the router).

Edit httpd.conf Listen, ServerName, Order,Allow,deny


Listen 127.0.0.1:80
Listen 192.168.0.100:80

#ServerName localhost:80
ServerName 192.168.0.100:80

DocumentRoot "c:/apache/htdocs/"

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

<Directory "c:/apache/htdocs/">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from All
Allow from 127.0.0.1
</Directory>

Reboot Apache and/or the PC.

Emailed a link containing 192.168.0.100 to my phone


Connected my phone to local WiFi, received the message, clicked the link, and Success, it loaded the page on my development machine just fine.

Fired up my Android tablet and pointed Chrome to [192.168.0.100] and Success, it loaded just great!!!

Now, using Chrome more with the tablet, which bookmarks appear on the tablet due to Chrome synchronization, I found I needed to copy a set of bookmarks and paste 'em as a new group and edit out 127.0.0.1 to 192.168.0.100 so links to local dev files which appear on the tablet work fine.

Wa Hooo!

Options: ReplyQuote
Re: Can't load web page externally.
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: August 26, 2013 05:52PM

This change is not necessary,

Listen 127.0.0.1:80
Listen 192.168.0.100:80

can be returned to Listen *:80, which infact means listen on any ip



This change

DocumentRoot "c:/apache/htdocs/"

Makes me think you are not using WAMPServer or have another Apache installed ( which could be causing your problems )



This change IS ACTUALLY DANGEROUS

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

It actually says, anybody from anywhere has access to your C drive, so hackers will be very happy with you when they find you. Also if you have 'Allow from all' there is no purpose to 'Allow from 127.0.0.1' as well.

The purpose of the original state if this is to STOP anybody accessing your C root drive ( and all its subfolders)

It should be changed back to

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



This is fair enough in its way, except WAMP does not use this folder, but as a place for your vhost it is as good as any, appart from the confusion factor.

Again if you have 'Allow from All' you dont need 'Allow from 127.0.0.1'

If you actually only require access from other internal devices then it is safer to use
'Allow from 192,168.0' This will allow any device attached to your router access to the website.

If you actually want to allow access from the internet i.e. the universe, the 'Allow from all' is ok.


<Directory "c:/apache/htdocs/">
Options Indexes FollowSymLinks
AllowOverride all
Order deny,allow
Deny from All
# allow only devices attached to me router
Allow from 192.168.0
</Directory>



Making the above changes should not effect the access from your phone using [192]

Options: ReplyQuote
Re: Can't load web page externally.
Posted by: denver49 (---.hsd1.co.comcast.net)
Date: August 26, 2013 06:29PM

Thank you for the good advice on Deny, Allow.

>> This change
>> DocumentRoot "c:/apache/htdocs/"
>> Makes me think you are not using WAMPServer or have another Apache installed.

I am using WampServer since my last hard disk failure. Previously I had over 100 websites hosted on cPanel at Hostgator.com and mirrored locally in my PC's WAMP development environment. Where PHP, Apache, and MySQL were installed individually many years ago (what a nightmare!). The original WAMP environment began its life "c:/apache/htdocs/" and certain PHP scripts had dependencies based on $_SERVER['DOCUMENT_ROOT'] thus I had to point WampServer to "c:/apache/htdocs/"

In recent years I set in httpd.conf on the WAMP system a variable
SetEnv WAMP 1
so that I no longer need to have a PHP script evaluate $_SERVER['DOCUMENT_ROOT'] before it decides whether it is executing in the WAMP environment or the production environment. Relates to file manipulation and differences between Linux and Windows file systems.

>> # allow only devices attached to me router
>> Allow from 192.168.0

"Allow from 192.168.0" is priceless information, thank you.

Options: ReplyQuote


Sorry, only registered users may post in this forum.