Access wordpress website on localhost from remote network - wordpress

I want to show my client the WordPress website on localhost being developed by me (it's still in the beginning stage, not ready to go live yet). This is what I have done so far:
- I have done port forwarding and have tested it (whenever I access my Xampp localhost from the remote network by entering my computer's ip, it opens up the localhost dashboard).
Now this where I'm stuck:
- Whenever, I specify a directory of website (in htdocs) on my remote network's url (like this: mycomputer's ip/folder's name it changes the url to localhost/folder's name and the page doesn't open).
How do I resolve this issue?

Add this line to your wp-config.php might help:
define('WP_HOME','http://your-computer-IP');
define('WP_SITEURL','http://your-computer-IP');
and comment or delete that line when your work from home.
But there's something can be improved. Try to some DDNS services and install their application to your local machine. After installed, you can access your computer from mymachine.ddns.net even you're home or not. So with below setting, you no need to edit anything when you change your work location.
define('WP_HOME','http://mymachine.ddns.net');
define('WP_SITEURL','http://mymachine.ddns.net');

Related

blank page with domain name inside

I set up a server on Ubuntu 20.04, installed and configured UFW and fail2ban, installed nginx, opened 80 and 443 ports. Created a config file for my domain and started the server. It works, but from my IP address (from which I set up the server), I cannot get to the site. When I request a domain, I get a white page on which my domain is written in plain text. But as soon as I register the domain and IP in the hosts file, the site becomes available. I see the problem only from my IP, from others - the site is available. I can provide server settings, but they are corny simple. The site is still pure HTML. Even php didn't install.
Help me find the problem, or at least a direction to fix it.
Thanks!
It might be related to cached DNS queries. Remove the entry from /etc/hosts file and restart your local machine.

XAMPP wordpress LAN, redirect to localhost

I cant access my local site installed on pc from other device.
If i put 192.168.x.x, is loading 192.168.x.x/dashboard. The same for lan. its good.
Putting 192.168.x.x/site will be loaded my wordpress site for local pc without problems, but will redirect to localhost/site for lan devices! Why??
No hosts modified, no xampp files modified. In wordpress settings, the urls (2) are setted as 192.168.x.x/site
Restart apache does not help.
What happens?
Edit0:
I have modified one thing:
httpd.conf, Listen 192.168.x.x:80
Edit1:
I added new folder 'test' and 'index.html' with 'TEST' text. Is working, i can access from any device with 192.168.x.x/test. So, is some problem with wordpress? I will try to install wordpress again, to new folder.
Solution: reinstall wordpress.
If you are using Windows OS, first of all, check your sharing settings:
Control Panel\All Control Panel Items\Network and Sharing Center\Advanced sharing settings.
Make your network discoverable. If you don't know which type of network you are using you can find it from here: Control Panel\All Control Panel Items\Network and Sharing Center > View your active networks.
If you couldn't find that, choose "Turn on network discoverable" for all of them but please note that this is an unsecured way.
Then use ping command from other devices to check that your local PC is reachable.
If your PC was reachable from other devices, then you can open your local-website by opening your local IP address:
http://192.168.x.x
You can use these configurations for your Apache:
Listen 192.168.x.x:80 OR
Listen 80 OR
Listen 0.0.0.0:80

Host ASP.Net MVC Site

I've created a site using ASP.Net MVC that is meant to be stored on a local machine at my place of work. The intention is to have the site stored on this machine, but then accessible by all the other machines within this building.
I've followed Microsoft's tutorial as well as Code Project's tutorial, but I am not having very much luck. The binding is just the localhost, port 80, with * for the IP address. The URL is localhost/GrantTracker.
I've opened the ports within the firewall, checked the permissions on the directory (which is just within wwwroot), tried having the site take the place of the default IIS site (as Microsoft tutorial has you do) and tried having the site stand on its own with its own port (per Code Projects tutorial).
On the host machine I am receiving the standard "This site can't be reached, localhost refused to connect" which feels like either a port or permissions problem. I must be missing a step, but I can't seem to find what it would be. I am new to hosting sites through IIS so forgive me if I am just missing something basic.
I find it a bit strange too because my project uses Windows Authentication and when the site is first visited it performs that initial check with the user, authenticates, but then throws me the error.
Anyone have any ideas? Thanks in advance.
start simple,
create a simple html page, create an IIS application for it, on port 80.
Check and make sure you can see that page from another computer using the internal IP address of the the host machine so something like:
http:\\192.168.0.3\hostapp\test.html .
You can see the proper URL by running it from IIS, this will give you the entire URL you need, with localhost then just replace localhost with the IP address of the host machine to see it on other machines.
Do this in the original IIS folder so you don't encounter any folder permission issues. If you choose another folder you'll have to give access to the Network Service user ( i think, can't remember now, but there is a specific user that needs access to the folder where the website is deployed )
if you can see the page then deploy a proper website and do the same thing. Make sure the app pool is created correctly and it's up and running, then access it again on other computers and it should work.
Port 80 should be open by default so that should not be an issue.

adding website to local iis. getting Server not found error

I am adding a web application to my local iis. I added the path to the folder with the bin is inside. I specified the application pool and applied my login credentials. When I hit test settings, everything passed. When I typed mysite.local on the browser, I get the following. I also clicked on Browse Website and get the same error. This is on my personal PC.
Server not found
Firefox can't find the server at www.comicrage.local.
Check the address for typing errors such as ww.example.com instead of www.example.com
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
Have you added mysite.local to the hosts file? If not, add the following to C:\Windows\System32\Drivers\etc\hosts.
127.0.0.1 mysite.local
The hosts file is responsible for any local overrides that should take precedence over DNS.

IIS7 and Classic ASP and Applications and Paths

I yesterday received a zip file containing an old asp site from 2005. Its came in a folder called ivx.
I've unzipped ivx to c:\inetpub\wwwroot and then created an application in IIS called ivxapp and pointed it to c:\inetpub\wwwroot\ivx. Now when I type http://localhost/ivxapp, I am able to access the index page.
My problem is, whoever designed that site, designed it when IIS5 or IIS6 was around. He's used paths like more... which leads to http://localhost/new_posts.asp and not http://localhost/imagevertex/new_posts.asp
The whole site is some 21000 lines of code and contains many many references like this. Then comes the problem with <!--#include virtual = "/common/adminverify.asp" -->
Instead of having to manually edit the entire code, do you know a way to get things going?
This site worked perfectly well on a production server. Right now it's on my local machine on Windows 7 64 home premium.
Yes, you need to give this site a root-URL of its own, and not run it in a subdirectory of your localhost.
This is more of a web-administration question, but what you need to do is either run it under "localhost" directly, or add a domain-name to your network to run this site under.
The easiest for you right now is probably the first option.
If you aren't running a different site under localhost already:
Go to the IIS manager and click the 'localhost' site. On the right side of the IIS interface you can change the basic settings. Point the physical path to the ivx directory. You can reach the site directly on http://localhost.
If you are already running a site under localhost you need to keep:
Now, if you -are- already running a site on your localhost, the second easiest option is to run the ivx site under localhost, but on a different port. To accomplish that, click on the current ivx site in IIS, change the path in the same way as descibed above, and after that click on "bindings" in IIS, and change the PORT for the ivx site to something other than 80, for example 81.
The ivx site will then run on http://localhost:81, your current localhost will still run on http://localhost.
The hard way: adding a host to your network or PC:
The last option is to add a new hostname for the site to your network. You can add an A-record in your DNS for the ip-address of your server or add a host name to your HOSTS file in Windows on your server ("server" in the sense of the machine that runs the site, which can also be your local machine)
You can add a made-up name to the ip-address of the server, and in IIS' bindings add that name under "host name". this way you can run two different sites on the same machine, the "host name" seeting in IIS will make sure that calls to that specific hostname will reach the correct site. Adding it to the DNS of your network, or the HOST file in Windows will make sure the name is resolved to the correct machine (your webserver).
This last option is a little tricky of you've never done something like this before, but the first option works just as well.
Good luck!
Erik

Resources