blank page with domain name inside - nginx

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.

Related

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.

How to move wordpress website with ssl on localhost?

Website with ssl on wordpress. Moved it on localhost, changed wp-config, changed https://olddomain.ru to http://newdomain.ru.
But still have error ERR_SSL_PROTOCOL_ERROR in browser and Invalid method in request \x16\x03\x01 in apache2 logs.Trying to start it via MAMP. How to disable SSL?
This question relates to current and previous MAMP and MAMP PRO versions. MAMP PRO assists in replicating basic web host production environment on a users local Windows based system.
First, it's best to isolate the problem by disconnecting your system from internet.
Turning off GroupStart for Apache and MySQL by un-checking "Include MySQL in GroupStart" is another isolation problem solving technique:
https://documentation.mamp.info/en/MAMP-PRO-Windows/Servers-and-Services/Apache/
https://documentation.mamp.info/en/MAMP-PRO-Windows/Servers-and-Services/MySQL/
Emptying logs by erasing the log files prior to trying out the steps below is another way to isolate problems:
C:\MAMP\logs
Most local systems have AntiVirus program and the antivirus program usually has software firewall bundled. Be sure to add Web Server and HTTPS ports under ports and services of your choice of AntiVirus software.
1. Custom Domain:
First issue is related to assigning custom domains. A custom domain is assigned by modifying Windows Hosts file to point localhost host with IP 127.0.0.1 to a fictitious domain name.
Here is how the default hosts file looks like:
https://support.microsoft.com/en-us/help/972034/how-to-reset-the-hosts-file-back-to-the-default
Here is the required modification:
hosts file
127.0.0.1 newdomain.ru
::0 localhost
::0 is the bus/port designation of a systems network adapter. Usually the first available network adapter software on a device has ::0 address.
After modifying hosts file be sure to flush dns by using Windows command prompt:
ipconfig /flushdns
2. Location of Virtual Hosts data
MAMP documentation recommends you store virtual Hosts data outside of default C:\MAMP\htdocs directory.
https://documentation.mamp.info/en/MAMP-PRO-Windows/First-Steps/View-Localhost/
3. Serverside language application
MAMP recommends to serve serverside language applications such as WordPress on port 80 in your local development environment.
https://documentation.mamp.info/en/MAMP-PRO-Windows/Troubleshooting/WordPress/WordPress1/

Access wordpress website on localhost from remote network

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');

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.

Resources