How to publish an ASP. NET Website

Source: Internet
Author: User

As needed, I found an article about publishing a website for use,

This article from csdn blog: http://blog.csdn.net/xqy_2007/archive/2008/12/16/3528748.aspx

 

To publish an ASP. NET Website to a server, complete these steps:
1. Create a virtual directory on the server to store all website files;
2. Specify the domain name or IP address used for the website;
3. Provide the FTP user name and password for remote users to upload files.

 

The following describes the background of Windows Server 2.0 or Windows XP with. NET Framework 2003 installed,
How to configure a web site on the server:

 

1. Configure IIS on the Web Server
Internet Information Server (IIS) is a World Wide Web server.
Gopher server and FTP server are all inclusive.
IIS means that you can publish web pages, and ASP (Active Server Pages), Java, and VBScript generate pages,
There are some extension functions.
Secondly, IIS is a file and application server provided together with Windows NT Server 4.0,
Is a basic component for creating an Internet server on Windows NT Server. It is fully integrated with Windows NT server,
Allows you to use the built-in security of Windows NT server and the NTFS file system to create powerful and flexible Internet/Intranet sites.

1. Prepare an IP address for the site
Any website that can be accessed must have a fixed IP address, Windows Server 2003 or Windows XP
You can set multiple IP addresses for the same Nic as follows:
Right-click "Local Connection" and execute the "properties" command in the shortcut menu to open the "Local Connection Properties" dialog box.
Select Internet Protocol (TCP/IP), click Properties, click advanced in the displayed dialog box, and then click
In the IP address area, click Add. In the displayed dialog box, enter the IP address and subnet mask to add.
(For example, IP Address: 192.168.0.1, subnet mask: 255.255.255.0)

Note: If the number of IP addresses on the same network card exceeds 9, the operation stability cannot be guaranteed ".
An effective solution to this problem is: if there are too many sites on the same server, you can
To distinguish sites. For example, "http: // 192.168.0.1: 8080" and "http: // 192.168.0.1: 8081"
It indicates two different sites that use the same IP address (port numbers are "8080" and "8081"), and the default http port number is "80 ",
That is, "http: // 192.168.0.1" is equivalent to "http: // 192.168.0.1: 80.

 

2. Create a "home directory" for the site"
Each web site must have a "main directory ". This directory is the directory on which all files of the site are stored on the server. Required directory
The drive must be an NTFS partition.

 

3. Configure IIS
Open Administrative Tools on the control panel, and open Internet Information Service (IIS) manager in the Administrative Tools window"
Open the IIS Management window. Select "website" in the Left window of the manager, and then select "website" under "new" in the "operations" menu"
Command. Start the website creation wizard and follow the wizard prompts to enter the website description and IP address assigned to the website. Operation completed
Then an empty site will be created. You only need to publish the website to the specified directory of the website to access the website through a browser.
Note: For systems without IIS added, you must first add IIS to them. To add a program, open "Add/delete programs" in "Control Panel"
Select "Add/delete Windows components", select "Internet Information Service (IIS)", insert the system disk to the optical drive, and click "Next"
Install IIS. You must install IIS first to configure the website in IIS.
Note: You can further set up a website that has created a virtual site in the IIS Management window. In the IIS Management window, right
Click the created website and open its properties dialog box for further settings:
(1) ASP. NET 2.0 is required for ASP. NET Websites created in vs2005.
And IIS is ASP. NET 1.1 by default. Therefore, "ASP. NET 2.0" under the ASP. NET tab in the Properties window must be opened.
Select ASP. NET 2.0 from the drop-down list box.
(2) In the "enable default document" Area of the "documents" tab in the Open Properties window, click "add" to name the start page of the website.
Add to text box. In this way, the default start page is displayed after you enter the domain name or IP address of the site in the browser, without entering the start page name.
(3) You can change the site description, IP address, TCP port, and other information on the "website" tab in the Open Properties window.

 

When releasing a website for the first time, you may encounter the following problems:
(1) The following prompt appears after entering the website address in the browser:
"The server application is unavailable.
The Web application you are attempting to access on this web server is currently unavailable. Please click "refresh" in the web browser to try your request again ."

When we view the System Event Log, we find that:

Error:
Failed to initialize appdomain:/lm/w3svc/1/root, failed to Load file or assembly "system. Web ...."

Error:

Failed to execute the request because the application domain cannot be created. Error: 0x80070005 Access denied.
Warning:
Failed to initialize appdomain:/lm/w3svc /...
Exception: system. Io. fileloadexception
Message: failed to Load file or assembly "system. Web, version = 2.0.0.0, culture = neutral,
Publickeytoken = b03f5f7f11d50a3a "or one of its dependencies. Access denied.
.

There are generally two reasons for the problem:
1. asp. net2.0 is not correctly registered in IIS
2. Permission issues

In the first case, you can re-register Asp.net:
System Disk/Windows/microsoft.net/framework/v2.0.50727 (Version Number)/aspnet_regiis.exe
-I
Or enter aspnet_regiis.exe directly at the mocrosoft. NET Framework V2.0 SDK command prompt.
-I
For permission issues, make sure that the account running Asp.net is
Service, which is ASPnet in XP) Has access permissions to N directories, mainly System directories.
(The specific list can be easily found on the Internet), there is also a directory that is easy to ignore: the virtual directory corresponding to the Web Application

(2) The following prompt appears after entering the website address in the browser:
"An error occurred while accessing IIS metadata"

This is because VS 2005 is installed first, and IIS is installed later.

The solution is as follows:
Open the "SDK command prompt" in the "Microsoft. NET Framework SDK V2.0" directory in the Start Menu ",
Run "aspnet_regiis-r" in the command prompt.
If you only install the. NET Framework, you can run the same command in the following directory:
% SystemRoot %/Microsoft. NET/framework/v2.0.50727

 

2. Create an FTP remote management account

After creating a site required to publish an ASP. NET Website in IIS, you must also provide an FTP server account for remote file upload.

Of course, if it is only released on the LAN, the last step will be saved.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.