Access my MAMP websites (plural) locally from my iphone - apache

I have created a few websites locally on my mac using MAMP PRO as my local server environment.
I can access these on my mac as I have the opion of adding a local domain (in MAMP PRO) using "local name resolution"
But... I don't know how to access my sites from my iphone which I need to do to test.
If I put my local IP in (on my iphone) I get the MAMP holding page:
The virtual host was set up successfully.
If you can see this page, your new virtual host was set up
successfully. Now, web contents can be added and this placeholder
page1 should be replaced or deleted.
Server name: localhost Document-Root: /Applications/MAMP/htdocs
So I know that works but how do I access my indevidual sites.
The location and structure of my sites are like this:
/Users/myusername/Sites/vhosts/site1/public_html
/Users/myusername/Sites/vhosts/site2/public_html
/Users/myusername/Sites/vhosts/site3/public_html
/Users/myusername/Sites/vhosts/site4/public_html
Could this be to do with the localhost Document-Root? I noticed it was /Applications/MAMP/htdocs
Should I change that or change the location of my sites to be in /Applications/MAMP/htdocs?
Thanks
C
UPDATE:
Ok, so I changed my Document-Root to /Users/myusername/Sites/vhosts/ which now allows me to load the site localy in my browser with 192.168.1.134/site1/public_html
BUT.. when I load 192.168.1.134/site1/public_html from my iphone (on the same wifi network) I get the page title but the page doesn't load. Just hangs!

