Skip to content

Commit e463729

Browse files
committed
Initial commit
0 parents  commit e463729

10 files changed

+165
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore temp gedit files
2+
*.*~

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Vagrant debian shell
2+
3+
This is a collection of shell scripts I am using setting up a LAMP box with
4+
debian squeeze.
5+
6+
Squeeze can be obtained @ <http://www.vagrantbox.es/>
7+
8+
## update-package-manager.sh
9+
10+
Updates apt with the file within `etc/apt/sources.list`.
11+
12+
## install-lamp.sh
13+
14+
Contains apache2, php5, mysql-server, mysql-client, openssl,
15+
php-pear, pecl_http, sendmail, mod_rewrite, ssl.
16+
17+
## install-nfs.sh
18+
19+
Contains the nfs client. Required when using the vagrant NFS setting.
20+
21+
## install-phpmyadmin.sh
22+
23+
Contains a phpmyadmin with pre-answers questions.
24+
25+
## install-wkhtmltopdf.sh
26+
27+
Sets up wkhtmltopdf. The binary should be placed in
28+
`opt/wkhtmltopdf/wkhtmltopdf`
29+
30+
<http://code.google.com/p/wkhtmltopdf/>)
31+
32+
## cleanup.sh
33+
34+
Cleans up downloaded packages.
35+
36+
37+
## Example vagrantfile
38+
39+
Vagrant::Config.run do |config|
40+
config.vm.provision :shell, :inline => "sh /vagrant/update-package-manager.sh; sh /vagrant/install-nfs.sh; sh /vagrant/install-lamp.sh; sh /vagrant/install-phpmyadmin.sh; sh /vagrant/install-wkhtmltopdf.sh; sh /vagrant/cleanup.sh;"
41+
end

cleanup.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Clean up apt-get packages
4+
apt-get -y clean

etc/apt/sources.list

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# deb cdrom:[Debian GNU/Linux 6.0.0 _Squeeze_ - Official i386 NETINST Binary-1 20110205-14:34]/ squeeze main
2+
3+
#deb cdrom:[Debian GNU/Linux 6.0.0 _Squeeze_ - Official i386 NETINST Binary-1 20110205-14:34]/ squeeze main
4+
5+
deb http://ftp.nl.debian.org/debian/ squeeze main
6+
deb-src http://ftp.nl.debian.org/debian/ squeeze main
7+
8+
deb http://security.debian.org/ squeeze/updates main
9+
deb-src http://security.debian.org/ squeeze/updates main
10+
11+
deb http://ftp.nl.debian.org/debian/ squeeze-updates main
12+
deb-src http://ftp.nl.debian.org/debian/ squeeze-updates main

install-lamp.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
# if apache2 does no exist
4+
if [ ! -f /etc/apache2/apache2.conf ];
5+
then
6+
# Install MySQL
7+
echo 'mysql-server-5.1 mysql-server/root_password password vagrant' | debconf-set-selections
8+
echo 'mysql-server-5.1 mysql-server/root_password_again password vagrant' | debconf-set-selections
9+
apt-get -y install mysql-client mysql-server-5.1
10+
11+
# Install Apache2
12+
apt-get -y install apache2
13+
14+
# Install PHP5 support
15+
apt-get -y install php5 libapache2-mod-php5 php-apc php5-mysql php5-dev
16+
17+
# Install SSL tools
18+
#apt-get -y install ssl-cert
19+
20+
# Install OpenSSL
21+
apt-get -y install openssl
22+
23+
# Install PHP pear
24+
apt-get -y install php-pear
25+
26+
# Install sendmail
27+
apt-get -y install sendmail
28+
29+
# Install CURL dev package
30+
apt-get -y install libcurl4-openssl-dev
31+
32+
# Install PECL HTTP (depends on php-pear, php5-dev, libcurl4-openssl-dev)
33+
printf "\n" | pecl install pecl_http
34+
35+
# Enable PECL HTTP
36+
echo "extension=http.so" > /etc/php5/conf.d/http.ini
37+
38+
# Enable mod_rewrite
39+
a2enmod rewrite
40+
41+
# Enable SSL
42+
a2enmod ssl
43+
44+
# Add www-data to vagrant group
45+
usermod -a -G vagrant www-data
46+
47+
# Restart services
48+
/etc/init.d/apache2 restart
49+
fi

install-nfs.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Install NFS client
4+
apt-get -y install nfs-common portmap

install-phpmyadmin.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# If phpmyadmin does not exist
4+
if [ ! -f /etc/phpmyadmin/config.inc.php ];
5+
then
6+
7+
# Used debconf-get-selections to find out what questions will be asked
8+
# This command needs debconf-utils
9+
10+
# Handy for debugging. clear answers phpmyadmin: echo PURGE | debconf-communicate phpmyadmin
11+
12+
echo 'phpmyadmin phpmyadmin/dbconfig-install boolean false' | debconf-set-selections
13+
echo 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2' | debconf-set-selections
14+
15+
echo 'phpmyadmin phpmyadmin/app-password-confirm password vagrant' | debconf-set-selections
16+
echo 'phpmyadmin phpmyadmin/mysql/admin-pass password vagrant' | debconf-set-selections
17+
echo 'phpmyadmin phpmyadmin/password-confirm password vagrant' | debconf-set-selections
18+
echo 'phpmyadmin phpmyadmin/setup-password password vagrant' | debconf-set-selections
19+
echo 'phpmyadmin phpmyadmin/database-type select mysql' | debconf-set-selections
20+
echo 'phpmyadmin phpmyadmin/mysql/app-pass password vagrant' | debconf-set-selections
21+
22+
echo 'dbconfig-common dbconfig-common/mysql/app-pass password vagrant' | debconf-set-selections
23+
echo 'dbconfig-common dbconfig-common/mysql/app-pass password' | debconf-set-selections
24+
echo 'dbconfig-common dbconfig-common/password-confirm password vagrant' | debconf-set-selections
25+
echo 'dbconfig-common dbconfig-common/app-password-confirm password vagrant' | debconf-set-selections
26+
echo 'dbconfig-common dbconfig-common/app-password-confirm password vagrant' | debconf-set-selections
27+
echo 'dbconfig-common dbconfig-common/password-confirm password vagrant' | debconf-set-selections
28+
29+
apt-get -y install phpmyadmin
30+
fi

install-wkhtmltopdf.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# if wkhtmltopdf does not exist
4+
if [ ! -f /opt/wkhtmltopdf/wkhtmltopdf ];
5+
then
6+
# Add wkhtmltopdf
7+
cp -R /vagrant/opt/wkhtmltopdf/ /opt/
8+
9+
### Below are debian squeeze fixes, wheezy did not have these issues ###
10+
11+
# Install dependencies
12+
apt-get -y install libxrender-dev libfontconfig1-dev
13+
14+
# Fix libXrender dependency
15+
ln -s /usr/lib/libXrender.so /usr/local/lib/libXrender.so.1
16+
fi

opt/wkhtmltopdf/wkhtmltopdf

Whitespace-only changes.

update-package-manager.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Copy own sources.list to box
4+
cp /vagrant/etc/apt/sources.list /etc/apt/sources.list
5+
6+
# Fetch packages
7+
apt-get update

0 commit comments

Comments
 (0)