Access HTML page on local network - html

Say I have this HTML page , I want when some one on my local network type my(ip) or my computer Name in a browser to view that HTML page

You just have to edit the httpd configuration file and ensure that the default port is set to 80, as by default it should use that anyhow, 8080 is the alternate one.
If you use a local network then the rest of the users in it should be able to reach the website on http://your-computer-name, otherwise if for any other reasons that's not configured then they'll have to use the IP address.
They can also edit their local hosts file (in Windows for eg.) and have something like:
your.IP any-name
any-name being either your computer name or website name, as it will be a direct maping

Related

How to make polymer serve be accessible on the internet or Lan, instead localhost?

I have a Polymer 2 component that I serve locally running
polymer serve
I get the following back:
Files in this directory are available under the following URLs
applications: http://127.0.0.1:8081
reusable components: http://127.0.0.1:8081/components/component-name/
That works very well; as expected I am able to open a local URL and view the component on Chrome.
I need to test this component on an Android Device, the best way it would be (please correct me if I´m wrong) to make this polymer component available on the internet or my local network.
Any suggestion is appreciated. thanks.
When you use the serve command you have some additional parameters. With one of them (-H) you can set the IP you want to be used. So instead of launching the server for your loopback (localhost) IP (the default), you can use your LAN IP (I guess most likely something like 192.169.x.x), or even:
polymer serve -H 0.0.0.0
"0.0.0.0" basically meaning "all IPv4 addresses on the local machine". So now you only need to know your IP in the network you are and that Android device is connected also. So if both of them are connected to the same router you should be able to open in your phone an URL like http://192.168.x.x:8081

Wordpress host with raspberry pi - images don't load when accessing it from outside the network

I'm trying to make my first basic web server to host a wordpress website using a Raspberry pi 3, nginx, php7.0, mysql and phpmyadmin.
I have set everything all right, I can access the wordpress site and edit it when I'm connected to my router, but once I try to access it from outside using my phone network, it loads but it shows no images and the website looks totally disorganized.
I'm using no-ip to get a static IP, I have set the router DMZ on the Pi and it's connected through WiFi, so there should be no firewall between the Pi and my phone.
I really don't get why this is happening, it looks like something is blocking some parts of the info exchange, could this be my ISP and the solution would be to change the website port from 80 to another one? I'm starting to discard this option because when I access from outside to the phpmyadmin management site, it loads correctly, including all images.
As I said this is my first experience and I don't know what else to look, I would really appreciate help from more experienced users.
WordPress uses two configuration variables to determine the address of the site and the address of resources for the site. See changing the site URL for details.
You currently have these values set to an internal address that cannot be resolved to your static IP.
If you set the values to your external address (used by your phone network to access the website), the external access should begin to work, e.g. http://example.ddns.net/. However, a negative side-effect is that internal access may stop working!
You should be able to make both internal and external access work, by removing the scheme and hostname from the values, and setting only the path component, e.g. /.

Hyperlink not working address automatically updated with extra forward slash

I have an HTML document with a hyperlink to a Visio version of the HTML.
I have been able to successfully access the Visio version, however, now when I click on the hyperlink to access the Visio I am getting an error:
Windows can't find 'file:///C:/DDL_14.1.1/DDL/HTML/filename.vsd"
Where are these 3 forward slashes prior to the file address coming from? The address link saved in the hyperlink address does not have the 3 forward slashes.
Possible cause: Your web server may not be running. The prefix "file:///" means your browser is trying to access a local file or is assuming so. Have IIS running, and put the file in the folder equivalent of wwwroot or in a virtual directory. Look at the original address of the hyperlink and see whether it points to another web server on the network or on the internet. After you place the file in the wwwroot, in IIS itself you could say 'Browse' and the IIS will serve it with an address that looks like 'localhost' or a local network ip address and port.

Set chrome to ignore hosts file

How can I set chrome to ignore hosts file?
Here is the scenarion:
I have www.example.com site which is Live and customers are using it and now I have got the code hosted on a new server with a host file entry to that server for my domain I am able to browse to the new server. Problem is everytime I want to check whats on live I have to edit my host file entry. So is there an option to manually set one of my browsers ex: Chrome to ignore the host file entry?
HostAdminApp, a Chrome extension, does exactly what you need.
No, I don't think you can, since the hosts file is an operating system wide setting. It would be easier and better to manage if you change the domain of the test server to www.example.local, so www.example.com will go to the live server.
Edit: Another simple solution would be to use a browser in a virtual machine. It could be worth the effort if you need to do a full testing
As it turns out you may be able to use an issue with Chrome to accomplish this. I was having trouble getting Chrome to recognize/use my /etc/hosts file to locate locally defined IPs. It was always doing a search on the name rahter than going to the locally defined domain.
I had to comment out these 2 lines to get it to work:
::1 localhost
fe80::1%lo0 localhost
So, I am guessing that if you put them in, Chrome will ignore your hosts file. It seems it is an issue the Chrome has with IPv6, so as long as you only need IPv4 for the things in your hosts file you may be able to use this Chrome bug to accomplish what you want. At least until it gets fixed...
There is no straight forward solution. The sort of temporary solution is Browser loads host file only when its loaded so I ended up editing the hostfile entry open the browser instance and changed the host file entry back.
So that way the new browser opened will have a new host file entry loaded.
Well, not a solution to the actual problem (force the browser to ignore hosts file), but rather a flexible alternative.
Ok, so what you usually do in your site's configuration is to have a server alias for www.example.com and example.com. So, then you probably enter in your host file something like this 123.231.123.231 example.com where that IP is your new server's IP and you access your site via example.com. Right ?
Well, here's the catch, if you type www.example.com in your browser instead of example.com you will still see the old site, even if you have set alias with www in your new server's configuration. I think you can apply the same trick with http and https, but you get the idea.
Hope this helps.

Access of the data by the server on the server machine

My question is I know that a server application can access the data stored at server but cannot access teh data stored at client machine as this is a security issue and Browsers not allow this. But in case of localHost (when my local pc is acting as a server) I should be able to access the files from my PC(the local PC on which the application is running). But that is not happening.
Why i m not able to access a simple image file form my local C:\ drive by localhost. The URL i used was file:///c:/image.png but if i store this image any where under home directory of tomcat i m able to access it. WHY ??
I m using it as <'img src="file:///c:/image.png>
Thanks for any considerations..
The problem is with this part:
The URL i used was file:///c:/image.png but if i store this image any
where under home directory of tomcat i m able to access it.
If you want to access the file through Tomcat after placing it in Tomcat's document-root, then the URL to use (assuming you haven't changed the default port setting) is:
http://localhost:8080/image.png
Content hosted by the web-server needs to be accessed through the web-server. A file:// URL bypasses any sort of server, and basically directs the browser to look directly in the local filesystem. So it should also work if you were to do:
file:///C:/path/to/tomcat/home/image.png
But in that case you are not going through Tomcat. You're just pointing the browser at the tomcat folder in your local filesystem.
Edit: I don't think many browsers will not allow file:// urls in tags in hosted documents. Doing so could cause the appearance of a security hole, as if you could guess the name of an image file on someone's local filesystem you could then post a webpage that made it appear as if your server had somehow grabbed their personal image file.