Skip to content

Instantly share code, notes, and snippets.

@Benedikt1992
Forked from boo1ean/setup.sh
Last active November 9, 2018 09:08
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save Benedikt1992/e88c2114fee15422a4eb to your computer and use it in GitHub Desktop.
Save Benedikt1992/e88c2114fee15422a4eb to your computer and use it in GitHub Desktop.
Setup apache-2.4.16 + php-5.6.11 on CentOS 6.7
#!/usr/bin/env bash
# Install dependencies
yum update -y
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel
mkdir setup && cd setup
wget http://mirror.softaculous.com/apache//httpd/httpd-2.4.16.tar.gz
tar -xvf httpd-2.4.16.tar.gz
# Download and unpack apr
cd httpd-2.4.16/srclib
wget http://mirror.arcor-online.net/www.apache.org//apr/apr-1.5.2.tar.gz
wget http://mirror.arcor-online.net/www.apache.org//apr/apr-util-1.5.4.tar.gz
tar -xvf apr-1.5.2.tar.gz
tar -xvf apr-util-1.5.4.tar.gz
mv apr-1.5.2 apr
mv apr-util-1.5.4 apr-util
cd ..
# Configure apache
./configure --enable-so --enable-ssl --with-included-apr
# Compile, link and install apache locally
make && make install
cd ..
# Get php-5.6.11 source code
wget http://de1.php.net/get/php-5.6.11.tar.gz/from/this/mirror
tar -xvf mirror
cd php-5.6.11
# Configure build
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl --with-openssl
# Compile and install php
make && make install
# Set handler for php files
echo '
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
' >> /usr/local/apache2/conf/httpd.conf
# Add test file
echo '<?php phpinfo();' > /usr/local/apache2/htdocs/index.php
@deeftah
Copy link

deeftah commented Sep 13, 2015

THANK YOU so much, without this file I'd still be searching how to update my VPS.

<3

@Davidmattei
Copy link

Thanks ! Very good setup !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment