7 Assuming a clean debian squeeze (stable) installation, use the following steps to run the software.
11 apt-get install git python-django python-setuptools python-sphinx
12 apt-get install python-sqlalchemy python-psycopg2
13 apt-get install apache2 libapache2-mod-wsgi
18 git clone https://code.grnet.gr/git/pithos
20 Setup the files (choose where to store data in ``settings.py`` and change ``SECRET_KEY``)::
23 cp settings.py.dist settings.py
24 python manage.py syncdb
26 python setup.py build_sphinx
28 Edit ``/etc/apache2/sites-available/pithos`` (change the ``ServerName`` directive)::
31 ServerAdmin webmaster@pithos.dev.grnet.gr
32 ServerName pithos.dev.grnet.gr
34 DocumentRoot /var/www/pithos_web_client
36 Options FollowSymLinks
40 Options Indexes FollowSymLinks MultiViews
46 Alias /docs "/pithos/docs/build/html"
47 <Directory /pithos/docs/build/html/>
53 RewriteRule ^/v(.*) /api/v$1 [PT]
54 RewriteRule ^/public(.*) /api/public$1 [PT]
55 RewriteRule ^/login(.*) /api/login$1 [PT]
57 <Directory /pithos/pithos/wsgi/>
61 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
63 # WSGIDaemonProcess pithos
64 # WSGIProcessGroup pithos
66 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
68 # Possible values include: debug, info, notice, warn, error, crit,
72 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
76 Edit ``/etc/apache2/sites-available/pithos-ssl`` (assuming files in ``/etc/ssl/private/pithos.dev.grnet.gr.key`` and ``/etc/ssl/certs/pithos.dev.grnet.gr.crt`` - change the ``ServerName`` directive)::
79 <VirtualHost _default_:443>
80 ServerAdmin webmaster@pithos.dev.grnet.gr
81 ServerName pithos.dev.grnet.gr
83 DocumentRoot /var/www/pithos_web_client
85 Options FollowSymLinks
89 Options Indexes FollowSymLinks MultiViews
95 Alias /docs "/pithos/docs/build/html"
96 <Directory /pithos/docs/build/html/>
102 RewriteRule ^/v(.*) /api/v$1 [PT]
103 RewriteRule ^/public(.*) /api/public$1 [PT]
104 RewriteRule ^/login(.*) /api/login$1 [PT]
106 <Directory /pithos/pithos/wsgi/>
110 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
112 ErrorLog ${APACHE_LOG_DIR}/pithos-ssl.error.log
114 # Possible values include: debug, info, notice, warn, error, crit,
118 CustomLog ${APACHE_LOG_DIR}/pithos-ssl.access.log combined
121 # Enable/Disable SSL for this virtual host.
124 # A self-signed (snakeoil) certificate can be created by installing
125 # the ssl-cert package. See
126 # /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
127 # If both key and certificate are stored in the same file, only the
128 # SSLCertificateFile directive is needed.
129 SSLCertificateFile /etc/ssl/certs/pithos.dev.grnet.gr.crt
130 SSLCertificateKeyFile /etc/ssl/private/pithos.dev.grnet.gr.key
132 # Server Certificate Chain:
133 # Point SSLCertificateChainFile at a file containing the
134 # concatenation of PEM encoded CA certificates which form the
135 # certificate chain for the server certificate. Alternatively
136 # the referenced file can be the same as SSLCertificateFile
137 # when the CA certificates are directly appended to the server
138 # certificate for convinience.
139 #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
141 # Certificate Authority (CA):
142 # Set the CA certificate verification path where to find CA
143 # certificates for client authentication or alternatively one
144 # huge file containing all of them (file must be PEM encoded)
145 # Note: Inside SSLCACertificatePath you need hash symlinks
146 # to point to the certificate files. Use the provided
147 # Makefile to update the hash symlinks after changes.
148 #SSLCACertificatePath /etc/ssl/certs/
149 #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
151 # Certificate Revocation Lists (CRL):
152 # Set the CA revocation path where to find CA CRLs for client
153 # authentication or alternatively one huge file containing all
154 # of them (file must be PEM encoded)
155 # Note: Inside SSLCARevocationPath you need hash symlinks
156 # to point to the certificate files. Use the provided
157 # Makefile to update the hash symlinks after changes.
158 #SSLCARevocationPath /etc/apache2/ssl.crl/
159 #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
161 # Client Authentication (Type):
162 # Client certificate verification type and depth. Types are
163 # none, optional, require and optional_no_ca. Depth is a
164 # number which specifies how deeply to verify the certificate
165 # issuer chain before deciding the certificate is not valid.
166 #SSLVerifyClient require
170 # With SSLRequire you can do per-directory access control based
171 # on arbitrary complex boolean expressions containing server
172 # variable checks and other lookup directives. The syntax is a
173 # mixture between C and Perl. See the mod_ssl documentation
176 #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
177 # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
178 # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
179 # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
180 # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
181 # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
184 # SSL Engine Options:
185 # Set various options for the SSL engine.
187 # Translate the client X.509 into a Basic Authorisation. This means that
188 # the standard Auth/DBMAuth methods can be used for access control. The
189 # user name is the `one line' version of the client's X.509 certificate.
190 # Note that no password is obtained from the user. Every entry in the user
191 # file needs this password: `xxj31ZMTZzkVA'.
193 # This exports two additional environment variables: SSL_CLIENT_CERT and
194 # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
195 # server (always existing) and the client (only existing when client
196 # authentication is used). This can be used to import the certificates
199 # This exports the standard SSL/TLS related `SSL_*' environment variables.
200 # Per default this exportation is switched off for performance reasons,
201 # because the extraction step is an expensive operation and is usually
202 # useless for serving static content. So one usually enables the
203 # exportation for CGI and SSI requests only.
205 # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
206 # under a "Satisfy any" situation, i.e. when it applies access is denied
207 # and no other module can change it.
209 # This enables optimized SSL connection renegotiation handling when SSL
210 # directives are used in per-directory context.
211 #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
212 <FilesMatch "\.(cgi|shtml|phtml|php)$">
213 SSLOptions +StdEnvVars
215 <Directory /usr/lib/cgi-bin>
216 SSLOptions +StdEnvVars
219 # SSL Protocol Adjustments:
220 # The safe and default but still SSL/TLS standard compliant shutdown
221 # approach is that mod_ssl sends the close notify alert but doesn't wait for
222 # the close notify alert from client. When you need a different shutdown
223 # approach you can use one of the following variables:
224 # o ssl-unclean-shutdown:
225 # This forces an unclean shutdown when the connection is closed, i.e. no
226 # SSL close notify alert is send or allowed to received. This violates
227 # the SSL/TLS standard but is needed for some brain-dead browsers. Use
228 # this when you receive I/O errors because of the standard approach where
229 # mod_ssl sends the close notify alert.
230 # o ssl-accurate-shutdown:
231 # This forces an accurate shutdown when the connection is closed, i.e. a
232 # SSL close notify alert is send and mod_ssl waits for the close notify
233 # alert of the client. This is 100% SSL/TLS standard compliant, but in
234 # practice often causes hanging connections with brain-dead browsers. Use
235 # this only for browsers where you know that their SSL implementation
237 # Notice: Most problems of broken clients are also related to the HTTP
238 # keep-alive facility, so you usually additionally want to disable
239 # keep-alive for those clients, too. Use variable "nokeepalive" for this.
240 # Similarly, one has to force some clients to use HTTP/1.0 to workaround
241 # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
242 # "force-response-1.0" for this.
243 BrowserMatch "MSIE [2-6]" \
244 nokeepalive ssl-unclean-shutdown \
245 downgrade-1.0 force-response-1.0
246 # MSIE 7 and newer should be able to use keepalive
247 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
252 Configure and run apache::
259 mkdir /var/www/pithos
260 mkdir /var/www/pithos_web_client
261 /etc/init.d/apache2 restart
263 Useful alias to add in ``~/.bashrc``::
265 alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
272 apt-get install libapache2-mod-shib2
274 Setup the files in ``/etc/shibboleth``.
276 Add in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl``::
278 ShibConfig /etc/shibboleth/shibboleth2.xml
279 Alias /shibboleth-sp /usr/share/shibboleth
281 <Location /api/login>
283 ShibRequireSession On
288 Configure and run apache::
291 /etc/init.d/apache2 restart
292 /etc/init.d/shibd restart
297 If using MySQL instead of SQLite for the database engine, consider the following.
301 apt-get install mysql-server
303 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
305 Create database and user::
307 CREATE DATABASE pithos;
308 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
309 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
313 apt-get install mysql-client
315 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
319 password = 'password'
320 host = pithos-storage.dev.grnet.gr
328 If using PostgreSQL instead of SQLite for the database engine, consider the following.
332 apt-get install postgresql
334 Edit ``/etc/postgresql/8.4/main/postgresql.conf`` and ``/etc/postgresql/8.4/main/pg_hba.conf`` to allow network connections and restart the server.
336 Create database and user::
338 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
339 CREATE USER pithos WITH PASSWORD 'password';
340 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
344 apt-get install postgresql-client
346 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
348 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
352 psql -h pithos-storage.dev.grnet.gr -U pithos