20 things to be done after apache is installed in redhatas5

Source: Internet
Author: User
After installing apache in redhatas5, you must complete 20 tasks-Linux Enterprise Application-Linux server application information. For more information, see the following. 1. Edit the apache configuration file [root @ www ~] # Vi/etc/httpd/conf/httpd. conf2, ServerTokens OS found this line and changed "OS" to "Prod" (the name of the server operating system is not displayed when an error page appears) ↓ ServerTokens Prod failed changed to this State 3. ServerSignature On failed found this line and changed "On" to "Off" When ServerSignature Off failed. Apache version 4 is not displayed On the error page, serverAdmin root @ localhost Ghost set the Administrator mailbox as your commonly used mailbox ghost ServerAdmin zy66289214@126.com ghost according to the actual situation to modify the default settings 5, # ServerName new. host. name: 80 modify the host name ↓ ServerName www.hello521.com: 80 then modify the host name according to the actual situation, and keep the default port number 806, Options In Dexes FollowSymLinks locate this line, delete "Indexes", and add "endpoints" and "ExecCGI" into Options between des ExecCGI FollowSymLinks allow the server to execute CGI and SSI7, # AddHandler cgi-script. cgi handler finds this line, removes "#" at the beginning of the line, and adds ". pl "↓ AddHandler cgi-script. cgi. pl extension is allowed. the CGI script of pl runs 8, AllowOverride None locate this line, and change "None" to "All" then AllowOverride All pending to this State, allowing. htaccess9, logFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined success Locate this line using LogFormat "% h % l % u % t \" %! 414r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined failed changed to this status (Add "! 414 "to the rule, not recorded for too long logs) 10, adddefacharcharset UTF-8 found this line, add "#" character # AddDefaultCharset UTF-8 character at the beginning of the line without using the UTF-8 as the default code for the web page AddDefaultCharset GB2312 character and then add this line (add GB2312 as the default code) 11, Locate to find this tag, and change the corresponding Options Indexes MultiViews within the tag to find this line, delete the "Indexes" Delete existing Options MultiViews changes to this State (the tree directory structure is not displayed in the browser) 12. Delete the test page [root @ www ~] # Rm-rf/etc/httpd/conf. d/welcome. conf/var/www/error/noindex.html 13. Set the auto-start mode to [root @ www ~] # Chkconfig -- list httpdhttpd 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close [root @ www ~] # Chkconfig httpd on [root @ www ~] # Chkconfig -- list httpdhttpd 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable 14, [root @ www ~] # Service httpd restart httpd to change new configuration 15. Create a test page [root @ www ~] # Vi/var/www/html/index.html Hello, World!Hello, welcome to the linux Enterprise discussion group 13275765Enter http: // 192.168.1.11 on the client. We recommend that you use the Firefox browser for the corresponding server address. If Chinese characters cannot be correctly displayed, modify the utf8 [root @ www ~] of Firefox. # Rm-rf/var/www/html/index.html delete test page 16. Test php [root @ www ~] # Vi/var/www/html/test. php Enter http: // 192.168.1.11/test. php on the client to test cgi [root @ www ~] # Vi/var/www/html/test. cgi #! /Usr/bin/perlprint "Content-Type: text/html \ n"; print""; Print" Hello, World! CGI is working!
"; Print""; [Root @ www ~] # Chmod 755/var/www/html/test. cgi Input http: // 192.168.1.11/test on the client. for cgi, please refer to your server address 18 and test SSI [root @ www ~] # Vi/var/www/html/test.shtml build the SSI test page with the following content: Hello, World!TEST SSI Enter http: // 192.168.1.11/shtml19, 5] on the client to test. htaccess support [root @ sample ~] # Vi/var/www/html/index.shtml labels create a. htaccess test page with the following content: Hello, World!The name of the file is Enter "http: // 192.168.1.11" in the browser. If "Forbidden" is displayed, it means. htaccess is normal. Then create. htaccess file, and define the corresponding rules, as follows: [root @ sample html] # vi/var/www/html /. create an htaccess secret. the content of the htaccess file is as follows: DirectoryIndex index.shtml and then enter "http: // 192.168.1.11" in The browser. If "the name of The file is index.shtml" is displayed correctly. the rule in htaccess takes effect. OK. 20. delete the file used for testing [root @ www ~] # Rm-f/var/www/html/*/var/www/html/. htaccess

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.