This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
INSTALL.txt
197 lines (138 loc) · 3.86 KB
/
INSTALL.txt
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
Base VM installation
====================
You don't need to worry about this if you received a prepared VM.
Install Ubuntu Server 10.04.1 32-bit
Network: bridged
Host name: swdev
User: user
Password: password
Install security updates automatically
Reboot
Login
$ sudo aptitude update
$ sudo aptitude -y dist-upgrade
$ sudo aptitude -y install build-essential
$ sudo reboot
Install parallels tools
$ sudo mount /dev/cdrom /cdrom
$ cd /cdrom
$ sudo ./install --install-unattended-with-deps
$ cd
Install packages
$ sudo aptitude install openssh-server avahi-daemon
Ssh to user@swdev.local
$ sudo aptitude install \
emacs-snapshot-nox \
python-mode \
vim-nox \
screen \
libjpeg62-dev \
mercurial \
bzr \
git-core \
apache2 \
apache2-mpm-prefork \
subversion \
libpq-dev \
build-essential \
python2.6-dev \
python-setuptools \
postgresql \
libpq5 \
postgresql-client-8.4 \
postgresql-common \
postgresql-client-common \
postgresql-contrib-8.4 \
avahi-daemon \
phppgadmin \
samba
edit /etc/samba/smb.conf
[homes]
comment = Home Directories
browseable = no
read only = no
create mask = 0640
directory mask = 0750
$ sudo service smbd restart
Prepare postgres to allow 'user' as superuser
---------------------------------------------
$ sudo -u postgres createuser user
superuser? y
Install virtualenv and pip
--------------------------
$ sudo easy_install pip
$ sudo pip install virtualenv virtualenvwrapper
$ cat >> .bashrc <<EOF
source /usr/local/bin/virtualenvwrapper.sh
EOF
$ mkdir .virtualenvs
$ exec bash -login
Installation atop base VM
=========================
Install SSH key, change password
--------------------------------
$ ssh-copy-id user@swdev.local
$ ssh user@swdev.local
$ passwd
$ sudo smbpasswd user
Connect using Mac
-----------------
In Finder, Cmd+K or use menu: Go -> Connect to Server.
smb://swdev.local/user
This lets you access home directory using your favorite Mac editor.
Set up git
----------
$ git config --global user.name "Your Name"
$ git config --global user.email "your@email.com"
Clone repository, install dependencies
--------------------------------------
$ mkvirtualenv --no-site-packages sw
$ cat >> $VIRTUAL_ENV/bin/postactivate <<EOF
export DJANGO_SETTINGS_MODULE=swproject.localsettings
EOF
$ workon sw
# I needed to do the following due to problems with git updating
# in the official released version of pip.
$ pip install -U -e hg+http://bitbucket.org/gldnspud/pip-sw#egg=pip
$ git clone http://github.com/snswa/swsites.git
~ or with your own clone: ~
$ git clone git@github.com:YOURNAME/swsites.git
$ cd swsites
$ pip install -r requirements.txt
$ python setup.py develop
Set up localsettings
--------------------
$ cd swproject
$ cat > localsettings.py <<EOF
from swproject.settings_dev import *
EOF
Create and initialize db and superuser
--------------------------------------
$ createdb -E utf8 -T template0 swdev
$ django-admin.py syncdb --migrate --noinput
$ django-admin.py createsuperuser
user: (your choice)
pass: (your choice)
Run server and browse against it
--------------------------------
$ django-admin.py runserver 0.0.0.0:8000
Browse to http://swdev.local:8000
Installing solr
===============
$ sudo aptitude install solr-jetty openjdk-6-jdk
$ sudo $EDITOR /etc/default/jetty
NO_START=0
$ sudo service jetty restart
In top level of swsites repo:
$ django-admin.py build_solr_schema > solr-schema.xml
$ sudo ln -sf $PWD/solr-schema.xml /etc/solr/conf/schema.xml
$ sudo service jetty restart
$ django-admin.py rebuild_index
$ django-admin.py update_index
Copying schema from OSX environment to VM
-----------------------------------------
# Do this once.
VM$ sudo ln -sf $PWD/solr-schema.xml /etc/solr/conf/schema.xml
OSX$ ssh -L 8080:localhost:8080 swdev.local
OSX$ django-admin.py build_solr_schema | ssh swdev.local "cat > solr-schema.xml; sudo service jetty restart"
OSX$ django-admin.py rebuild_index