Hosting basic html site on iis - html

I have a basic web site (just html, js and css files) that I want to host on IIS on my local machine for testing purposes. The site runs fine when I run it directly as a file on my computer. I added a website on IIS, using the directory these files are located in, but when I try to launch it, I get an error page that says:
An error occurred loading a configuration file: Failed to start monitoring changes to '[my site path]' because access is denied.
It then says that the source file is a web.config. I know that ASP.NET sites use a web.config, but I don't even have one, and I just want to run a basic site using html, css, and javascript.
Any ideas on what the fix might be? I made sure I have an application pool for the site.

You likely put it into your user profile -- ie c:\users\skitterm\ -- which won't let the process running IIS read the folder. You are better off using IIS' built in directory structure in c:\inetpub and adding a folder for your site.

As you can tell this is a server misconfiguration. It would help to know the version of your IIS.
You can follow the steps on Microsoft's official knowledgebase to resolve the issue:
http://support.microsoft.com/kb/316721
http://support.microsoft.com/kb/317955 (for IIS v6.0, try Method 3)
I worked in IIS about a year ago and such errors are caused by misconfigured Security settings in IIS.

Sounds like you need to set up the proper access rights for the folder to the account specified by the application pool identity.
First make sure that your folder is not anywhere under your \users\, \program files\, or any other place that already has restricted access. Put it under a folder on the root (\inetpub is a good place).
Then, add the appropriate permissions (usually read only) for the folder to allow the user account specified by the app pool identity to access it. If the app pool identity is set to ApplicationPoolIdentity, adding the IIS_IUSRS local group should do it. Otherwise, use the account that is specified.
This should fix the problem.

Related

Wordpress Reinstallation - You don't have permission to access /sitename/ on this server

We've been working hard on a sandbox server. We installed WordPress to it from scratch. I created the database, and imported the previous database into it. The user and password both have been created.
Right now, our error is "403 Forbidden: You don't have permission to access / on this server". I can't access any of the files by typing in the server IP address,though we see and control everything as root via Putty, or manage it through FileZilla. Root is the owner of all WP files/folders.
I found this source: WPBeginner-403-Error-Fix and am currently changing the permissions on the files; the folders are done and the permissions are set to 755. File permissions are being set to 644. Out of all the resources we had referred to, it never mentioned WP requiring specific permissions. I got right onto that today. While this is running, I still get the message after the folder permissions were changed, and as the file permissions are being processed:
You don't have permission to access /wp-admin/login.php on this server.
We also had a bootstrap file located in the same place as the WP installation / contents (this was a test). The bootstrap is very much accessible: the CSS/JS folders with the supporting content can be seen if you type the ipaddress/directory for the bootstrap version... you can see the files and structure. If you type in ipaddress/boot.html, it runs it flawlessly. If we try referring to anything with WP, it does not like it and throws the 403 error.
There is no .htaccess, I read online it would generate via permalinks in the panel. But we can't even see the panel. It's currently .htaccessOLD (from when we imported our old WP contents to the dev server, from the production site), so there should be no interference.
None of us has installed WP directly, the guy who did it previously no longer is part of the company, so we are becoming lost in this process.
Edit: Plugins were disabled via renaming convention, however, WP actually regenerated this folder.
Edit (2): With the permissions set, and the plugin/theme deactivated, it still does not run due to 403.
Weird... my answer didn't post yesterday as I had thought.
So- we solved it. The permissions were set accordingly for all directories/files, the issue was the server configuration. Just triple check the server configuration file (usually httpd.conf on current servers) to ensure it points to the directory containing the WP contents.
If this is still a problem to some people, and you swear that the httpd.conf file is correct, it does not hurt to double check your directories. The directories should be permission 755. Files should be 644, excluding the wp-config.php (that ought to be set for permissions 455).
Thank you for helping us troubleshoot! We really appreciated it! :)

Local debugging of subdomains with VS 2015

