Last active
September 5, 2017 08:00
-
-
Save mansurali901/d0a7bb40ecfb93882a57a4d8101c9885 to your computer and use it in GitHub Desktop.
Script to compile Apache from source code on CentOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is tested on CentOS for Installing Apache from Source Code | |
# Author Mansur UlHasan | |
# Sr, Network & Sys Admin | |
# GFK Etilize Pak | |
# To install C/C++ Compilers, AutoConf and AutoMake | |
yum install gcc gcc-c++ autoconf automake -y | |
# Install Perl Compatible Regular Expressions Libraries (PCRE) | |
yum install pcre-devel -y | |
# Download Apache Source from Apache's Website | |
# http://httpd.apache.org/download.cgi | |
wget http://www.us.apache.org/dist/httpd/httpd-2.x.x.tar.gz | |
# Extract the Source Code | |
tar -zxf httpd-2.x.x.tar.gz | |
# Download Apache Portable Runtime (APR) and Apache Portable Runtime Utility (APR-Util) from Apache's Website | |
# http://apr.apache.org/download.cgi | |
wget http://www.us.apache.org/dist/apr/apr-1.x.x.tar.gz | |
wget http://www.us.apache.org/dist/apr/apr-util-1.x.x.tar.gz | |
# Extract APR and APR-Util | |
tar -zxf apr-1.x.x.tar.gz | |
tar -zxf apr-util-1.x.x.tar.gz | |
# Move APR and APR-Util to Apache's srclib Directory | |
mv apr-1.x.x httpd-2.x.x/srclib/apr | |
mv apr-util-1.x.x httpd-2.x.x/src/apr-util | |
# CD to Apache's Directory and Compile it. | |
cd httpd-2.x.x | |
./configure --enable-module-shared="all ssl" | |
make | |
make install | |
# This will install Apache in /usr/local/apache2 directory | |
# Run the following command to start apache | |
/usr/local/apache2/bin/apachectl start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment