Write your own C # framework from scratch (25)--Site Deployment "Go"

Source: Internet
Author: User
Tags iis access logs

Navigation 1. Turn off Access Protection 2, publish website 3, copy website to server 4, add new site 5, set website access rights 6, set folder access rights 7, control updatable folder Execute Permissions 8, set application pool. NET version with mode 9, attach database 10, add database access User 11, set up Database link 12, Deployment Considerations

For the safe deployment of the site, please look at my previous written in the server security deployment document has basically the server-related security settings are mentioned, follow the operation of the general hacker is more difficult to attack in (except for code vulnerabilities), and the deployment of this chapter is the set up on the basis of the creation of the site.

1. Turn off Access Protection

  Turn on the security protection software, turn off access protection (due to the policy, unauthorized to create the DLL and EXE files on the server, do not turn off the site's DLL files can not be copied to the server)

  

Remember to re-open access Protection after the site has been added successfully

2. Publishing website

Open the solution, right-click on the Web project, tap "Publish" in the pop-up menu- This generates the debug deployment package, and if you publish to a formal environment, you can click "Generate Deployment Package" to release the official version

  

Choose the publishing method for the file system, click the Publish button to publish the website

  

Copy the contents of the Red Box folder into the published folder (because these folders are not included in the project, they are not published together-this is to open the solution without loading too much content, which causes the solution to open too slowly, affecting vs usage performance)

  

This is the Post folder, the red box is the copy in the folder

  

  

3. Copy website to server

Copy the successfully published folder to the server and go to the Bin folder and delete the PDB file

  

4. Add a new website

  

If it is local operation and does not modify the host, please do not fill in the hostname, if it is operating on the server and you have your own domain name, please fill in the hostname of your own domain name

  

5. Set Site access rights

Please double-click the "Authentication"

  

In the window that opens, select Anonymous authentication, and then tap Edit

  

Select "Application Pool Identity"

  

6. Set Folder access permissions

Right-click on the new Web site and tap Edit permissions

  

Select the "Security" tab and click "Edit"

  

Then click Add

  

Click OK after entering the application pool name "IIS apppool\www.test.com" in the space (for some sites, you may also want to add authenticated users to access it properly)

  

Complete the application pool access permission to add, where permissions cannot be given permission to modify

  

7, control can update folder execution permissions

When we do the site folder configuration, we must do the "writable folder can not execute permissions, executable folder no write permission " requirement, so as to make the site more secure

For the Red Box folder, although not all writable folders, but because there are no need to execute the file, so they are set to no Execute permissions

First select the specified folder, and then double-click the handler mappings on the right

  

Open and click on the right "edit function Permissions"

  

Remove the checkmark in front of "script"

  

Write permissions are then given to the two folders in our framework that require write access to data and UploadFile

Right-click on the folder and tap edit permissions

  

In the Security tab, click Edit

  

Give modify permission to the application pool name "www.test.com" that you just added

  

8. Set the application pool. NET version and schema

  

Set it to. net4.0+ Classic mode

  

9. Additional Database

Tim database replication to the server

  

Open the Database Manager, right click on "Database", click "Attach"

  

Then attach the database in

  

10. Add Database Access users

Open Security = "Login Name"

Right-click the new Login Name Menu

  

Enter the login name, password, and select the default database

  

Select "User Mapping", tick the "solutiondatabase" database, and set the database role membership (this is often seen automatically tick when new, actually not checked, you need to click "OK" and then re-open, and then check the line, This should be a bug of MSSQL)

  

11. Set Up Database link

Then we open the server to create a new Web site Web. config, the database link user name and password is set to the database just created to access the user name and password, open the browser can be normal access.

12. Deployment Considerations

paste some of the important aspects of the server security deployment document and let everyone revisit the notes

1) Before the update must be tested by self-test and testing department personnel; 2) Modify the site of any configuration must be done in advance to make a backup, to facilitate the problem when the file back; 3) Modify the server-side of any settings must be submitted to do a good copy screen and record, easy to find problems when the site any problem; 4 ) When a feature does not work or error, please check Windows Firewall, McAfee Access Protection and firewall to see if the Access protection rules are blocked. 6 ) The user management must be checked periodically to see if there are any additional user and user membership groups changed; Check the application log, security log, System log, IIS access logs, log of site management logs, operational logs recorded in the Site directory and the log of records, McAfee access guarantee logs, etc. And do a good job of backup; see if Windows Firewall, McAfee Access Protection, and firewall are running, have forgotten to turn it off after accidentally shutting down, check the SQL related log and record growth, check the SQL backup situation, backup space is sufficient, etc. (see my other article " Server safety Inspection Guidelines--Daily maintenance instructions) 7) In addition to the server security-related configuration, code security is also very important, all submitted data must be good filtering operations, anti-SQL injection and XSS attacks, the client regularly antivirus check Trojan, regularly modify the login password to ensure system security.

Release the Last updated solution:

Updated "Directory and file description" for the data dictionary

and fixed the following bug: Information list and conditional query does not come out of the problem; Fix ConfigHelper class (configuration Read) Unable to discern true string problem when getting Boolean type, fixed issue that new employee is identified as separation status.

Write your own CSharp framework solution from scratch 20140718.rar

Write your own C # framework from scratch (25)--Site Deployment "Go"

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.