HTTP Error 404:File or Directory doesn't exist - iis

I have my local site hosted on IIS and Sitecore.
When i am trying to access the site from my local ex: http://xyz.local/ I am getting the following error as shown in the below image. But i am able to access my local sitecore instance ex: http://xyz.local/sitecore/login.
I have tried checking the permissions for the root folder which has full control for all the users.
also tried some of the solutions but didn't work.
Appreciate any inputs on this.
Thanks.

Related

Drupal 9 files storage on Azure App service

Been fighting with the problem for a month now. Have Drupal 9 set up on Azure App service with docker images running php8 (base image drupal:9.1.7-php8.0-apache)
I have found out that there are two ways to have the "sites/default/files" public files directory served in azure:
Symlink "sites/default/files" folder to "/home/files" folder and set WEBSITES_ENABLE_APP_SERVICE_STORAGE to true in application settings.
Mount Azure file share directly on top of "sites/default/files" folder using Path mappings (currently in preview).
Both options works, my files are uploaded successfully and I can see them in the storages. Drupal also sees those files, BUT every time I try to access any of the uploaded files, I get 500 error with the only error being Failed to forward request to application. Encountered a System.Net.Http.HttpRequestException exception after 119.915ms with message: Received an invalid status line: 'anges: bytes'.. Check application logs to verify the application is properly handling HTTP traffic. If I delete the uploaded file, the app reacts and shows that file not found instead.
If I disable persistent storage (any of the options mentioned above), the files are uploaded correctly, no errors are shown, but the problem is that every time the app is restarted or deployed, the files are gone.
Drupal has no errors in its log. Apache logs have no more useful info (GET seems to be ok and returns 200). Have tried messing with apache.conf, with php.ini, with both .htaccess files allowing all kinds of nasty things, but still have no clue. Had multiple colleagues look into this and nothing seems to work.
Adding EnableSendfile On into Dictionary block resolved the problem.
Example:
<Directory /media/share/www/>
EnableSendfile On
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Require all granted
</Directory>
Quick update: Tried every last thing I could imagine. Had numerous people try and help, but the same error 500 or 502 appears. Two weeks no answer from microsoft support.
Created new app service not with docker containers but php 7.4 and manually uploaded all drupal files to /home/site/wwwroot, also set WEBSITES_ENABLE_APP_SERVICE_STORAGE to true so that /home dir stays persistant and the web seems to be working just fine, files are all good.
In previous attempts and now azure ssh shows all files inside /home dir as nobody:nogroup 777, will investigate this further as this might lead to some security issues if this is true (but checked settings.php etc. files and they are protected atleast from web access)

Http 403 error in Microsoft edge

I was getting "HTTP 403 error Microsoft Edge can’t get to this page", while launching an application from IIS in Windows 10. Please suggest a solution for this.
thanks
If all permissions are set and even though your website shows 403 forbidden, most likely the default page is not set for your website. With IIS, you can configure the default document as follows.
Connect to IIS.
Expand the sites and select the desired website.
From right hand side feature view, click on Default Document.
Set your desire default page and save the settings.
While you browse any website, IIS searches for the default page to be displayed. If the first default document is not available, IIS will look for the next default page from the list. When IIS is unable to find any match and directory listing is enabled for that particular website, IIS will show you the list of folders. If directory listing is disabled, IIS will return an HTTP Error 403 - Forbidden message to the browser.
If an empty application gives you a 403 I can think of two immediate reasons.
The permissions are wrong. You might need to give the application pool user (IIS AppPool\NAMEOFAPPPOOL with recommended configuration) read permission to the directory.
You don't have any content. If you try to access a directory in IIS you will get a 403. Add a file and try to access that directly, or a Default.aspx or index.html file to the directory you're trying to access.

Using Umbraco with Subfolders

I have built an Umbraco project (7.2.2) on my local machine and it all works well. I now want to copy it to our test server running IIS 7.5.
I have created a Virtual Folder in IIS under the default web site and copied the project across. The url I am using is www.ourserver.com/testumbraco. I can access the content ok but if I try to login to edit the content I get a blank page (umbraco#/login/false) and shortly afterwards it returns to the login page with Session timed out.
If I Inspect the page I can see that some resources have failed to load with Error 404. It is looking for www.ourserver.com/umbraco and not www.ourserver.com/testumbraco/umbraco.
Is there a configuration setting I need to change to make this work properly?
Thanks in advance for any suggestions.
You need to update the umbracoPath setting in the web.config

IIS 7.5 Virtual Directory to Mapped Drive

I have an S: which is connected via a username that exists both on server1 & server2.
The mapped drive works fine.
I connect this as a virtual directory called config in IIS it connects and works fine. I can see in content view the files in the mapped drive.
When I attempt to browse to one of these files it gets an error 500
http://www.mydomain.com/config/file.html
file.html is there
I've done this before, Im sure its a permission or security issue somehow, but I cant work it out
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
Give up mapped drives please,
http://support.microsoft.com/kb/207671
http://support.microsoft.com/kb/257174
The answer was two part.
Part one I was simply browsing the website, I wasn't using https and thus I was getting a different IIS site that didn't have the virtual directory.
Part two was I was using ColdFusion attempting to run a .cfm from the virtual directory, even with the correct website, it still got an error 404.
The resolution for this was to ensure the ColdFusion service was run as Administrator rather than LocalSystem and all was good.
Just for everyones reference, if you create the same username / password on both servers, share using that username, connect using UNC path and that username and it will work, no special permissions or anything.
Thanks to Karl & Lex for the help.

Problems with .pdf-files in Joomla 1.6

I've installed a Joomla 1.6 template, and everything is working fine except 1 thing.
I have uploaded some .pdf-files somewhere in the file system and people who visit the site can view or download these pdf-files, but when I click on the link or trying to right-click and "Save as target" I get an error message like this:
Forbidden
You don't have permission to access
/path/filename.pdf on this server.
Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request. Apache mod_fcgid/2.3.6
mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server
at website Port 80
I've logged in as administrator and checked if I found anything that denies access to files with .pdf extension, but all I found was that it seems like a .htaccess-file is being created in the same folder as the .pdf-files just after I'm trying to open them in my browser.
The content of the .htaccess file that is being created is this:
deny from all
I have also tried to edit this files content to "allow from all", and tried to delete it too, but Joomla is just changing it back.
Anyone know why or what that prevents me from viewing or downloading the pdf-files?
If it's a UNIX/Linux server you can FTP in with a client that shows permissions like FileZilla. It's probably the permissions associated with the parent folder cascading down to these files. Try to see if you can upload an image to the images folder and if you can save it the same way you're trying to save the PDFs. If downloading the image to your machine works, I would then look at the permissions settings. If you're not sure which permissions to look for, check out this: http://www.tuxfiles.org/linuxhelp/filepermissions.html
Usually a client can download/view files with permissions of 644 or higher.

Resources