Skip to content

Commit

Permalink
Now include support for XHProf
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbdaly committed Dec 31, 2013
1 parent f13e993 commit 293585f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vagrant/
41 changes: 27 additions & 14 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@
apt-get update

# Install requirements
apt-get install -y apache2
apt-get install -y php5
apt-get install -y php5-cli
apt-get install -y php5-mcrypt
apt-get install -y php5-gd
apt-get install -y php-apc
apt-get install -y git
apt-get install -y sqlite
apt-get install -y php5-sqlite
apt-get install -y curl
apt-get install -y php5-curl
apt-get install -y php5-xdebug
apt-get install -y msmtp ca-certificates vim-nox
apt-get install -y apache2 build-essential checkinstall php5 php5-cli php5-mcrypt php5-gd php-apc git sqlite php5-sqlite curl php5-curl php5-dev php-pear php5-xdebug msmtp ca-certificates vim-nox

# Install MySQL
sudo debconf-set-selections <<< 'mysql-server-<version> mysql-server/root_password password root'
Expand Down Expand Up @@ -78,6 +66,13 @@ VHOST=$(cat <<EOF
Order allow,deny
Allow from all
</Directory>
Alias /xhprof "/usr/share/php/xhprof_html"
<Directory "/usr/share/php/xhprof_html">
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
EOF
)
Expand Down Expand Up @@ -140,7 +135,7 @@ sudo sed -i "s[^;sendmail_path =.*[sendmail_path = '/usr/bin/msmtp -t'[g" /etc/p

# Configure XDebug
XDEBUG=$(cat <<EOF
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp"
xdebug.profiler_append=0
Expand All @@ -155,6 +150,24 @@ then
git clone https://github.com/jokkedk/webgrind.git /var/www/webgrind
fi

# Install XHProf
CONFIG=$(cat <<EOF
extension=xhprof.so
xhprof.output_dir="/var/tmp/xhprof"
EOF
)
echo "${CONFIG}" > /etc/php5/conf.d/xhprof.ini
if [ ! -d /usr/share/php/xhprof_html ];
then
sudo pecl install xhprof-beta
fi

if [ ! -d /var/tmp/xhprof ];
then
sudo mkdir /var/tmp/xhprof
sudo chmod 777 /var/tmp/xhprof
fi

# Enable mod_rewrite
sudo a2enmod rewrite

Expand Down
29 changes: 27 additions & 2 deletions mongobootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
apt-get update

# Install requirements
apt-get install -y apache2 php5 php5-dev php5-cli php-pear mongodb php5-mcrypt php5-gd php-apc git curl php5-curl php5-xdebug msmtp ca-certificates vim-nox
pecl install mongo
apt-get install -y apache2 build-essential checkinstall php5 php5-cli php5-mcrypt php5-gd php-apc git sqlite php5-sqlite curl php5-curl php5-dev php-pear php5-xdebug msmtp ca-certificates vim-nox mongodb
sudo pecl install mongo

# Setup hosts file
VHOST=$(cat <<EOF
Expand All @@ -32,6 +32,13 @@ VHOST=$(cat <<EOF
Order allow,deny
Allow from all
</Directory>
Alias /xhprof "/usr/share/php/xhprof_html"
<Directory "/usr/share/php/xhprof_html">
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
EOF
)
Expand Down Expand Up @@ -113,6 +120,24 @@ then
git clone https://github.com/jokkedk/webgrind.git /var/www/webgrind
fi

# Install XHProf
CONFIG=$(cat <<EOF
extension=xhprof.so
xhprof.output_dir="/var/tmp/xhprof"
EOF
)
echo "${CONFIG}" > /etc/php5/conf.d/xhprof.ini
if [ ! -d /usr/share/php/xhprof_html ];
then
sudo pecl install xhprof-beta
fi

if [ ! -d /var/tmp/xhprof ];
then
sudo mkdir /var/tmp/xhprof
sudo chmod 777 /var/tmp/xhprof
fi

# Enable mod_rewrite
sudo a2enmod rewrite

Expand Down

0 comments on commit 293585f

Please sign in to comment.