Skip to content

Instantly share code, notes, and snippets.

@boo1ean
Last active December 21, 2016 18:54

Revisions

  1. boo1ean revised this gist Jun 26, 2013. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,4 @@ echo '
    ' >> /usr/local/apache2/conf/httpd.conf

    # Add test file
    echo '<?php phpinfo();' > /usr/local/apache2/htdocs/index.php
    alias a='/usr/local/apache2/bin/apachectl'
    a start
    echo '<?php phpinfo();' > /usr/local/apache2/htdocs/index.php
  2. boo1ean created this gist Jun 26, 2013.
    54 changes: 54 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    #!/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://mirrors.besplatnyeprogrammy.ru/apache//httpd/httpd-2.4.4.tar.gz
    tar -xvf httpd-2.4.4.tar.gz

    # Download and unpack apr
    cd httpd-2.4.4/srclib

    wget http://apache-mirror.telesys.org.ua//apr/apr-1.4.8.tar.gz
    wget http://apache-mirror.telesys.org.ua//apr/apr-util-1.5.2.tar.gz

    tar -xvf apr-1.4.8.tar.gz
    tar -xvf apr-util-1.5.2.tar.gz

    mv apr-1.4.8 apr
    mv apr-util-1.5.2 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.0 source code
    wget http://ua2.php.net/get/php-5.5.0.tar.gz/from/www.php.net/mirror
    tar -xvf php-5.5.0.tar.gz
    cd php-5.5.0

    # 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
    alias a='/usr/local/apache2/bin/apachectl'
    a start