当使用IIS前preSS没有应用在远程PC的CSS [英] When using iis express no css applied on a remote pc

查看:117
本文介绍了当使用IIS前preSS没有应用在远程PC的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想出了一个必要从远程PC,同时发展与我的asp.net mvc的网站工作。所以,我将其配置为使用IIS防爆preSS。

首先,使用Windows身份验证提出了一个问题。我的网站应该在Windows域联网工作,所以我想用集成Windows身份验证。我设法使其在Firefox的工作与如何:Firefox和集成Windows身份验证 IIS防爆preSS Windows身份验证 (由bees73答案)。但IEXPLORER还要求打印登录/密码,即使我打开它在本地,并指定我的IP,而不是本地主机。

与IE浏览器的问题仍然没有得到解决,但希望这是 - 如果我在凭证打印,它在本地工作。

我的问题是:当我打开我的网站在远程PC(无论是在火狐(无需打印登录/密码)和IE(我必须打印login'n'password))我的页面而不应用呈现造型。它看起来像没有CSS是可用的。但我没有得到任何错误。

在加载页面我有行之源$ C ​​$ C

 <链接HREF =/内容/的site.css的rel =stylesheet属性类型=文/ CSS/>

但是当我尝试看看的site.css,它说,有一些内部服务器错误。

我觉得我没有正确配置IIS防爆preSS,这就是问题。如果是OK,集成Windows身份验证有没有要求用户名和密码的IE浏览器,至少我想上班。

所以,我的配置:


  1. 项目本身 - 到IIS防爆preSS,windows身份验证 - 上,匿名 - 关闭

  2. 的netsh的http添加urlacl URL = HTTP:// MYIP:MyPort上用户=域名\\ mylogin

  3. 的netsh的http添加iplisten ipaddres = MYIP

  4. 对ApplicationHost.config

绑定:


 <网站名称=mysite的ID =2>
    <应用路径=/applicationPool =Clr4IntegratedAppPool>
        < virtualDirectory路径=/physicalPath =D:\\ .../>
    < /用途>
    <&绑定GT;
       <绑定协议=HTTPbindingInformation =*:MyPort上:本地主机/>
        <绑定协议=HTTPbindingInformation =*:MyPort上:MYIP/>
    < /绑定>
< /网站>


验证:


 < sectionGroup NAME =身份验证>
   <节名称=anonymousAuthenticationoverrideModeDefault =拒绝/>
   ...
   <节名称=windowsAuthenticationoverrideModeDefault =允许/>
< / sectionGroup>




 <身份验证和GT;
    < anonymousAuthentication启用=假的userName =/>
    ...
    < windowsAuthentication启用=真正的>
        <供应商>
           <增加价值=谈判/>
           <增加价值=NTLM/>
        < /供应商>
     < / windowsAuthentication>
< /认证>




 <添加名称=AnonymousAuthenticationModulelockItem =真/>




 <位置路径=mysite的>
    < system.webServer>
        <安全>
            <身份验证和GT;
                < anonymousAuthentication启用=FALSE/>
                < windowsAuthentication启用=真/>
            < /认证>
        < /安全>
    < /system.webServer>
< /地点>



解决方案

的问题与ISS前preSS的netsh和绑定配置连接。起初我设置它通过我的IP,它导致了混乱的错误。

在寻找在我跑过的设置IIS防爆preSS 。都是一样的存在,但它的使用PC名称提示的的netsh 的和IIS的对ApplicationHost.config 的。

所以,我增加了

 的netsh的http添加urlacl URL = HTTP:// MyPCName:MyPort上/ USER =大家

 <绑定协议=HTTPbindingInformation =*:MyPort上:MyPCName/>

和奇迹!它的工作。

对于IE浏览器,我不得不把关闭使用Windows授权标志,使其工作。非常感谢<一个href=\"http://blog.super-networking.net/2008/02/internet-explorer-enable-integrated-windows-authentication/\"相对=nofollow> Internet Explorer中 - 启用集成Windows身份验证。但尽管如此,IE仍然要求登录名和密码,如果一个IP在URL中使用。如果PC名称用它默默地工作。

