CentOS 6.5 64-bit compilation apache2.4

Source: Internet
Author: User
Tags install openssl

Installation of Apache 2.4 differs from apache2.2 installation

First Enter http://apr.apache.org/download.cgi

Download Apr and apr-util two packages

Yum-y Install gcc-c++ libtool-libs installation of the dependent packages required

Install Apr

TAR-ZXVF apr-1.5.2.tar.gz

CD apr-1.5.2

./configure--PREFIX=/USR/LOCAL/APR

Make

Make install

Make clean

Apr installation Complete

Installing Apr-util

TAR-ZXVF apr-util-1.5.4.tar.gz

CD apr-util-1.5.4

./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config

Make

Make install

Make clean

Apr-util Installation Complete

Installing Pcre

TAR-ZXVF pcre-8.31.tar.gz

CD pcre-8.31

./configure--prefix=/usr/local/pcre

Make

Make install

Make clean

Pcre Installation Complete

Installing OpenSSL

TAR-ZXVF openssl-1.0.1c.tar.gz

CD openssl-1.0.1c

./config no-shared No-idea no-mdc2 no-rc5 zlib enable-tlsext NO-SSL2--prefix=/usr/local/openssl

Make depend

Make install

Install OpenSSL complete

Installing apache2.4

TAR-ZXVF httpd-2.4.12

CD httpd-2.4.12

./configure--prefix=/usr/local/apache--with-mpm=worker--enable-cache--enable-disk-cache--enable-mem-cache-- Enable-file-cache--enable-so--enable-rewrite--enable-ssl--enable-apr=/usr/local/apr/--with-apr-util=/usr/local /apr-util/--with-pcre=/usr/local/pcre--with-ssl=/usr/local/openssl/--enable-modules=most

Make

Make install

Cp/usr/local/apache/bin/apachectl/etc/init.d/httpd
VI/ETC/INIT.D/HTTPD Add the following two lines to the second line

# chkconfig:2345 10 90

# description:activates/deactivates Apache Web Server

/sbin/chkconfig--add httpd
/sbin/chkconfig--level 2345 httpd on

Groupadd www

Useradd-g www-s/sbin/nologin www

Chown-r Www:www/usr/local/apache

5. Turn off SELinux

A No need to restart Linux:
Setenforce 0
B need to restart Linux:
Vi/etc/selinux/config changed selinux=enforcing to Selinux=disable

6. Modify the Apache configuration file httpd.conf

1. change allowoverride None to allowoverride all

2. Modify the configuration of the error log

Errorlog "| /usr/local/apache/bin/rotatelogs/var/log/apache_log/%y_%m_%d_error_log 86400 480 "

3. Modify the configuration of the access log

Customlog "| /usr/local/apache/bin/rotatelogs/var/log/apache_log/%y_%m_%d_access_log 86400 480 "combined

4. Prohibit column directories

Options FollowSymLinks

5 Modifying a running user and user group

User www
Group www

6. Add the last line

ServerName 127.0.0.1 (actual server IP)

Domain Configuration

<virtualhost *:80>
Documentroot/www/web/project
ServerName www.domain.com
Serveralias domain.com
DirectoryIndex index.html index.php
DefaultType text/html
AddType application/x-httpd-php. html
Adddefaultcharset Utf-8

<Directory/www/web/project/>
Options-indexes +followsymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

shutting down the firewall  

Chkconfig iptables off

Service Iptables Stop

Restarting the server

Shutdown-r Now

Access

Http://www.domain.com

If the access is normal OK if the access is not normal can be adjusted according to the actual situation

CentOS 6.5 64-bit compilation apache2.4

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.