Install Apache-2.2.29 in CentOS6.4 source code

Source: Internet
Author: User

Install Apache-2.2.29 in CentOS6.4 source code

  1. /**
  2. * Install Apache-2.2.29 in CentOS-6.4-minimal
  3. * Timeout *----------------------------------------------------------------------------------------------------------------------
  4. * Three Steps for installing the software in source code
  5. * 1) configuration environment: the General Command is./configure -- prefix = DIR (that is, specify the software installation directory). If you want to enable other functions, add the command later.
  6. * For example, the following -- enable-ssl is used to enable the SSL module of Apache.
  7. * If you do not want to use the default SSL library of the operating system, you can use -- with-ssl = DIR to specify your own SSL library.
  8. * 2) Compile the source code: the common command is make.
  9. * 3) install the application. The General Command is makeinstall.
  10. * Timeout *----------------------------------------------------------------------------------------------------------------------
  11. * Notes
  12. * 1) the configure tool under the httpd-2.2.29 directory is a tool developed by the GNU software foundation for source code release.
  13. * 2) If this error occurs during Environment configuration [configure: error: noacceptableCcompilerfoundin $ PATH], the GCC compiling environment is missing.
  14. * Execute the [yum-yinstallgcc] command to install the tools and libraries required for compiling the source code.
  15. * 3) If this Error [Error: databasediskimageismalformed] occurs when running the yum command, it indicates that the yum cache has an Error and needs to be cleared.
  16. * Then run the [yumcleandbcache] command.
  17. * 4) the main task of configure during Environment configuration is to generate Makefile. The make command during source code compilation is compiled according to Makefile.
  18. * 5) it is best to install and start Apache as root. After running as root, apache will switch its derived process to a non-root user.
  19. * Timeout *----------------------------------------------------------------------------------------------------------------------
  20. * Install Perl5
  21. * [Root @ CentOS64software] # yum-yinstallwget
  22. * [Root @ CentOS64software] # wgethttp: // www.cpan.org/src/5.0/perl-5.20.1.tar.gz
  23. * Export root@centos64software?#tarzxvfperl-5.20.1.tar.gz
  24. * [Root @ CentOS64software] # cdperl-5.20.1
  25. * [Root@CentOS64perl-5.20.1] #./Configure-des-Dprefix =/app/perl
  26. * [Root@CentOS64perl-5.20.1] # make
  27. * [Root@CentOS64perl-5.20.1] # makeinstall
  28. * [Root@CentOS64perl-5.20.1] # perl-v
  29. * Timeout *----------------------------------------------------------------------------------------------------------------------
  30. * Install OpenSSL
  31. * Export root@centos64software?#tarzxvfopenssl-1.0.1i.tar.gz
  32. * [Root @ CentOS64software] # cdopenssl-1.0.1i
  33. * [Root@CentOS64openssl-1.0.1i] #./config -- prefix =/app/openssl
  34. * [Root@CentOS64openssl-1.0.1i] # make
  35. * [Root@CentOS64openssl-1.0.1i] # makeinstall
  36. * [Root@CentOS64openssl-1.0.1i] #/app/openssl/bin/opensslversion
  37. * Timeout *----------------------------------------------------------------------------------------------------------------------
  38. * Install Apache
  39. * Export root@centos64software?#tarzxvfhttpd-2.2.29.tar.gz
  40. * [Root @ CentOS64software] # cdhttpd-2.2.29
  41. * [Root@CentOS64httpd-2.2.29] # rpm-qa | grephttp
  42. * [Root@CentOS64httpd-2.2.29] #./configure -- prefix =/app/apache -- enable-ssl -- with-ssl =/app/openssl
  43. * [Root@CentOS64httpd-2.2.29] # make
  44. * [Root@CentOS64httpd-2.2.29] # makeinstall
  45. * Timeout *----------------------------------------------------------------------------------------------------------------------
  46. * Apache directory structure
  47. * Bin ------ executable file (in fact, the apache executable file is one: httpd, which is the main program of apache)
  48. * Run the [/app/apache/bin/httpd-l] command to view the number of modules compiled by apache, that is, to list all modules supported by apache.
  49. * If [mod_so.c] is included, apache has the function of dynamically loading modules.
  50. * For example, if you want to add a new module, you don't need to compile apache again. Just compile this module and load it in the configuration file.
  51. * Conf ----- configuration file (apache only has one configuration file)
  52. * Htdocs --- the default website root directory (that is, after apache is started, what others actually access when accessing apache is what is in this directory)
  53. * Include -- header file
  54. * Logs ----- log
  55. * Man ------ Manual
  56. * Manual --- online documentation
  57. * Modules -- stores compiled modules for Dynamic Loading During apache startup.
  58. * Timeout *----------------------------------------------------------------------------------------------------------------------
  59. * Access Apache
  60. * Because the main apache program httpd in the/app/apache/bin/directory supports many parameters, it is easy to mix
  61. * For convenience, apache provides a STARTUP script named apachectl, which is also located in the/app/apache/bin/directory. You can see the script content through [viapachectl ].
  62. * When starting apache, if you want to start apache that supports SSL in apache2.0, run the [apachectlstartssl] command.
  63. * In 2.2, directly execute [apachectlstart] to start and support SSL. Of course, the premise is to configure [Includeconf/extra/httpd-ssl.conf] in httpd. conf
  64. * [Root @ CentOS64bin] #/app/apache/bin/apachectlstart
  65. * [Root @ CentOS64bin] #/app/apache/bin/apachectlrestart
  66. * [Root @ CentOS64bin] #/app/apache/bin/apachectlstop
  67. * Timeout *----------------------------------------------------------------------------------------------------------------------
  68. * Common parameters modified after Apache is installed and started for the first time
  69. * 1) When apache is started or restarted, the console prints the following information.
  70. * Httpd: Couldnotreliablydeterminetheserver 'sfullyqualifieddomainname, using192.168.0.103forServerName
  71. * The solution is to modify the/app/apache/conf/httpd. conf file, uncomment [# ServerNamewww.example.com: 80], and restart apache to see the effect.
  72. * 2) After apache is started, it accesses http: // 192.168.0.102/through a computer and cannot be accessed ("Itworks! ")
  73. * The solution is to modify the/etc/sysconfig/iptables file and add a line [-AINPUT-mstate -- stateNEW-mtcp-ptcp -- dport80-jACCEPT]
  74. * Note that this should be added to the default port 22 rule. If it is added to the end of the iptables file, firewall startup may fail.
  75. * Run the [serviceiptablesrestart] command to restart the firewall. You do not need to restart Linux.
  76. * For more information, see http://blog.csdn.net/jadyer/article/details/11324237.
  77. * 3) when the index.html of the/app/apache/htdocs/object does not exist, accessing apache will display the file list under the htdocs directory. We can set it to not display the file list.
  78. * The solution is to modify the/app/apache/conf/httpd. conf file and comment out the line [OptionsIndexesFollowSymLinks ].
  79. * Access http: // 192.168.0.102/and you will see the familiar "Forbidden: Youdon 'thavepermissiontoaccess/onthisserver ."
  80. * 4) If you want to add apache to the System for Automatic startup, there are two common methods: modify the configuration file and register apache as a system service (also in the graphical interface called up by the ntsysv command)
  81. * The easiest way to modify the configuration file is to add [/app/apache/bin/apachectlstart] to the end of the/etc/rc. d/rc. local file.
  82. * Timeout *----------------------------------------------------------------------------------------------------------------------
  83. * @ CreateSep26, 20149: 14: 43AM
  84. * @ Author Xuan Yu
  85. */

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.