forked from Phouch/Phouch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
133 lines (86 loc) · 3.25 KB
/
bootstrap.sh
File metadata and controls
133 lines (86 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
echo "-------- Starting set up ------------"
# Update aptitude
sudo apt-get update
echo "-------- Done with aptitude update. Continue? ------------"
# Install vim
sudo apt-get install -y vim
echo "-------- Done with vim install. Continue? ------------"
# Install vim gnome (allows clipboard access. Not sure what else yet lol)
sudo apt-get install -y vim-gnome
echo "-------- Done with vim gnome install. Continue? ------------"
# Install apache2
sudo apt-get install -y apache2
echo "-------- Done with apache install. Continue? ------------"
# Install git
apt-get install git -y
echo "-------- Done with git install. Continue? ------------"
# Start apache2
sudo service apache2 restart
echo "-------- Done with apache restart. Continue? ------------"
# Make sure apache2 has mod_rewrite enabled
sudo a2enmod rewrite
echo "-------- Done with enabling mod rewrite. Continue? ------------"
# Get PHP
sudo apt-get install php5-common libapache2-mod-php5 php5-cli -y
# Get curl
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl -y
# Start apache2
sudo service apache2 restart
echo "-------- Done with apache restart. Continue? ------------"
echo "-------- Done with installing php. Continue? ------------"
# Create a symlink to the php binary
sudo ln -s /usr/local/bin/php /usr/bin/php
echo "-------- Done with creating symlink for php binary. Continue? ------------"
# Enable php in apache
sudo a2enmod php5
echo "-------- Done with enabling php in apache. Continue? ------------"
# Restart apache2
sudo service apache2 restart
echo "-------- Done with restarting apache. Continue?" nothing
# Install CouchDB
sudo apt-get install couchdb -y
echo "-------- Done with installing couchdb. Continue? ------------"
# Install xdebug
cd
git clone git://github.com/derickr/xdebug.git
cd xdebug*
phpize
./configure --enable-xdebug
make
sudo make install
echo "-------- Done with installing xdebug. Continue? ------------"
# Make shortcuts for editing configs
cd
mkdir _lamp && cd _lamp
sudo ln -s /etc/apache2/httpd.conf
sudo ln -s /etc/apache2/sites-available/default
sudo ln -s /etc/php5/php.ini
echo "-------- Done with making apache and php shortcuts. Continue? ------------"
# Set PHP ini from https://gist.github.com/jessiegreen/fb539b9ab349227a0cb0
# sudo vim ~/_lamp/php.ini
# Give user permission to edit web root. (I still could not edit without sudo after this. Not sure why)
sudo usermod -a -G www-data vagrant
sudo chown -R root:www-data /var/www
sudo chmod -R 775 /var/www
echo "-------- Done giving web root directory permissions to vagrant user. Continue? ------------"
# Globally install composer and create alias
cd ~
curl -s http://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
# Restart apache2
sudo service apache2 restart
echo "-------- Done restarting apache ------------"
# Update composer
composer self-update
echo "-------- Done installing Composer ------------"
# Restart apache2
sudo service apache2 restart
echo "-------- Done restarting apache ------------"
# Set the webroot as the example folder
rm -rf /var/www
ln -fs /vagrant/example /var/www
echo "-------- Done linking webroot to example folder ------------"
# Restart apache2
sudo service apache2 restart
echo "-------- Done ------------"