How can I test a website being developed locally from remote device (like an iPhone)? - wordpress

I am developing a new WordPress theme and am doing this locally on my laptop using MAMP. On my laptop I can access the site at localhost:8800.
Is there a way I can visit this localhost site from my iPhone? I'd like to see what the theme looks like on mobile devices rather than just resizing my browser. Could this work if I make an ad hoc WiFi network between the two?

try the link
How do you access a website running on localhost from iPhone browser here is the something you might be looking for.
or if you want to test your site on different devices http://quirktools.com/screenfly/ this link might be helpful ;)

Head over to this site (http://xip.io/) and in your vhost setup the following replacing the IP address with your local IP:
#mysite.local
<VirtualHost *:80>
DocumentRoot "/Users/me/Sites/Development/mysite/www"
ServerName mysite.local
ServerAlias mysite.local.192.168.1.81.xip.io
<Directory "/Users/me/Sites/Development/mysite/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Then on your device head over to mysite.local.192.168.1.81.xip.io

The easiest way is to connect your mac and iphone to the same WiFi network. Then get your IP address from System Preferences | Network. It will be shown in the status section and will probably look something like 10.10.5.100.
Then on the iphone go to http://10.10.5.100:8800

Assuming the iPhone is on the same network as the test server, just navigate to it's IP address on your phone.
EDIT: If you have multiple host names, then you can use DNSMasq. If you have a dd-wrt router, add the following lines to the 'Additional DHCP Options' box in the Services page - and make sure DNSMasq is enabled :)
address=/dev/192.168.1.2
interface=lo
no-dhcp-interface=lo
This will direct .dev domains to 192.168.1.2 - adjust to suit your own needs.

Related

XAMPP/Wordpress is using a different IP address after new modem

So my ip address has changed so I can no longer access my WP Admin from my pc. It's redirecting to a different device/ip on my wifi so, therefore, cannot access it on my PC anymore. Can I edit/reset the Wordpress settings from ftp or PHPMyAdmin? So it points to localhost instead of a different device ip?
I also had a problem with my windows ten (my other Samsung Computer)
So I searched this up.
https://kinsta.com/knowledgebase/xampp-not-working/
This actually contains 3 common solutions to the problems that we both have had and are having.
Resolve Apache Port Conflicts (This actually fixed my problem)
Include the Listening Port in the Address When Accessing Localhost
Change Your MySQL Port (Although I think this is the least helpful one)
For more explanation, click on the link above.

wordpress web server WAN/LAN connection error

i made web server for WordPress on raspberry pi (low cost linux single board computer). In local network everything is ok. i bought static ip from my ISP and i forwarded 80 port of raspberry to global network. while trying to connect WordPress by global ip from external network (e.g. smartphone with 4G) pages are too slow(images not shown and theme is basic).
To solve that i change wordpress site url&wordpress url from local ip to global ip. at this time i can connect from external network with global ip too fast, but i cannot connect it by desktop computer which is on local network(browser going to router(huawei HG658)main page when global ip was entered) so that i can’t use dashboard, write posts anything else. How can i solve this ?
I solved the problem. i bought domain. i forwarded it to my static ip. than i added below settings in rpi /etc/apache2/sites-enabled/001-local
<VirtualHost *:80>
DocumentRoot /var/www
ServerName myuniquename.com
ServerAlias www.myuniquename.com
</VirtualHost>
i changed wordpress site&wordpress adress url to my domain. than i configured hosts file(c:\Windows\System32\Drivers\etc\hosts) on my desktop.
192.168.1.31 myuniquename.com
192.168.1.31 www.myuniquename.com

WAMP - localhost can share to someone

I'm not really sure if this is possible, I have a WordPress theme installed and customized using localhost + wamp. Can my colleague view my site w/o uploading it to the server? I mean, can i share a IP address so that he can view it too?
You are looking at port forwarding. You will need to setup a port forwarding rule for Port 80 to forward to the localhost and port that is running your app locally. This way when your friend enters your ipaddress the request will be forwarded to your localhost and he will be able to view the page. Here is an article that discuss Port Forwarding.

