website not running in iis 7.5 - html

Bit of a IIS newbie so here goes: I am trying to run a website from iis 7.5:
The boerekneiter.com folder contains file boerekneiter.htm
html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>hi there</title>
</head>
<body>
this is the body
</body>
</html>
Unfortunately when i go to http://www.boerekneiter.com:8000/ chrome says:
Oops! Google Chrome could not find www.boerekneiter.com:8000
How can I fix this? do i need to install additional filters or components?
It is the only website i have in IIS:

This isn't an IIS issue as much as a DNS issue.
www.boerekneiter.com is just the name of your site in IIS. If you have not set up DNS to point that domain to that server's IP, you won't be able to serve via the URL. As mentioned in the comment, you can test access to the server via the URL localhost:8000 or replace 'localhost' with the IP address of the server. You can also set up your HOSTS to direct requests for www.boerekneiter.com to the server for the time being.

Related

Make a html or xhtml page with svg displayed in local

I have a html page which have a svg. I use Chrome 54.0.2840.98 (64-bit) as web browser in Mac OS.
The svg is displayed well with localhost, whereas it is not displayed when i specify file:///Users/softtimur/... in the browser path.
I have searched some threads, some suggested to change the page to xhtml, I did it. And make the header as follows:
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
But the svg is still not shown in local.
Could anyone help?
PS: Here is the file. After downloading it, you may need to change the name test.xhtml.txt to test.xhtml.
Edit: This thread mentions that Chrome may block the access to local documents (Object in your case) from remote scripts (svg-pan-zoom). Is there a way that I rewrite the page to find a workaround? Or could I do something about Chrome settings? I really don't want to use localhost.
As Chainat and I discovered (in comments), the key is to write <script src="http://d3js.org/d3.v3.min.js"></script> (over <script src="d3js.org/d3.v3.min.js"></script>) if one wants to use external d3. Then even a html file without <html xmlns="http://www.w3.org/1999/xhtml"><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> works...
First of all.
SVG's Doctype will not start with html.
svg doctype is
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
Here is the link for "Doctype's" [https://www.w3.org/QA/2002/04/valid-dtd-list.html][1].
Could you conduct another test, like opening SVG file from folder, if windows then windows explorer, by double clicking the file. It should open in your default web browser.
I have not seen this when I open my files "file:///", instead I see Drive "C:/" like this.

Why max-age is ignored?

I have a simple html page which starts like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="public, must-revalidate">
<meta http-equiv="Cache-Control" content="max-age=88000" />
<script type="text/javascript" src="/js/index.js"></script>
....
However, when I check index.js file in FF web console, I see Cache-Control: "max-age=0". Why is that and how can I fix it? Thanks!
There is no reason to expect a meta tag in an HTML file to affect the HTTP headers sent for a JavaScript file that it refers to (or even the HTTP headers sent for the HTML file itself, for that matter).
The HTTP headers are set by the web server (or, more generally, HTTP server) software in use, possibly as affected by system-wide or directory-wide settings on the server. Long ago, the idea was that certain meta tags might affect the HTTP headers for the HTML document itself, but this was generally not implemented in servers. Instead, browsers may use some meta tags and act as if corresponding HTTP headers had been sent, but a) this only applies to the HTML document itself, if at all and b) it cannot be seen by tools that inspect the HTTP headers actually sent.

Set Access-Control-Allow-Origin without server side scripting

I am trying to set the HTTP header "Access-Control-Allow-Origin" but all of the examples that I find involve servlets or PHP or assume that there is server-side scripting available. Is it possible to set this in a plain old HTML file? I have tried this but I cannot verify that it is working:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html>
<head>
<meta http-equiv="Access-Control-Allow-Origin" content="*"/>
...
I know this question is old, but the correct way of setting a content security policy without server-side is using the meta tag Content-Security-Policy
For example:
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
or in your case / example, allowing everything:
<meta http-equiv="Content-Security-Policy" content="*">
Read more: https://content-security-policy.com/examples/meta/
Try using url-rewrite. You will have to configure the Filter in your web application, but you won't have to write any Java code to do it.

Strange HTML as result of NSURLConnection request

I have a strange problem...
I need to send a GET HTTP Request to web site by NSURLConnection ([NSURLConnection sendAsynchronousRequest...).
All works very well but sometimes I see a strange html result different from what I expect.
This garbage html is this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> -->
<HTML><HEAD><META HTTP-EQUIV="Refresh" CONTENT="0.1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<TITLE></TITLE></HEAD><BODY><P></BODY>
</HTML>
(Lines split for clarity)
What does that mean?
The web site to which I refer is not mine so I can not work on the server side to solve the issue.
Can I do anything to prevent this?
For some reason, the server (or an intermediary, like a load balancer) is asking you to make the request again in .1 seconds.
If you viewed this page with a web browser, it would wait .1 seconds, and then refresh the page (the purpose of the Refresh meta tag).
You will probably need to check explicitly for this, and retry your request (after waiting .1 seconds to be polite) when it happens.

Save To Drive Button Doesn't Work

I wrote a simple file server in NodeJS to serve a HTML page with a Save To Drive button. HTML page is served at my_address:1337 and file to be saved is served at my_address:1338. Upon clicking the Save To Drive button, it shows "Starting Download" for a long time then displays Failed Download. XHR Error.
I thought this was due to the fact that the file was being served from a different port so I decided to do the same with an appengine app. Page served at http://sayodrive.appspot.com/index.html and file served at http://sayodrive.appspot.com/drivefile.jsp, I got the same problem.
Then I decided to do a local Java web application: same problem. Then I tried changing the content disposition to attachment (to force a download) but didn't work either.
Frustrated, I started Googling and came across this page that claims the Save To Drive button doesn't actually work.
So I went back to the official Google Drive SDK page and discovered that their example button doesn't work too. Is this a bad dream?
SOURCE: index.html
<html>
<head>
<title>Test: Save To Drive</title>
<!-- -->
<link rel="canonical" href="http://sayodrive.appspot.com">
<script src="https://apis.google.com/js/plusone.js"></script>
</head>
<body>
<p>This must be the worst HTML you have ever seen :)</p>
<div class="g-savetodrive"
data-src="//http://sayodrive.appspot.com/drivefile.jsp"
data-filename="Test Drive"
data-sitename="Sayo Saves">
</div>
</body>
</html>
SOURCE: drivefile.jsp
<%# page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DriveFile</title>
</head>
<body>
<%
java.io.Writer w = response.getWriter();
response.setContentType("text/plain");
w.write("If you're reading this in Drive, congrats!");
w.flush();
w.close();
%>
</body>
</html>
The original sample was not working because the Cache-Control header was not being exposed by the server. This is now fixed.
Access-Control-Expose-Headers: Cache-Control, Content-Encoding, Content-Range
More in the documentation.