I use ngrok to forward my localhost and would recommend it. After installing it (it's free), you essentially run something like "ngrok 80" and ngrok will create a public URL that can be accessed from anywhere (AKA your phone) and displays the same content that http://localhost/ would.
Apologies I can't post full http:// links- I'm limited by my reputation.
In your example, ngrok might create a domain "hs673gs.ngrok.com" that corresponds to "localhost" when accessed from your local machine. Going to "hs673gs.ngrok.com/site1/public_html" from your iPhone will be essentially the same as visiting "192.168.1.134/site1/public_html" on your local machine.
Hope this helps.

MAMP has launched an app where you can see your local websites on your mobile through their app MAMP Viewer: https://itunes.apple.com/de/app/mamp-viewer/id1047237620?l=en&mt=8
You just configure the host that you want to use for MAMP Viewer:
Select the host you want to view on MAMP Viewer > On General tab, make sure to check, "for 'MAMP Viewer' (LAN only)" > click save > restart your servers > open the app and check your sites.

Related

Website not accessible externally following PHP upgrade

Bit of a strange one - Over the weekend I updated the version of PHP on one of our servers and all seemed to be working fine, however yesterday, we started to receive complaints that the site was down.
After looking in to it, the site works fine when connecting from the internal network, but it times out when trying to connect from an external IP address.
Server admin isn't really my strong suit, so not really sure where to begin. I've checked the httpd.conf files and all looks fine, the apache config test reutrns 'OK' so at a loss as to where to go next.
Server is running Centos, PHP 7.2 and apache 2.4.6.
How can I get the server to respond to external requests?
Andy
You can use this tools (metod) to check where is propably the problem:
I. on serwer, check :
whether is serwer conections to internet - ping, tracerout
whether page is loading (on local) - lynks, links (text web broweser)
whether your dns is working (or dns ISP prowider) - depending on the service used, e.g. BIND (check usage this tool in internet)
whether your firewall is ok configured and good work - depending on the service used e.g. iptables
whether domen settings is ok,
...
II. on computer, check: (in internet, not in local network with your serwer)
whether the website loads in the browser eg firefox after using ip address (your server where the page is located) in www bar
whether host in internet have a contact with your serwer - ping, tracerout
whether the website loads in the browser eg firefox after using ip address (your server where the page is located) in www bar
...
The problem is wery complicadet becouse I dont now what exactly you have an infrastructure and it is settings (network, ISP, etc.) which you on host the page you are writing about. For this reason, it is difficult for you to precisely help.

err_name_not_resolved Win7 Error

I am facing a strange issue on a single PC, all other PC's I have tried are fine so the problem definitely seems localised to this setup.
Windows 7
Google Chrome Version 48.0.2564.82 m
I have developed a simple website on an Apace web server (Windows Server 2012), and assigned it an internal IP address (1.2.3.4), and internal dns name (MyWebsite.MyDomain).
This website is only available within our company. When I type the URL MyWebsite.MyDomain into any browser I am presented with the correct web page, great. When I type the IP address 1.2.3.4 into any browser I am also presented with the correct web page, great again.
This is the case for every PC I have tried so far, apart from one. Instead I am presented with the following error message;
This web page is not available
ERR_NAME_NOT_RESOLVED
Why would this be?
Things I have tried so far on the local PC;
delete history/cache on local PC
ipconfig /flushdns
ipconfig /renew
ipconfig /registerdns
changed to Google public dns (8.8.8.8 / 8.8.4.4)
restart (multiple times)
tried IE and FFOX (same error)
checked hosts file (all looks ok)
The only change I ever made to this individual PC was I installed XAMPP and changed the hosts file (for testing purposes). I have since uninstalled XAMPP and reverted to the original hosts file - could this be the issue? I can't think of any other changes.
I had thought the issue was with my web server setup, but as the web site is accessible from all other PC's it would appear not?
Looks like a re-build may be necessary for this PC, unless somebody can perhaps point me to another suggestion? Any help appreciated.
That machine doesn't happen to have any static ip addressing configured, does it? I'm thinking that perhaps a manual entry for DNS server is conflicting or overriding what DHCP is supposed to be assigning.

Public IP Web Page "Connection Timed Out" When Connected To

Recently, I made a website server on my server PC running Windows 7. I used WampServer, and I configured it as follows:
Download and install WampServer.
Check http://localhost (worked).
Program out the HTML files necessary.
Put it inside of the 'www' directory (the default directory of WampServer for HTML files)
Go to http://localhost to see if it worked (yes, it did). Then right click WAMP notification and "Put online".
Go to my main PC and go to http://[local-ip-of-server-computer] to see if it worked. It did.
Now, I configured the httpd.conf to "Request all granted"
Next, I went on ahead to port forward. My router is Frontier Netgear router.
I went to 192.168.254.254 (Frontier's router addresss) > Firewall Settings > Port Forwarding > Add
I selected "World Wide Web (HTTP)" and "OK".
Then I went to the menu and to "DMZ Host". I enabled my server computer for that.
With my main PC, I went on ahead to my public WAN IP mentioned on the router page. It didn't work.
Whenever I try to load my http://[router-public-wan-ip], Google Chrome gets a "Webpage not avaliable. ERR_CONNECTION_TIMED_OUT"
I have port forwarded on my server PC's Windows Firewall.
My httpd.conf is set to be on port 80. Also, I have changed my ServerName to [local-server-computer-ip]:80.
Can anyone provide any advice? Thanks.
This was my mistake. The solution to this problem is that, well, there was no problem at all. I simply hadn't realized that external IP addresses cannot be accessed by their own servers - one inside of the server LAN has to use the server computer's local private IP address.
I sincerely apologize. Thank you to all who contributed.

Apache - hosts file point subdomain

I have a site I developed locally for a client. They have an existing live site (at www.livesite.com). I want to move the developed site to their server, but I want to test it on their server before it's live.
I thought I'd install the site in a sub directory on their server (www.livesite.com/dev), and then using my hosts file, make my browser think it's viewing the final live URL (www.livesite.com).
However, I've tried various combination of things in my hosts file, and I can't seem to get it to work. The server ip followed by the domain / sub-domain.
I'm running on MAMP on OSX. Anyone have experience with this?

remove virtual host on mac

I'm using MAMP PRO on my Mac (running OSX 10.8 Mountain Lion).
Today I added a new host and managed to name it sitename .org which now making me unable to access it online.
Fist I tried to rename the host - didn't work.
Then I tried to remove the host - didn't work.
Tried to rename the folder (wich also was named sitename.org) - didn't work.
So basically now I cannot access this particular site at all.
I've set the correct disk location and everything, but it just uses "Document-Root: /Applications/MAMP/htdocs". Even now, after I've removed the host, it still says" "erver name: sitename.org".
Also restated the machine...
Does anyone know how I can fix this?
I believe MAMP Pro sets all the apache settings on launch, saving them in its preferences plist or some such, so:
Start MAMP Pro
click to the sites tab
click the + button below
fill in the details for your site (desired local url eg sitename or sitename.dev)
restart MAMP
There is a video for Mamp Pro here: http://www.youtube.com/watch?v=4hMW8sTFftI
if you have any cruft from trying to set this up manually, check in your /etc/hosts file, remove any lines that relate to your 'sitename.org'. This way, your machine will look online for sitename.org rather than thinking that the site should be served locally.
You may need to flush your dns cache? for 10.8 try:
sudo killall -HUP mDNSResponder