Skip to content

Instantly share code, notes, and snippets.

@kazuhei
Last active August 29, 2015 14:03
Show Gist options
  • Save kazuhei/abe50fe989ac06d31879 to your computer and use it in GitHub Desktop.
Save kazuhei/abe50fe989ac06d31879 to your computer and use it in GitHub Desktop.
Vagrant provisioning apache2.4+php5.4+mysql5.6
# Install dependencies
yum install -y git wget
yum install -y pcre-devel libxml2-devel
yum groupinstall -y "Development Tools"
yum install -y vim
yum update -y
yum -y install openssl-devel
yum -y install curl-devel
# Download and Unpack apache
cd /usr/local/src
wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.gz
tar -xvzf httpd-2.4.9.tar.gz
rm httpd-2.4.9.tar.gz
# Download and unpack apr
cd httpd-2.4.9/srclib
wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-1.5.1.tar.gz
tar xzf apr-1.5.1.tar.gz
rm apr-1.5.1.tar.gz
mv apr-1.5.1/ apr
wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-util-1.5.3.tar.gz
tar xzf apr-util-1.5.3.tar.gz
rm apr-util-1.5.3.tar.gz
mv apr-util-1.5.3/ apr-util
cd ..
# Configure and Install apache
./configure --enable-so --enable-ssl --with-included-apr
make && make install
# Install mysql
yum -y remove mysql*
yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum -y install mysql mysql-devel mysql-server mysql-utilities
# Download php
cd /usr/local/src
wget http://jp2.php.net/get/php-5.4.30.tar.gz/from/this/mirror
tar -xvf mirror
# Configure and Install php
cd php-5.4.30
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl --with-openssl
make && make install
# Add to path
PATH=$PATH:/usr/local/bin
export PATH
# 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