-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathINSTALL.TXT
261 lines (213 loc) · 9.78 KB
/
INSTALL.TXT
1
#++++++++++++++++++++++DITECTORY+++++++++++++++++++++++#+++++INSTALL THE BOOKING SYSTEM ON A LINUX+++ROW 13++#+++++INSTALL THE BOOKING SYSTEM ON A MAC+++++ROW 123++#+++++++++++++++++++SOME LINKS+++++++++++++++++++++++++#Virtual Box Download: https://www.virtualbox.org/wiki/Downloads#Ubuntu Download: http://www.ubuntu.com/download/desktop#How to Install Ubuntu on a Virtual Box: https://www.virtualbox.org/manual/ch01.html#idp13614032#******************************************************#*****HOWTO INSTALL THE BOOKING SYSTEM ON A LINUX OS***#******************************************************# This installation routine has been tested on a Ubuntu 12.04 server version.# It was written using a Virtualbox installation environment, but will work# on any Ubuntu 12.04 server 'real' installation # linux commands are indicated by '>', comments are indicated by '#'# first update sources> sudo apt-get update#first install apache2> sudo apt-get install apache2> sudo apt-get install apache2-threaded-dev#install setup tools, python's pip and other dependencies> sudo apt-get install python-setuptools python-dev build-essential mysql-server python-mysqldb python-ldap#setup new mysql root password...write it down for later...> sudo easy_install pip> sudo pip install --upgrade virtualenv> sudo pip install django> sudo pip install python-ldap> sudo pip install smtp#download latest modwsgi, goto website http://code.google.com/p/modwsgi# and look which is the latest download link for modwsgi> wget http://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz> tar xzf mod_wsgi-3.4.tar.gz> cd mod_wsgi-3.4#check python version (mine was 2.7) before running next command (python --version), if yours differ, change the version number e.g. /usr/bin/python2.4> ./configure --with-python=/usr/bin/python2.7> make> sudo make install> sudo emacs /etc/apache2/mods-available/wsgi.load #put in the following line in that file:LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so#save and exit#enable the wsgi module in apache2>sudo a2enmod wsgi#creat webdir root>sudo mkdir -p /var/www/bookingCal/apache# create a wsgi configuration file for our bookingcal> sudo nano /var/www/bookingCal/apache/django.wsgi# put in the following text-----import osimport sys path = '/var/www/bookingCal'if path not in sys.path: sys.path.insert(0, '/var/www/bookingCal') os.environ['DJANGO_SETTINGS_MODULE'] = 'bookingCalPython.settings' import django.core.handlers.wsgiapplication = django.core.handlers.wsgi.WSGIHandler()-----# open the following new file> sudo nano /etc/apache2/sites-available/bookingCal# put in the following text -----Listen 8080NameVirtualHost *:8080<VirtualHost *:8080> DocumentRoot /var/www/bookingCal <Directory /var/www/bookingCal> Order allow,deny Allow from all </Directory> WSGIScriptAlias / /var/www/bookingCal/apache/django.wsgi</VirtualHost>-----#now get the latest bookingCal source code and install it in the webroot> sudo svn checkout http://b110-devserver/svn/bookingCalPython /var/www/bookingCal > sudo touch /var/www/bookingCal/info.log> sudo chmod 777 /var/www/bookingCal/info.log#enable the new bookingCal apache2 wsgi config> sudo a2ensite bookingCal> sudo /etc/init.d/apache2 reload#now open a webbrowser and goto http://localhost:8080/booking to see the #booking calendar#the booking calendar will not work 100% because no database connection has been established:# login the mysql shell something like this> mysql -u root -p# and enter your root password you should have written down (see above)# use the following commands to create the database and user access within# the mysql shell> create database booking_django;> grant all privileges on booking_django.* to 'django'@'localhost' identified by 'xxxxxEnterPasswordHerexxxxx'#please note: if you use a password with special characters such as '!' you need to escape them like '\!'> flush privileges;#now goto the bookingCal config file and edit the database connection:# sudo nano /var/www/bookingCal/bookingCalPython/settings.py to reflect the db-name and user account you just created before---DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'booking_django', 'USER': 'django', 'PASSWORD': '!dj4n6o', 'HOST': 'localhost', 'PORT': '', }}---# now resync db and restart apache# to make the django_admin command work we have to specify two# important environmen variablesexport DJANGO_SETTINGS_MODULE=bookingCalPython.settingsexport PYTHONPATH=$PYTHONPATH:/var/www/bookingCal> cd /var/www/bookingCal/;django-admin.py syncdb> sudo /etc/init.d/apache2 restart#final step : Installation of a mail server> sudo apt-get update> sudo apt-get install postfix mailtools# during installation, use standard settings when prompted configuration details# then reconfigure:>sudo dpkg-reconfigure postfix#use the following settings:# General type of configuration : Internet mit Smarthost# System mail name:xxx# smtp relay host: mailhost.dkfz-heidelberg.de# Root and postmaster mail recipient: <leave blank># Other destinations: leave default# Force synchronous updates on mail queue: NO# Local Networks: use default e.g.: 127.0.0.0/8 192.108.26.0/24 [::1]/128 [fe80::%eth0]/64# Use procmail for local delivery: YES# Mailbox size limits: 0# Local address extension character:+# Internet protocols to use : all#now edit the following filesudo emacs /etc/postfix/main.cf #put in the following lines:----smtp_sasl_auth_enable = yes# noplaintext weglassen, wenn Passwörter im Klartext übertragen werden müssen:# (nicht empfohlen, nur wenn's anders nicht funktioniert)smtp_sasl_security_options = noplaintext noanonymoussmtp_sasl_password_maps = hash:/etc/postfix/sasl_password---#now create a file with passwords>sudo nano /etc/postfix/sasl_password#put in your mailserver/username/password---Hostserver USERNAME:PASSWORT---e.g.:---bioinformatics.rus.edu miroslav:woxo292lsl---#now update mail database and restart service>sudo postmap /etc/postfix/sasl_password>sudo /etc/init.d/postfix restart#test your configuration using:>echo "blablab" | mail -s "This is a test" [email protected] #if you cannot receive a mail look into /var/log/messages or /var/log/mail for error=======================#******************************************************#*****HOWTO INSTALL THE BOOKING SYSTEM ON A MAC OS*****#******************************************************Howto make it run on mac os x lion eclipse and for developing it LOCALLY, you needinstall eclipseinstall subversion plugin for eclipseinstall pydev plugin for eclipseeasy_install pip install pipinstall django using pip: "pip install django"install mysql support for python: "sudo pip install MySQL-python"install epydoc using pip: "pip install epydoc"install python ldap module for Mac Os X Lion: "sudo pip install python-ldap==2.3.13"??somehow install postfix on mac os x lion to work with smtplib?? dont know yetcheck out booking cal via svn in eclipse using svn plugin and set it as a pydev->django projectgo to eclipse->preferences->pydev->interpreter python->open Libraries tab, click "Auto config", mark everything, click "Apply"go to eclipse->preferences->pydev->interpreter python->open environment tab, enter as variable "DYLD_LIBRARY_PATH" and as value "/usr/local/mysql/lib"generate sourcecode documenation using epydoc the following way, epydoc needs the location of all the modules of your project and the django settings file, so setup following environment variables:export PYTHONPATH=/Volumes/Mac_HDD_2/Users/oliverpelz/Documents/workspace/bookingCalPyProject:$PYTHONPATHexport DJANGO_SETTINGS_MODULE=bookingCalPython.settingse.g. cd bookingCalPyProject/ecalendar#first check if running will work successfully:epydoc -v --check views.py#then run it for real and generate it in output dir e.g. ecalendar_docs:epydoc -v --html views.py -o ecalendar_docs#general information on how to document your subroutines and classes etc: http://epydoc.sourceforge.net/epydoc.html#a-brief-introduction#Setting up the mailserver functionality under Lion:#1. Create in the directory /etc/postfix/ a file which called sasl_passwd. (sudo vi sasl_passed)#2. Open this file and add mailhost.dkfz-heidelberg.de AD-Name:AD-Passwort#3. After that save an close this file#4. Than type in the terminal postmap /etc/postfix/sasl_passwd#5. After that add the following lines to /etc/postfix/main.cf myorigin = mailhost.dkfz-heidelberg.de myhostname = mailer.$myorigin smtpd_sender_restrictions = permit_inet_interfaces # smart host relayhost = mailhost.dkfz-heidelberg.de smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous#6. As a little test that all is fine type in the termianl sudo postfix start, push return and type in date | mail -s test [email protected]. A few seconds later should be a mail in you mail directory.#Now open the settings.py from the bookingCal#At the bottom from this file are the variables SENDER_MAIL and SMTP_SERVER#At SENDER_MAIL you must type in the mail address which sends the mails to any user #Example:SENDER_MAIL="[email protected]"#At SMTP_SERVER you must type in the server which sends the mails#Example: (in the dkfz are the Server: "mailhost.dkfz-heidelberg.de")SMTP_SERVER="mailhost.provider.de #Main sources for this instruction:#http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-and-mod_wsgi-on-ubuntu-10-04/#http://grok.zope.org/documentation/tutorial/installing-and-setting-up-grok-under-mod-wsgi/installing-and-configuring-mod-wsgi#http://www.saltycrane.com/blog/2010/02/how-install-pip-ubuntu/#http://epydoc.sourceforge.net/epydoc.html# some forum threads and newsgroup entries