Skip to content

Instantly share code, notes, and snippets.

@sheikhwaqas
Created June 30, 2014 08:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sheikhwaqas/8d49161d339971f574ec to your computer and use it in GitHub Desktop.
Save sheikhwaqas/8d49161d339971f574ec to your computer and use it in GitHub Desktop.
Setting up LAMP on Vagrant
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Install essential packages
apt-get -y install \
gcc g++ autoconf automake make sendmail git ruby zsh acl zip unzip \
pkg-config gettext curl enchant \
libpcre3-dev libssl-dev libxml2 libxml2-dev libcurl4-openssl-dev libenchant-dev libfreetype6 libfreetype6-dev libbz2-dev \
libedit-dev libedit2 libtidy-dev libxslt1.1 libxslt1-dev libvpx-dev libxpm-dev libedit-dev libreadline-dev \
libjpeg8-dev libmcrypt4 libmcrypt-dev libmhash-dev libmhash2 mcrypt libc-client2007e libc-client2007e-dev
# Install SASS & Compass
gem install sass
gem install compass
# Compile and Install Apache 2
cd /usr/local/src/httpd-2.4.9
./configure \
--prefix=/usr/local/apache2 \
--enable-mods-shared="reallyall ssl" \
--enable-watchdog \
--enable-deflate \
--enable-expires \
--enable-ssl \
--enable-heartbeat \
--enable-heartmonitor \
--enable-vhost-alias \
--enable-rewrite \
--with-mpm=prefork
make && make install
# Setup Apache as a service by making a Symbolic Link to the apachectl binary
ln -s /usr/local/apache2/bin/apachectl /etc/init.d/apache
update-rc.d apache defaults
# Start Apache service
service apache start
# Add PHP MIME Type to Apache
echo "application/x-httpd-php php" >> /usr/local/apache2/conf/mime.types
# Install libpng (Used for PHP GD Library Extension)
cd /usr/local/src/libpng-1.6.10
./configure && make && make install
# Install Free TDS (Used for PHP MySQL Extension)
cd /usr/local/src/freetds-0.91
./configure \
--prefix=/usr/local/freetds \
--sysconfdir=/usr/local/freetds/conf \
--disable-libiconv \
--enable-msdblib
make && make install
# Compile / Install PHP from Source
cd /usr/local/src/php-5.4.28
./configure \
--prefix=/usr \
--sysconfdir=/private/etc \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--with-apxs2=/usr/local/apache2/bin/apxs \
--enable-cli \
--enable-fpm \
--with-config-file-path=/etc \
--enable-libxml=shared \
--with-openssl=shared \
--with-kerberos \
--with-imap=shared,/usr/lib \
--with-imap-ssl=shared,/usr/lib \
--with-pcre-regex \
--with-zlib=shared \
--enable-bcmath=shared \
--with-bz2=shared \
--enable-calendar=shared \
--enable-ctype=shared \
--with-curl=shared \
--enable-dba=shared \
--enable-exif=shared \
--enable-fileinfo=shared \
--enable-ftp=shared \
--with-gd=shared \
--enable-gd-native-ttf=shared \
--enable-gd-jis-conv=shared \
--with-gettext=shared \
--with-mhash=shared \
--with-icu-dir=shared \
--enable-json=shared \
--without-ldap \
--without-ldap-sasl \
--enable-mbstring=shared \
--enable-mbregex \
--with-mcrypt=shared \
--enable-mysqlnd \
--disable-mysqlnd-compression-support \
--with-mssql=shared,/usr/local/freetds \
--with-mysql=shared \
--with-mysql-sock=shared,/var/lib/mysql/mysql.sock \
--with-mysqli=shared \
--without-iodbc \
--enable-pdo=shared \
--with-pdo-dblib=shared,/usr/local/freetds \
--with-pdo-mysql=shared \
--without-pdo-pgsql \
--with-pdo-sqlite=shared \
--without-pgsql \
--enable-phar=shared \
--with-libedit=shared \
--with-readline=shared \
--enable-shmop=shared \
--enable-simplexml=shared \
--without-snmp \
--enable-soap=shared \
--enable-sockets=shared \
--enable-sysvmsg=shared \
--enable-sysvsem=shared \
--enable-sysvshm=shared \
--with-tidy=shared \
--enable-wddx=shared \
--enable-xml=shared \
--enable-xmlreader=shared \
--with-xmlrpc=shared \
--enable-xmlwriter=shared \
--with-xsl=shared \
--enable-zip=shared \
--with-pear
make
make install
# Install MongoDB PHP Extension
cd /usr/local/src/mongo-1.4.5
phpize && ./configure && make && make install
# Install XDebug PHP Extension
cd /usr/local/src/xdebug-2.2.3
phpize && ./configure && make && make install
# Move all the PHP Extensions to the extensions directory and remove the temp directory
mv /usr/lib/php/extensions/no-debug-non-zts-20100525/*.so /usr/lib/php/extensions/
rm -rf /usr/lib/php/extensions/no-debug-non-zts-20100525
# Download and place the configured php.ini file
cd /etc
wget https://gist.githubusercontent.com/sheikhwaqas/87ee16e1f6e4591b9daf/raw/293fbc23e65a7eb14540037c40548502568820cd/php.ini
# Download and place the configured httpd.conf file in the directory and restart apache
cd /usr/local/apache2/conf
rm -f httpd.conf
wget https://gist.github.com/sheikhwaqas/c6afc6f6db94e4d000fd/raw/dfdfac1cf02f53e1c11a8994e4fcfc87fa5f2622/httpd.conf
service apache restart
# Install Composer (Install it after PHP is installed)
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment