Last active
September 28, 2018 18:25
-
-
Save diogocduarte/6c68d068d9f48d6951e59b34bb589efb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo adduser --system --home=/opt/odoo --group odoo | |
sudo su - odoo -s /bin/bash | |
sudo apt-get install postgresql | |
sudo pg_createcluster 9.3 main --start | |
sudo su - postgres | |
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo (OclassAdm) | |
exit | |
sudo apt-get install python-cups python-dateutil python-decorator python-docutils python-feedparser \ | |
python-gdata python-geoip python-gevent python-imaging python-jinja2 python-ldap python-libxslt1 \ | |
python-lxml python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 \ | |
python-pybabel python-pychart python-pydot python-pyparsing python-pypdf python-reportlab python-requests \ | |
python-simplejson python-tz python-unicodecsv python-unittest2 python-vatnumber python-vobject \ | |
python-werkzeug python-xlwt python-yaml node-clean-css node-less xfonts-75dpi xfonts-base | |
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb | |
sudo apt-get install xfonts-base | |
sudo apt-get -f install | |
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb | |
-------------------- old trick | |
--- sudo cp /usr/local/bin/wkhtmltopdf /usr/bin | |
--- sudo cp /usr/local/bin/wkhtmltoimage /usr/bin | |
sudo apt-get install git | |
sudo su - odoo -s /bin/bash | |
git clone https://www.github.com/odoo/odoo --depth 1 --branch 9.0 --single-branch v9 | |
exit | |
sudo cp /opt/odoo/v9/debian/openerp-server.conf /etc/odoo-server.conf | |
sudo chown odoo: /etc/odoo-server.conf | |
sudo chmod 640 /etc/odoo-server.conf | |
sudo vim /etc/odoo-server.conf | |
-- logfile = /var/log/odoo/odoo-server.log | |
-- logrotate = True | |
-- proxy_mode = True | |
sudo su - odoo -s /bin/bash | |
/opt/odoo/openerp-server | |
sudo nano /etc/init.d/odoo-server ---- paste here from below 1 | |
sudo chmod 755 /etc/init.d/odoo-server | |
sudo chown root: /etc/init.d/odoo-server | |
sudo mkdir /var/log/odoo | |
sudo chown odoo:root /var/log/odoo | |
sudo /etc/init.d/odoo-server start | |
less /var/log/odoo/odoo-server.log | |
sudo update-rc.d odoo-server defaults | |
------------------------------------------------------------------------ 1 | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: odoo-server | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Should-Start: $network | |
# Should-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Complete Business Application software | |
# Description: Odoo is a complete suite of business tools. | |
### END INIT INFO | |
PATH=/bin:/sbin:/usr/bin | |
DAEMON=/opt/odoo/v9/openerp-server | |
NAME=odoo-server | |
DESC=odoo-server | |
# Specify the user name (Default: odoo). | |
USER=odoo | |
# Specify an alternate config file (Default: /etc/odoo-server.conf). | |
CONFIGFILE="/etc/odoo-server.conf" | |
# pidfile | |
PIDFILE=/var/run/$NAME.pid | |
# Additional options that are passed to the Daemon. | |
DAEMON_OPTS="-c $CONFIGFILE" | |
[ -x $DAEMON ] || exit 0 | |
[ -f $CONFIGFILE ] || exit 0 | |
checkpid() { | |
[ -f $PIDFILE ] || return 1 | |
pid=`cat $PIDFILE` | |
[ -d /proc/$pid ] && return 0 | |
return 1 | |
} | |
case "${1}" in | |
start) | |
echo -n "Starting ${DESC}: " | |
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ | |
--chuid ${USER} --background --make-pidfile \ | |
--exec ${DAEMON} -- ${DAEMON_OPTS} | |
echo "${NAME}." | |
;; | |
stop) | |
echo -n "Stopping ${DESC}: " | |
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \ | |
--oknodo | |
echo "${NAME}." | |
;; | |
restart|force-reload) | |
echo -n "Restarting ${DESC}: " | |
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \ | |
--oknodo | |
sleep 1 | |
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ | |
--chuid ${USER} --background --make-pidfile \ | |
--exec ${DAEMON} -- ${DAEMON_OPTS} | |
echo "${NAME}." | |
;; | |
*) | |
N=/etc/init.d/${NAME} | |
echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 | |
------------------------------------------------------------------------ 2 | |
server { | |
listen 80; | |
server_name www.example.com; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
proxy_buffers 16 64k; | |
proxy_buffer_size 128k; | |
location /longpolling { | |
proxy_pass http://0.0.0.0:8072; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
# by default, do not forward anything | |
proxy_redirect off; | |
} | |
# cache some static data in memory for 60mins. | |
location ~* ^/(openerp|openobject|web)/static/ { | |
proxy_cache_valid 200 60m; | |
proxy_buffering on; | |
expires 864000; | |
proxy_pass http://0.0.0.0:8069; | |
} | |
location / { | |
proxy_pass http://0.0.0.0:8069; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
# by default, do not forward anything | |
proxy_redirect off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment