新手尝试部署 Asp.Net 网站

发布于 2024-09-17 10:21:06 字数 312 浏览 6 评论 0原文

我基本上想知道部署 Asp.Net 网站的最佳方法是什么,主要是从安全的角度来看。现在,我正在尝试使用 Visual Studio 2010 发布网站。有人可以指导我找到有关如何安全地执行此操作的好教程吗?例如,可以通过 Visual Studio 通过加密连接来完成吗?是否需要在服务器上安装任何软件才能做到这一点?我应该首先使用不同的程序打开 SSL (TLS) 连接吗?如果是,使用哪个程序(它是 Windows 的标准配置)?

服务器运行的是 Windows Server 2008。开发是在 Vista 上进行的。

非常感谢您对此事的任何指导!

安德鲁

I'm basically wondering what the best way to deploy an Asp.Net Web Site is, mostly from the point of view of security. Right now, I'm trying to publish the website using Visual Studio 2010. Could someone direct me to a good tutorial on how to do this securely? For example, can it be done over an encrypted connection via Visual Studio? Is it necessary to install any software on the server to do this? Should I use a different program to open up an SSL (TLS) connection first, and if so, which program (does it come standard with windows)?

The server is running Windows Server 2008. Development is on Vista.

Many thanks in advance for any direction in this matter!

Andrew

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

机场等船 2024-09-24 10:21:06

我会将网站发布到您的本地计算机,并将文件复制到您的测试/生产环境。通常,我们不会直接从 VS 发布站点以进行测试或生产。

例如,您不想意外地将东西从开发环境直接推送到实际环境中,不是吗?

就文件传输安全性而言,您可以使用 SFTP。

I would publish the site to your local machine and file copy the files across to your test/production environment. As a rule we don't publish sites straight from VS to test or production.

For example you don't want to accidentally push things straight from dev into a live environment do you?

As far as the file transfer security goes you could use SFTP.

画▽骨i 2024-09-24 10:21:06

注意:首先要咨询服务器的所有者,因为他们通常会为您提供 FTP 连接并负责配置 IIS。

如果您想添加安全性、创建密钥文件并对程序集进行签名并考虑在 dll 上运行 Dotfuscator,则 Visual Studio 中包含社区版。这是一个较早的问题,我在其中提供了有关 Dotfuscator 的更多信息。

如果您必须自己进行部署,则需要考虑以下几点。

  • XCopy(简单)
  • MSI(必须创建一个安装程序,您可以在 Visual Studio 中轻松完成此操作)

使用 Visual Studio 进行部署没有安全优势,但您可以使用 Visual Studio 创建一个小型安装程序。为了安全起见,您要确保的一件事是不要部署任何 .cs 文件。准备你的文件,你应该在Release模式下编译,确保你的配置文件中没有启用调试,保留你的bin和它的dll,还有aspx、asmx、ascx、svc、css、js和配置文件。

  • XCopy:安装一个小型 FTP 服务器,或者使用您公司已有的服务器,这将允许您在登录到目标计算机后获取文件。您应该能够获得目标计算机的管理员帐户,只需询问域的系统管理员,然后使用远程桌面登录,进入 ftp 站点并下载文件。在目标计算机上打开 IIS,创建虚拟目录和池。将文件复制到该位置,将连接字符串配置到数据库(如果您使用数据库),然后测试您的网站。
  • MSI:与上述过程相同,只是安装程序将为您创建虚拟目录和池。

以下是来自官方 ASP.Net 网站 的有关最佳实践的额外信息。

Note: First thing is to check with the owner of the server, as they often will provide you an FTP connection and will take care of configuring IIS.

If you want to add security, make a keyfile and sign your assemblies and consider running Dotfuscator on your dlls, the community edition is included in Visual Studio. Here is an earlier question where I've put more info on Dotfuscator.

If you have to do the deployment yourself, here's a few things to consider.

  • XCopy (easy)
  • MSI (have to create a setup program, you can do this easily in Visual Studio)

There is no security advantage in deploying using Visual Studio, but you can use Visual Studio to create a small setup program. One thing you want to make sure for security is DO NOT deploy any .cs files. Prepare your files, you should compile in Release mode, make sure debug is not enabled in your config file, keep your bin and it's dll, also the aspx, asmx, ascx, svc, css, js, and config files.

  • XCopy: Install a small FTP server, or use one your company alreayd has, this will allow you to get your files once you are logged into the target machine. You should be able to get an administrator account for the target machine, just ask the sysadmin of the domain, then log on using remote desktop, got to your ftp site, and download your files. Open IIS on the target machine, create a virtual directory and a pool. Copy your files to the location, configure your connection string to your DB if you use one, then test your website.
  • MSI: same process as above, except the setup will create the virtual directory and pool for you.

Here is extra info on best practices from the official ASP.Net website.

英雄似剑 2024-09-24 10:21:06

如果您对服务器有一定的控制权(例如配置 IIS7),您可能需要研究一下 Microsoft Web Deploy(刚刚发布的新产品):

http://weblogs.asp.net/scottgu/archive/2010/09/13/automating- Deployment-with-microsoft-web-deploy.aspx

我自己还没有尝试过,但看起来相当光滑,而且它显然对复制的数据进行了加密,所以可能适合您。

If you have some control on the server (e.g. to configure IIS7), you might want to look into Microsoft Web Deploy (new product just been released):

http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx

Haven't tried it myself, but looks quite slick and it apparently encrypts the data being copied up, so might suit you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文