Project for the UPV to develop an app like BlaBlaCar but only for UPV people.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

updated install docs

+125
+125
docs/install.rst
··· 24 24 $ make 25 25 $ sudo make install 26 26 27 + Install Virtualenv 28 + ------------------ 29 + 30 + .. code-block:: console 31 + 32 + $ sudo pip install virtualenv virtualenvwrapper 33 + 34 + Add the following text to ``.bashrc`` file: 35 + 36 + .. code-block:: bash 37 + 38 + export WORKON_HOME=$HOME/.virtualenvs 39 + source /usr/bin/virtualenvwrapper.sh 40 + 41 + Reload ``.bashrc``: 42 + 43 + .. code-block:: console 44 + 45 + $ source ~/.bashrc 46 + 47 + Install project 48 + --------------- 49 + 50 + .. code-block:: console 51 + 52 + $ mkvirtualenv --python=/usr/local/bin/python3 carshare 53 + (carshare) $ git clone git@git.upv.es:GIT_CARSHARE/carshare-project.git 54 + (carshare) $ cd carshare-project 55 + (carshare) $ pip install -r requirements/production.txt 56 + 57 + 58 + uWSGI 59 + ----- 60 + 61 + Create a ``uwsgi.ini`` file, with the following content: 62 + 63 + .. code-block:: ini 64 + 65 + [uwsgi] 66 + chdir = /home/carshare/carshare-project/upvcarshare 67 + module = config.wsgi 68 + home = /home/carshare/.virtualenvs/carshare 69 + env = DJANGO_SETTINGS_MODULE=config.settings.production 70 + master = true 71 + processes = 5 72 + socket = /home/carshare/carshare.sock 73 + chmod-socket = 666 74 + vacuum = true 75 + stats = /home/carshare/carshare_stats.sock 76 + 77 + 78 + Be sure that the nginx user **can access** the ``carshare.sock`` file. 79 + 80 + Supervisor 81 + ---------- 82 + 83 + Create the following file ``/etc/supervisord.d/carshare.ini``, with the correct secret data: 84 + 85 + .. code-block:: ini 86 + 87 + [program:carshare] 88 + user = carshare 89 + command = /home/carshare/.virtualenvs/carshare/bin/uwsgi --ini /home/carshare/uwsgi.ini 90 + environment = PATH="/home/carshare/.virtualenvs/carshare/bin",ORACLE_SID="ZETATEST",DJANGO_SETTINGS_MODULE="config.settings.production",DJANGO_ALLOWED_HOSTS="carsdes.cc.upv.es",DJANGO_SECRET_KEY="secret",DATABASE_URL="oraclegis://username:password@server:port/name" 91 + topsignal = HUP 92 + stderr_logfile = /var/log/carshare/carshare.log 93 + stderr_logfile_maxbytes = 50MB 94 + stderr_logfile_backups = 10 95 + loglevel = info 96 + 97 + To load the new configuration file, restart supervisor service: 98 + 99 + .. code-block:: bash 100 + 101 + $ sudo systemctl restart supervisord 102 + 103 + To restart the process: 104 + 105 + .. code-block:: bash 106 + 107 + $ sudo supervisorctl restart carshare 108 + 109 + Nginx 110 + ----- 111 + 112 + Create the following file ``/etc/nginx/conf.d/carshare.conf``: 113 + 114 + .. code-block:: nginx 115 + 116 + upstream carshare_app { 117 + server unix:///home/carshare/carshare.sock; 118 + } 119 + 120 + server { 121 + listen 80; 122 + client_max_body_size 0; 123 + charset utf-8; 124 + 125 + location /media { 126 + alias /home/carshare/carshare-project/upvcarshare/media; 127 + } 128 + 129 + location /static { 130 + alias /home/carshare/carshare-project/upvcarshare/public; 131 + } 132 + 133 + location / { 134 + uwsgi_pass carshare_app; 135 + uwsgi_read_timeout 600; 136 + uwsgi_param QUERY_STRING $query_string; 137 + uwsgi_param REQUEST_METHOD $request_method; 138 + uwsgi_param CONTENT_TYPE $content_type; 139 + uwsgi_param CONTENT_LENGTH $content_length; 140 + uwsgi_param REQUEST_URI $request_uri; 141 + uwsgi_param PATH_INFO $document_uri; 142 + uwsgi_param DOCUMENT_ROOT $document_root; 143 + uwsgi_param SERVER_PROTOCOL $server_protocol; 144 + uwsgi_param REMOTE_ADDR $remote_addr; 145 + uwsgi_param REMOTE_PORT $remote_port; 146 + uwsgi_param SERVER_ADDR $server_addr; 147 + uwsgi_param SERVER_PORT $server_port; 148 + uwsgi_param SERVER_NAME $server_name; 149 + uwsgi_param UWSGI_SCHEME http; 150 + } 151 + }