MAMP- Use local IP instead of 'localhost' in address?

Is it possible to get MAMP to show my local IP address in the url instead of the text 'localhost'?
The reason I want this is im using the Drupal CMS which caches some absolute links to images. Im on mac so I need to test my site with a PC so I can use IE. If I type in my mac's local IP address I can access the site over my network.
However, the absolute links which use 'localhost' not the IP don't display.
Thanks
I'm about 99% sure that if you set up MAMP to work on port 80 you'll get your local drupal site from a remote machine on the same network (if you don't set it up on port 80 you'll just need to append the port number to the request ie: h ttp://1.0.0.0.1:8080/)
Ive found a solution. If I access the site on my local computer and type in my local IP, and then refresh the cache then the absolute links are created with the local IP. This makes them work on both my main computer and networked ones aswell.

How do I access the host machine from the guest machine? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've just created a new Windows XP VM on my Mac using VMware Fusion. The VM is using NAT to share the host's internet connection.
How do I access a Rails application, which is accessible on the Mac itself using http://localhost:3000?
On the XP machine, find your IP address by going to the command prompt and typing ipconfig. Try replacing the last number with 1 or 2. For example, if your IP address is 192.168.78.128, use http://192.168.78.1:3000.
You can use your host Mac's (or any other Mac on the network) 'local' name:
http://macname.local:3000/
where macname is the network name of your host (or other desired) Mac.
For future visitors: once you've got the IP address figured out, you can add an entry to the Windows hosts file, which is located at C:\Windows\system32\drivers\etc\hosts, to map the IP address to a (virtual) server name. Add a line like this:
192.168.78.1 myrubyapp
Now you can access the site in IE at the address http://myrubyapp:3000
If you use virtual hosts under Apache you'll need this to provide the correct server name.
On the XP machine, Start -> Connect To -> Show all connections.
Double click Local Area Connection.
Click the Support tab.
Take the Default Gateway IP <gateway-ip> and hit http://<gateway-ip>:3000 in your browser.
Gotcha: You must have http:// in the address or IE will give you "The webpage cannot be displayed".
As this question is quite old and referring to XP, here is an alternative for new OSs;
If you're rocking Vista or Windows 7 as the Guest OS, and you have Virtual Hosts setup in the Host via Apache, here's how to setup:
In the Host OS, you need to ensure the network connection is done via NAT;
Right click the network icon in the VM window (bottom-right)
Select "NAT"
Select "Connect"
Wait for the guest OS reconnect to the network
Then, In the Guest OS;
Click Start > Network > Network & Sharing Center
Click "View Status" next to the network connection
Click "Details"
Find "IPv4 Default Gateway"
Open Wordpad
Edit C:\Windows\System32\drivers\etc\hosts
Add a line to the file such as:
[default-gateway-IP] www.example.com
[default-gateway-IP] example.com
Save
Try opening http://www.example.com or http://example.com in IE
For Django it's important to do the following:
./manage.py runserver [default-gateway-IP]:8000
because
https://docs.djangoproject.com/en/dev/ref/django-admin/
Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your development server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0 or :: (with IPv6 enabled).
I just spent an hour trying to get this to work following the steps on SO but mine ended up being a bit different.
VMWare settings
1.) Set VMWare connection to NAT
2.) run > cmd > ipconfig > copy Default Gateway value
3.) edit hosts file (c:/Windows/System32/drivers/etc/hosts)
add this to your hosts file:
<gateway-ip> yourserver.local
OS X settings
1.) edit Apache config (e.g., sudo vim /etc/apache2/httpd.conf)
add this vhost entry to your httpd.conf file:
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
DocumentRoot "/path/to/your/project"
ServerName yourserver.local
<Directory "/path/to/your/project">
AllowOverride All
Options All
</Directory>
</VirtualHost>
save & quit (:wq)
2.) Edit your hosts file (sudo vim /etc/hosts)
add this line to your hosts file
127.0.0.1 yourserver.local
3.) Restart Apache (sudo apachectl restart)
I found that I had to switch the connection setting on VMWare in order to restart the connection before these settings worked for me. I hope this helps.

Resources