Simple release of Asp.net website

Source: Internet
Author: User
Overview

Websites are made up of pages. They are the specific form of realization of the World Wide Web. For more information about the World Wide Web and web pages, see this blog: The World Wide Web documentation. The purpose of website publishing is to allow others to access the pages of the website through a browser.

Website publishing includes source code publishing and pre-compilation Publishing. Source code is directly released without compilation of the source code. Pre-compilation and release are released after some of the source code assembly is compiled and the corresponding DLL file is generated, the assembly on the interface is not pre-compiled, and they all need the World Wide Web server. A server is a piece of software that can be installed on a common PC. If we need a server that can run efficiently and securely, we can also provide the corresponding hardware calculator (hardware server) for the software ), let's take a look at the link above for a theoretical knowledge about servers.

The following describes how to use the IIS server and Apache server to publish the Asp.net website.

IIS server pre-compiled and released

The procedure is as follows:

1. vs2010 pre-compiled website

2. Enable the IIS server

3. Set IIS server

1. vs2010 pre-compiled website

A. Right-click the Assembly on the interface and choose publish.


B. Release Method: File System; Target Location: location where the source program is pre-compiled and stored


C. Code pre-compilation completed

2. Enable the IIS server

The IIS server program is installed in Windows 7. You can use it as long as it is manually enabled. The details are as follows:

A. Control Panel -- program -- enable or disable the windwos Function


B. Enable the IIS function, select the check box, and click OK.


Note: When I started the service, because I did not select Internet Information Service-World Wide Web Service-common HTTP functions-static content, the web page was not displayed and the CSS style was invalid, the page layout is messy. If you are afraid of errors, you can check all the content in Internet Information Service.

C. The IIS service is successfully enabled.

3. Set IIS server

A. Register IIS to

Start-run cmd-enter the command character interface-enter cd c: \ WINDOWS \ Microsoft. NET \ framework \ v4.0.30319-input aspnet_regiis.exe
-I


Register IIS to vs for normal development and debugging. If you are using vs 05 or a later version, you can also perform normal development and debugging without IIS, you can skip this step. At this time, IIS is mainly used to publish websites.

B. Add the website to the IIS server

Right-click computer-Manage-services and applications-Internet Information Service (IIS) Manager-right-click website-add website


Enter the information required to create a website

Modify the version of IIS corresponding to. net. For programs written in vs 10, 4.0 is used by default, and 2.0 is used by IIS by default. Therefore, you need to change it to 4.0.


Add corresponding management objects to the IIS server. Create virtual directory


 

Replace the virtual directory with an application. Then, click the content view, right-click the specific web page, browse, and click OK.

 

The distribution of IIS source code is the same as the above operations, except that all source code is stored in the virtual directory, which is not described here. If the website to be published is stored in its physical address when the website is created, you can preview it directly without any further operations. Of course, it can also be accessed through a browser.


Steps to publish a source code website on the Apache server

1. Install the Apache server

2. Install the parsing module of Asp.net

3. Set the Apache server

The parsing module of Apache and Asp.net is address. For the installation of Apache server and Asp.net, follow the prompts to install them step by step, that is, click Next. After Apache is installed, we need to set its configuration file so that the listening port is 8085 and virtual directories do not need to be set. After the parsing modules of Asp.net are installed, what we need to do is to enable Apache to call the Asp.net parsing module and associate the two modules. The specific operations are as follows.

Add such a string at the end of the configuration file of the Apache server.

#mod_aspdotnet support  Include conf/mod_aspdotnet.conf  

In the folder where the Apache configuration file is located, create a file named mod_aspdotnet.conf, which contains the following string

# ASP. net support loadmodule aspdotnet_module modules/mod_aspdotnet.so addhandler Asp.net asax ascx ashx asmx aspx axd config CS csproj licx REM resources resx soap VB vbproj vsdisco webinfo <ifmodule details> # mount the ASP. net example application # store website source code or pre-encoding and decoding in the ISS folder aspnetmount/Web"D:/system/ISS" # map all requests for/active to the Application Files # store website source code or pre-encoding and decoding in the ISS folder alias/Web"D:/system/ISS" # Allow Asp.net scripts to be executed in the active example # store website source code or pre-encoding decoding in the ISS folder <directory "D: \ System \ Iss "> options followsymlinks execcgi order allow, deny allow from all directoryindex index. aspx default. aspx index.html </directory> # For all virtual ASP. net webs, we need the aspnet_client files # To serve the client-side helper scripts. aliasmatch/aspnet_client/system_web/(\ D +) _ (\ D + )/(. *) \ "C:/Windows/Microsoft. net/framework/V $1. $2. $3/asp. netclientfiles/$4 "<directory" C:/Windows/Microsoft. net/framework/V */asp. netclientfiles "> options followsymlinks order allow, deny allow from all </directory> </ifmodule>

Then, enter http: // localhost: 8085/web/default. aspx in the browser.

Note: For users who have never touched Apache, it is best to divide them into two phases: install Apache and configure its configuration file to access static web pages through a browser; install some parsing modules, set the corresponding configuration file to allow the browser to access dynamic web pages such as Asp.net. In addition, if you install the above software, you need to change all the. NET frameworks developed on your website to 3.5, because it does not support 4.0.

Modify the framework used by the interface assembly (other class library assembly are operated in sequence)



Summary

For a strange thing, we need some time to get in touch with and understand it. In this process, it will give you various clues, what you need to do now is to select one and prove it with facts!

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.