IIS 8.0 default Page not Loading - html

I have default regular html page (testing purposes) when I try to browse that page from IIS, it keeps loading, It's like he doesn't know where the Page is ...
I have a SQL Server 2012 with IIS 8.0
My Default Web Site Config :
Binding
Type : http
Port : 80
IP Adrs : Domain IP
Since the page is on the server I do not specify the host Name (not sure if that's the issue)
Basic Settings
Pool : .NET v4.5
Physical path : C:\inetpub\wwwroot
In the C:\inetpub\wwwroot folder I have a index.html file which is just a test I was running to test IIS
html file :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
Content of the document......
</body>
</html>
My Issue is that when I open Default Web Site and I try to Browse it, It keeps loading and never retrieves the file ... How can I fix this and/or how can I debug this ?
EDIT :
My main issues is that my WCF C# Service doesn't work but then I tried to simply call that html file that I create and then I understood that it has something to do with IIS itself or I really messed up something there, also if you wish to know how I was doing my steps for my WCF C# Service here's the video
Video :
enter link description here
thanks

Man, after reassearching a lot, I've found out that you need to give access on the IIS_USERS to you're application rather than the web.config file

Related

Mobile browser doesn't find css files

I'm building my first website and the structure is as follows:
a folder named website containing two subfolders named html and css. The html folder contains one file named home.htm and the css folder contains two files named general_style.css and home_style.css.
In home.htm i have put the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>My title</title>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width,
initial-scale=1.0">
<link rel="stylesheet"
href="../css/general_style.css"
type="text/css">
<link rel="stylesheet"
href="../css/home_style.css"
type="text/css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
</head>
<body>
<!-- code goes here -->
</body>
</html>
This works fine in Firefox on my desktop, but not in Chrome on my smartphone. On the smartphone only the html is shown and the icons from https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css.
All the code from my own css files is not shown neither are the icons from https://kit.fontawesome.com/a076d05399.js.
Can somebody help me out here?
PS: both html and css files are validated with no errors or warnings.
I can't say why it is not working. But I can tell you that if you're planning on building websites and testing them on various devices, you might want to run a local web server. This way, all your files can be hosted in your computer and you can access your site from any device connected to your network, using the local IP address of the computer that hosts the files. (ex: 192.168.0.x/home.html would show you your site if you open it in your mobile browser, without having to manually transfer any files.)
This is also the preferred method since it is closer to how users will access your website in the future.
You might want to look up "how to run a local web server" to find some guide that suits you. There are many methods and software tools to choose from.
If you are on a Mac, here's a quick and easy way to run one:
Go to /Library/Web Server/Documents and paste a folder with all your code and assets. Name it something simple, with no spaces
Open the terminal and type sudo apachectl start. It will prompt you for your password. Type it and press enter. (it might seem like its not typing because it wont show you anything, but it is working.)
Open your browser and type localhost in the address bar. You should see some big serif bold letters that read "It works!".
You're all set! Now just visit localhost/folder-name/home.html and it should show you your site! (hint: you might want to rename your home.html to index.html. If you do so, you will be able to visit localhost/folder-name/ and the server will automatically load index.html
Remember that if you are going to access this from your mobile phone or any other device, you must be connected to the same network. Also, entering localhost will not work. From other devices you must provide the local IP address of the computer running the server. Something like this: 192.168.0.5/folder-name/home.html/. You can find the computer's local IP in your Network Preferences.
(This works because macOS comes with the Apache webserver software preinstalled, and has set the /Library/Web Server/Documents/ folder to be hosted by apache. What we do in the terminal is just turn apache on. You can turn it off by typing "sudo apachectl stop" in the terminal).
You are trying to run your code on mobile browser?
Since it works on your computer Firefox browser smoothly but it wont work on mobile phone, this might be because you dont have the CSS files on your mobile device and have them on your desktop. I think that is a issue.

How do I send an image link through a golang created HTML page

I'm new to go and web apps and trying do write an app that reads menu items from a database and send the item's description and the link of a picture related to it through an HTML page for a browser. The app will run on a local network so the image will be in a place like "c:\images\01.png". As of now the page source created is something like
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p> Bolinho de Aipim<img src="01.png" alt="Ícone do Menu" width="42" height="42"></p>
<p> Bolinho de Bacalhau<img src="01.png" alt="Ícone do Menu" width="42" height="42"></p>
</body>
where 01.png is the picture file located on the same folder as the go serever app on the LAN server. Of course it will show the same file, but this is a test. In the real app there will be image folders and each item will have its corresponding image, of course.
Well, the page is created ,sent and shown correctly but the image is not shown. I believe this is an HTML problem, at which I'm not an expert, because if I change the src tag for anything online (e.g. the link to a picture on an Internet Server using http) the page created is able to fetch and exhibit the image properly.
Unfortunately I must be able to solve this problem without using any resource beyond the LAN to which the server and client browsers will be connected.
Thanks for any help.
You can add this piece of code in your server code to serve your images.
fs := http.FileServer(http.Dir("/path/to/images"))
http.Handle("/", fs)

Is there a way to specify a custom root path for `file://` protocol html pages?

I have a page that I want to run serverless (using the file protocol) as well as in a server. But I need to absolute paths in my html for the server, and that means that the html file opened up using the file:// protocol will look at the root of my harddrive. It would be ideal if there was some kind of meta tag I could give to change the root like this:
<meta root="C://whatever/whatever">
or even
<meta root="current-directory">
Is this possible?

html5 cache office document with manifest

I'm trying to use the html5 cache to store locally office documents.
I use :
ASP.NET MVC 4 on server side
Chrome / PC and Android Browser / Galaxy Tab (Android 3.1) on client side.
Here is my (test) page (the one I was working on is a little bit complex) :
<!DOCTYPE html>
<html manifest="/HandlerManifest.ashx">
<head>
<meta name="viewport" content="width=device-width" />
<title>TestCache</title>
</head>
<body>
test1.jpg
test.docx
</body>
</html>
Here is my manifest :
CACHE MANIFEST
# v1.0.2.0 du 15/10/2012 14:57:58
CACHE:
/Data/test1.jpg
/Data/test.docx
This works fine on Chrome/Pc.
On the Galaxy Tab, I can access the jpg file, even when I m disconnected.
But when I access the docx, connected or disconnected, I have the folowing error :
Web Page not available
When I remove the manifest, everything works fine.
Do you know if I can only store some kind of files (images, css, js) on Android Web Browser ? Or if there is something wrong with what I'm doing ?

Application Cache manifest

<!DOCTYPE HTML>
<html manifest="example.appcache">
<link rel="stylesheet" type="text/css" href="AppCache.css">
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<p>Test to make sure css is being cached</p>
<img src="large.jpg">
<script src="AppCache.js"></script>
</body>
</html>
My example.appcache file has:
# v1 11/16/2011
AppCache.htm
AppCache.js
AppCache.css
large.jpg
The first time I navigated to the page, it asked
This website is asking to store data on your computer for offline use.
When I take Firefox offline and press refresh, the jpg disappears.
Q: What do I need to do to make sure the image is cached locally?
IIS does not serve unknown file types. You need to configure it to serve .appcache files with the MIME type text/cache-manifest, how you do this depends on which version of IIS you have:
In IIS6 use IIS manager
In IIS7 and later, you can either use IIS manager or add it in a mimeMap element in web.config
I just want to comment on the accepted answer here, as the mimetype mentioned does not work (at least in IIS7.5). The correct mimetype is:
text/cache-manifest
See:
https://developer.mozilla.org/en/Using_Application_Cache
http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#offline
Do not forget that you need
CACHE MANIFEST
At the top of you manifest document. It is required.
CACHE MANIFEST
# v1 11/16/2011
AppCache.htm
AppCache.js
AppCache.css
large.jpg
That should do the trick