I have a multi-tenant website that has to take care of any incoming request and determine the appropriate routing by the URL subdomain.
I set up the subdomain routing using this or a similar solution.
However I'm trying to access my website on my local machine using subdomains an alias website. I'm unable to get my local IIS to port to my website with the subdomain I've specified.
I want to dedicate a virtual domain name in my local machine that will port to the website I'm debugging on VS (localhost:23456).
I've read some answers of identical questions (like this or this one), but it looks like the system has changed with the new IIS and Visual Studio 2015 and ASP.NET 5 MVC 6 (vNext) project configuration.
Here's what I've tried according to the answers linked above:
I tried setting the hosts file porting www.myexample.com to 127.0.0.1 but I get a "Bad request" error when navigating to www.myexample.com:23456 in my browser, and anyway the debugger doesn't report a request.
I tried setting <binding protocol="http" bindingInformation=":23456:www.myexample.com" /> in the applicationhost.config file, gets IIS to raise an error saying "Replace hostname with localhost. Any other bindingInformation not specificying localhost as the website raises that IIS error.
Update
After opiants answer
I knew about the .vs folder and that's were I was configuring the bindings indeed.
However, looks like it was the permission that caused IIS to throw errors.
Running that netsh command solved the issue. And BTW, since I'm only running it my own machine, I'm not gonna need to open the firewall.
Anyway my question is if there is a way to add a wildcard instead of each subdomain separately? Since each tenant gets a unique subdomain, the whole process of adding subdomains is going to be dynamic by nature. I need to allow an asterisk in all the 3 places:
hosts file
applicationhost.config file
netsh command
It looks like I can add the asterisk in those places but it doesn't actually work.
I'm guessing you're using IIS express locally?
If so, in your solution directory, there is a .vs folder. You need to add the binding in the \config\applicationhost.config file inside that folder. Then make sure that you've allowed IIS express to listen to that subdomain.
You can refer to Scott's article on how to configure IIS Express. Specifically look for this paragraph "1. GETTING IIS EXPRESS TO SERVE EXTERNALLY OVER PORT 80"
To be more specific, you need to run these commands:
netsh http add urlacl url=http://{your-domain}:{custom-port}/ user=everyone
netsh firewall add portopening TCP {custom-port} IISExpressWeb enable ALL

Windows Server 2012 IIS Issues

Let me first say I soley beleive IIS is usless because I have never gotten it to work ever, no matter what I do it never lets me access the website.
Before I start let me establish I have no choice but to use IIS in this instance and I really need this to work.
Let me also establish the following:
Yes I have tried turning it off and on again
There is 0 (NONE) firewall on this machine, and yes the server is entirely updated
My question is, whenever I try to create a website, for example the port im launching a server on is on port 3606.
I am attempting to have my website come up on port 3606, and direct me into a folder that is located at c:\mysqlservices
Now! Inside this folder is phpmyadmin source files, and in a desperate attempt to get this to work I have made the permissions to where EVERYONE, IUSR and IIS_USR all have full read write and nuking permisisons to this directory, its files, and all of its subdirectories.
Now, When I go to this address, for example, panel.archservers.com:3606,
All I get is the issue "403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied."
Thank you in advance for the help, all I need is to get this IIS server to actually work, because as it is, I cannot do anything with this IIS server..
Thank you very much in advance
This link suggest to add "IIS_IUSRS" user, which is not the same as "IIS_USR".
I needed to install the PHP core, then reset my permissions back to just iis_usrs.
It worked great
you are entering a wrong context...give a correct context of your application it will open that page..
Ex:
www.example.com - Forbidden Error
www.example.com/ex.jsp - Displays the respected page
Also check proper permissions are supplied or not to the directories

IISExpress AppPool identity verification

I needed to run IISExpress under a specific identity. After going through this post how to run iisexpress app pool under a different identity I changed the processModel's username and password attributes in my \Documents\IISExpress\config\applicationhost.config file.
I would like to verify the change in my web application. Is there a way to verify?
Ultimately, what I'm after is that my security works properly using the PrincipalPermission attribute. I believe the Name property on this attribute matches the user under which IISExpress and my application are running.
Thanks in advance for your help.
IISExpress runs with current user identity and changing ProcessModel username/password won't help. Only way to run with particular identity is to launch iisexpress.exe with 'runas'.
I'm probably way too late to help, but have you tried changing your project to run with Local IIS instead of IIS Express?
Here's the way I do it (you could start in Visual Studio, but I find this more straighforward):
Launch IIS Manager with admin privilege (important that you have rights to muck with localhost)
Add a new Application Pool running with the Identity you need for your database (probably your windows account)
Create a new application on iis
point it to your project folder
assign it to the app pool you just created
In Visual Studio open your project's properties (select the project in solution explorer hit Alt-Enter or use context menu). In the Web Section, select Local IIS instead of IIS Express. No need to create virtual directory (you already did).
Now your app can open the database. As an added bonus, your project is always available to run. no need to start it from visual studio.

Uploading MVC Website and MySQL to Webhost

I created a website using Code Ignitor and MySQL and want to upload everything to 000webhost.com
How do I:
upload my models, views and controllers to the public_html folder of 000webhost?
get my MySQL database up and running on 000webhost?
Thanks in advance
I am presuming that your control panel is cPanel. If thats the case then upload all your files in the web root of the server. Create a database, and change that details in database.php inside config folder. thats it, your site will be up and running.
Your .htaccess (at least mod_rewrite for codeigniter) will not work if you use the free 000webhost service (at least the last time i wanted it, the support told me that they doesn't support it... that was thy time i signed up for their free service for private test of scripts i wrote). Another thing is that for the free hosting they use their own control panel (not cPanel), cPanel is for the paid accounts.
Anyway they both offer ftp accounts, mysql databases and of course web ftp (online file manager). All you need is a ftp client (such as FileZilla or even Windows Explorer itself).