Skip to content

Instantly share code, notes, and snippets.

@newbdez33
Forked from boo1ean/setup.sh
Last active August 29, 2015 14:02
Show Gist options
  • Save newbdez33/6da7a29eb64ac87fea07 to your computer and use it in GitHub Desktop.
Save newbdez33/6da7a29eb64ac87fea07 to your computer and use it in GitHub Desktop.
#!/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://apache.mirrors.pair.com//httpd/httpd-2.4.9.tar.gz
tar -xvf httpd-2.4.9.tar.gz
# Download and unpack apr
cd httpd-2.4.9/srclib
wget http://apache.cs.utah.edu//apr/apr-1.5.1.tar.gz
wget http://apache.cs.utah.edu//apr/apr-util-1.5.3.tar.gz
tar -xvf apr-1.5.1.tar.gz
tar -xvf apr-util-1.5.3.tar.gz
mv apr-1.5.1 apr
mv apr-util-1.5.3 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.5.13 source code
wget http://cn2.php.net/get/php-5.5.13.tar.gz/from/this/mirror
mv mirror php-5.5.13.tar.gz
tar -xvf php-5.5.13.tar.gz
cd php-5.5.13
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment