IIS Map Network Drive to Virtual Directory - iis

I'm working on setting up a Drupal 8 Site on IIS. On Linux, we commonly have a network share that all Load Balanced Nodes can access, and then a symlink to connect the directory /sites/default/files to that share. I need the same for IIS.
Things that didn't work:
1) Virtual Directory in IIS: We authenticated with a user on the AD, and we were able to load all files (i.e. the images on the site appear). However for some reason, Drupal couldn't see it and also created a folder "files" in the same directory, through the front end and IMCE I can only write to that folder and not the Virtual Directory. If someone knows a resolution here that would be helpful.
2) Regular Shortcut: Same problem as above. Drupal doesn't see the shortcut since it's actually named files.lnk when created through the file browser. It creates another folder ./files and refers to that instead of the shortcut.
3) Hard Links: I tried running this command `cmd /c mklink /J D:\inetpub\wwwroot\\web\sites\default\files "\\Public Files\files" and it simply stated "Local Volumes are required to complete this operation"
4) Soft Links: Changing up the switch on the previous command to cmd /c mklink /d D:\inetpub\wwwroot\<site_dir>\web\sites\default\files "\\<share>\Public Files\files" works, but I'm only getting HTTP 401 errors in Chrome, even though I've allowed the Local Group IIS_IUSRS to have full control, plus opening it up to almost every user.

Related

Creating Virtual Directory on IIS for Coldfusion Lucee

I am trying to Move my Website on a local directory from Adobe Coldfusion to Lucee.
I was able to Install Lucee with the Windows Installer.
IIS is working fine.
When i Create a Virtual Directory from IIS to Map a Physical Path (C:/Website) outside the inetpub root folder (FOR IIS) or outside the Tomcat/webapps/ROOT folder (for Lucee), IIS doesn't load that physical folder. Instead it loads the inetpub root folder and i can't access files from the Physical Path Directory.
I am using //localhost/{The Alias} to call the Website but saying file not not found.
Obviously because it's calling from Inetpub file Directory, not the Physical path.
Are there any special configurations i need to make?
I have searched online and no post could help.
Note that i am using different computers.
Kindly Assist.
mod_cfml (the adapter that is used with Lucee/IIS along with the BonCode Connector) does not currently support virtual directories. You will need to configure those manually in the Tomcat context config, like so:
<Host name="lucee.org" appBase="/home/lucee/public_html">
<Context path="/vdir/" docBase="/home/other_user/public_html/some_other_directory/" />
<Alias>www.lucee.org</Alias>
</Host>

How to get freb.xsl file in IIS_FailureTrace directory

I am running IIS on Windows Server 2012 R2. I follow the follow steps to enable 'failed request tracing' in IIS:
http://blogs.msdn.com/b/kishorerajendran/archive/2015/05/08/iis-failed-request-tracing.aspx
I get a fr000001.xml file in my 'DataDir\Logs\IIS_FailureTrac directory, but there is no freb.xsl file. I tried go to IE and do http://localhost, that does not help.
How can I get the freb.xsl file?
On Windows Server 2008 R2, I completely deleted the W3SVC1 folder in C:\inetpub\logs\FailedReqLogFiles\ .Then I requested again the page with my error. The folder W3SVC1 was recreated, and this time it contained my failed request .xml as well as freb.xsl. (if that doesn't work, you could be lucky, try from a dos prompt, from c:\, dir freb.xsl /s. I've got multiple copies of it for iis, iisexpress, multiple web sites, etc... it's in My Documents\IISExpress\TraceLogFiles for example)

aspnet_compiler Failed to map the path '/'

.NET 4.5.2, IIS 8.5 on Windows 8.1 x64. I have a single ASP.NET web site at /localhost/. The DEFAULT website is disabled, a new site with was created with the right bindings. I am trying to pre-compile it in place:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_compiler -c -v /
error ASPRUNTIME: Failed to map the path '/'.
I tried the metabase-path route:
aspnet_compiler -c -m lm/w3svc/2/root
error ASPRUNTIME: Failed to map the path '/'.
I Can get it to compile by specifying the physical path but I don't want to do that because this same application exists on different servers with different physical paths (devs, QA, production). Not even the metabase paths are all the same. "/" is the same everywhere.
For grins I added this to a page in the site to make sure i wasn't losing my mind:
Response.Write(Server.MapPath("/"));
and got what I expected.
What am I doing wrong?
This is a rights issue; apparently you need to be administrator to access the IIS metabase.
I see two possible solutions:
Use -p to specify the physical path; that way aspnet_compiler does not need to access the IIS metabase. (OP already explained this may not be a practical solution in a server cluster.)
Run aspnet_compiler from an elevated command prompt (i.e. "Run As Administrator"), as suggested here.

How can I CHMOD files/directories on Windows Azure?

I am using FileZilla FTP to right click and change a directories File Permissions as I do on many other sites/servers. For some reason this is not working in Windows Azure. It outputs in FileZilla "500 'SITE CHMOD 777 (mydirectory)': command not understood"
Any ideas?
The Windows Azure portal has a "Console" for websites where you can execute some shell commands. One of them appears to be chmod (fileutils) 4.1. I was able to modify the permissions on a folder using this:
chmod -R 744 myfolder
I found a hack solution to delete files on Azure:
Stop your website from the management console (https://manage.windowsazure.com)
Open up the FTP site in Filezilla
Rename the directory that has the problem to anything else (Possibly an optional step, I dont know)
Delete the renamed directory
Restart your website.
That seems to do it.
Windows Azure Websites is a Windows Server based server. Thus, file permissions don't work like in Linux (as #SLaks already mentioned).
However, the account your scripts (PHP/ASP.NET/node.js) are executed under has full access to the folder /site/wwwroot, as does your FTP user. Meaning that from your PHP you can do all fully privileged file access operations - Read, Write, Delete, Create, Create directories.
What you cannot do, and cannot be changed, is to execute scripts (which 0777 would give you in Linux).

Symlink created with mklink not working with IIS7.5 -- Windows 7

So while in my IIS root directory (c:\inetpub\wwwroot) I've created a symlink to a network drive using:
mdlink /D truthuniversal "U:\Truth Universal Full Site\public"
The symlink was created just fine, and if I issue the cd truthuniversal command, while in the IIS root dir, I do indeed end up in the "U:\Truth Universal Full Site\public" directory area.
My problem is that when I type:
http://localhost/truthuniversal
in my browser's address bar IIS does not serve the index page which resides in the public directory. Instead, I get the following error:
Server Error in Application "DEFAULT WEB SITE"
Internet Information Services 7.5
Error Summary
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Please advise.
-TU
You need to create a virtual directory mapping to that directory in IIS in order for it to serve up the page. In IIS, right click on "Default Website", then click "Add Virtual Directory". Also, doing this, there is no reason why you even need the symlink. Just map it to the target to begin with.
I agree that virtual directory in IIS may be what you want, but if you want to minimize IIS maintenance, consider this:
Instead of directory symbolic link: mklink /D
try directory junction: mklink /J
This worked for me and the web apps are able to write to the same directory.
mklink /J App_Data d:\shared\App_Data
worked for me on Windows Server 2008 R2.

Resources