Install Apache-2.2.29 in CentOS-6.4-minimal

Source: Internet
Author: User
Tags openssl version

Install Apache-2.2.29 in CentOS-6.4-minimal

Install Apache-2.2.29 in CentOS-6.4-minimal
Bytes ----------------------------------------------------------------------------------------------------------------------
Three steps for installing software in source code
1) configure the environment: the command is usually./configure -- prefix = DIR (that is, specify the software installation directory). If you want to enable other features, add the command later.
For example, the following -- enable-ssl is used to enable the SSL module of Apache.
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.
2) Compile the source code: the common command is make.
3) install the application: the General Command is make install.
Bytes ----------------------------------------------------------------------------------------------------------------------
Notes
1) The configure tool under the httpd-2.2.29 directory is a tool specially used for source code release by the GNU software foundation.
2) If this error occurs during Environment configuration [configure: error: no acceptable C compiler found in $ PATH], the GCC compiling environment is missing.
Then run the [yum-y install gcc] command to install the tools and libraries required for compiling the source code.
3) If this Error [Error: database disk image is malformed] occurs when the yum command is executed, it indicates that the yum cache has an Error and you need to clear the cache.
Then run the [yum clean dbcache] command.
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.
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.
Bytes ----------------------------------------------------------------------------------------------------------------------
Install Perl5
[Root @ CentOS64 software] # yum-y install wget
[Root @ CentOS64 software] # wget http://www.cpan.org/src/5.0/perl-5.20.1.tar.gz
[Root @ CentOS64 software] # tar zxvf perl-5.20.1.tar.gz
[Root @ CentOS64 software] # cd perl-5.20.1
[Root @ CentOS64 perl-5.20.1] #./Configure-des-Dprefix =/app/perl
[Root @ CentOS64 perl-5.20.1] # make
[Root @ CentOS64 perl-5.20.1] # make install
[Root @ CentOS64 perl-5.20.1] # perl-v
Bytes ----------------------------------------------------------------------------------------------------------------------
Install OpenSSL
[Root @ CentOS64 software] # tar zxvf openssl-1.0.1i.tar.gz
[Root @ CentOS64 software] # cd openssl-1.0.1i
[Root @ CentOS64 openssl-1.0.1i] #./config -- prefix =/app/openssl
[Root @ CentOS64 openssl-1.0.1i] # make
[Root @ CentOS64 openssl-1.0.1i] # make install
[Root @ CentOS64 openssl-1.0.1i] #/app/openssl/bin/openssl version
Bytes ----------------------------------------------------------------------------------------------------------------------
Install Apache
[Root @ CentOS64 software] # tar zxvf httpd-2.2.29.tar.gz
[Root @ CentOS64 software] # cd httpd-2.2.29
[Root @ CentOS64 httpd-2.2.29] # rpm-qa | grep http
[Root @ CentOS64 httpd-2.2.29] #./configure -- prefix =/app/apache -- enable-ssl -- with-ssl =/app/openssl
[Root @ CentOS64 httpd-2.2.29] # make
[Root @ CentOS64 httpd-2.2.29] # make install
Bytes ----------------------------------------------------------------------------------------------------------------------
Apache directory structure
Bin ------ executable file (in fact, the apache executable file is one: httpd, which is the main program of apache)
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.
If [mod_so.c] is included, it indicates that apache has the function of dynamically loading modules.
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.
Conf ----- configuration file (apache only has one configuration file)
Htdocs --- the default website root directory (that is, after apache is started, what is actually accessed when someone accesses apache is in this directory)
Include -- header file
Logs ----- log
Man ------ Manual
Manual --- online documentation
Modules -- stores compiled modules for Dynamic Loading During apache startup
Bytes ----------------------------------------------------------------------------------------------------------------------
Access Apache
Because the main apache program httpd in the/app/apache/bin/directory supports many parameters, it is easy to mix
For the convenience of users, apache provides a STARTUP script named apachectl, which is also located in the/app/apache/bin/directory. You can see the script content through [vi apachectl ].
When starting apache, if you want to start apache that supports SSL in apache2.0, you need to run the [apachectl startssl] command
In 2.2, directly run [apachectl start] to start and support SSL. Of course, the premise is to configure [Include conf/extra/httpd-ssl.conf] in httpd. conf.
[Root @ CentOS64 bin] #/app/apache/bin/apachectl start
[Root @ CentOS64 bin] #/app/apache/bin/apachectl restart
[Root @ CentOS64 bin] #/app/apache/bin/apachectl stop
Bytes ----------------------------------------------------------------------------------------------------------------------
Common Parameters modified after Apache is installed and started for the first time
1) When apache is started or restarted, the console prints the following information.
Httpd: cocould not reliably determine the server's fully qualified domain name, using 192.168.0.103 for ServerName
The solution is to modify the/app/apache/conf/httpd. conf file, uncomment [# ServerName www.example.com: 80], and restart apache to see the effect.
2) After apache is started, It accesses http: // 192.168.0.102/through a computer and cannot be accessed ("It works! ")
The solution is to modify the/etc/sysconfig/iptables file and add A line [-a input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT]
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.
Then run the [service iptables restart] command to restart the firewall.
For details, see) 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.
The solution is to modify the/app/apache/conf/httpd. conf file and comment out the line [Options Indexes FollowSymLinks ].
Access http: // 192.168.0.102/and You will see the familiar "Forbidden: You don't have permission to access/on this server ."
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)
The easiest way to modify the configuration file is to add [/app/apache/bin/apachectl start] to the end of the/etc/rc. d/rc. local file.
Bytes ----------------------------------------------------------------------------------------------------------------------
@ Create Sep 26,201 4 9:14:43 AM
@ Author Xuan Yu <

Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)

Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind

Build a WEB Server Linux + Apache + MySQL + PHP in the LAMP source code Environment

LAMP + Xcache environment setup

-------------------------------------- Split line --------------------------------------

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.