火狐或者要求登录名和密码(如果一个人进入有效凭据的作品),也应当适用的如何:Firefox和集成Windows身份验证(在我的问题提到的)然后将它与IP和计算机名的作品都默默

希望这可以帮助其他人。

修改

一句话:我不得不与administrtor权限推出VS2010。如果不是这样,我仍然得到HTTP 500错误基础上的不良模拟错误。因此,它看起来像IIS防爆preSS,由VS2010没有管理员权限的Windows 7中推出,将无法正常工作。

据我的理解,线索是给适当的权限IIS_IUSRS。但在此之前,它更容易推出VS 2010具有管理员的privilages。

I came up with a necessity to work with my asp.net mvc site from a remote pc while developing. So, I configured it to use IIS Express.

At first, a problem raised with windows authentication. My site is supposed to work in windows domain intranet, so I wanted to use integrated windows authentication. I managed to make it work on firefox with How To: Firefox and Integrated Windows Authentication from IIS Express Windows Authentication (answer by bees73). But IExplorer still asks to print login/password, even if I open it locally, specifying my ip instead of localhost.

The issue with IE is still not resolved, but let it be - if I print in my credentials, it does work locally.

My question is: when I open my site on a remote PC (both in firefox (no need to print login/password) and IE (I do have to print login'n'password)) my page is rendered without applying styling. It looks like no css is available. But I don't get any errors.

In the source code of the loaded page I do have line

<link href="/Content/Site.css" rel="stylesheet" type="text/css" />

but when I try to see the Site.css, it says, there was some internal server error.

I think I did not configure IIS Express properly and that's the problem. If it was OK, the integrated windows authentication had to work without asking login and password on IE at least I guess.

So, my config:

  1. The project itself - to IIS Express, windows authentication - on, anonymous - off.
  2. netsh http add urlacl url=http://myip:myport user=domainname\mylogin
  3. netsh http add iplisten ipaddres=myip
  4. in applicationhost.config:

Bindings:

<site name="MySite" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="D:\..." />
    </application>
    <bindings>
       <binding protocol="http" bindingInformation="*:myport:localhost" />
        <binding protocol="http" bindingInformation="*:myport:myip" />
    </bindings>
</site>

Authentication:

<sectionGroup name="authentication">
   <section name="anonymousAuthentication" overrideModeDefault="Deny" />
   ...
   <section name="windowsAuthentication" overrideModeDefault="Allow" />
</sectionGroup> 


<authentication>
    <anonymousAuthentication enabled="false" userName="" />
    ...
    <windowsAuthentication enabled="true">
        <providers>
           <add value="Negotiate" />
           <add value="NTLM" />
        </providers>
     </windowsAuthentication>
</authentication>


<add name="AnonymousAuthenticationModule" lockItem="true" />


<location path="MySite">
    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="false" />
                <windowsAuthentication enabled="true" />
            </authentication>
        </security>
    </system.webServer>
</location>

解决方案

The problem was connected with netsh and binding configuration in ISS Express. At first I setup it through my ip, and it resulted in confusing errors.

While searching for anything in the web I ran across Setting up IIS Express. All the same there, but it's suggested using pc name in netsh and iis applicationhost.config.

So, I added

netsh http add urlacl url=http://MyPCName:MyPort/ user=everyone

and

<binding protocol="http" bindingInformation="*:MyPort:MyPCName" />

and a miracle!! It worked.

As for the IE, I had to turn off the "Use Windows authorization" flag to make it work. Many thanks to Internet Explorer - Enable Integrated Windows Authentication. But nevertheless IE still asks for login and password, if an ip is used in url. If pc name is used it works silently.

Firefox either asks for login and password (and works if one enters valid credentials) or you should apply How To: Firefox and Integrated Windows Authentication (mentioned in my question) and then it works silently both with ip and pc name.

Hope this helps someone else.

EDIT

One remark: I had to launch VS2010 with administrtor permissions. If not, I still get HTTP 500 error based on the bad impersonation error. So, it looks like IIS Express, launched by VS2010 without administrator permissions under Windows 7, won't be able to work correctly.

As far as I understood, the clue is to give the appropriate permissions to IIS_IUSRS. But until that it's easier to launch VS 2010 with administrator privilages.

这篇关于当使用IIS前preSS没有应用在远程PC的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