在Ubuntu 16.04上安装Odoo8
一、安装依赖组件
sudo apt-get -yq install adduser ghostscript postgresql-client-9.5 python python-pip python-imaging python-pychart python-libxslt1 xfonts-base xfonts-75dpi libxrender1 libxext6 fontconfig python-zsi python-lasso libzmq3-dev libpq-dev python-dev libffi-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libssl-dev libjpeg8-dev
二、安装wkhtmltopdf
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
三、安装Postgres
1、安装
sudo apt-get install postgresql
2、创建数据库用户
sudo su postgres
createuser --createdb --username postgres --no-createrole --pwprompt odoo
创建用户时,密码设定为odoo,如果不是odoo,则下面的配置文件中需要相应修改
四、创建系统用户
sudo adduser odoo
五、获取Odoo代码
1、安装git
sudo apt-get install git
2、下载代码
su - odoo
cd
git clone https://github.com/Odoo/odoo.git --depth 1 --branch 8.0 --single-branch odoo
六、升级pip
pip install --upgrade pip
七、安装Python依赖库
sudo pip install -r /home/odoo/odoo/requirements.txt
通过豆瓣镜像安装:
sudo pip install -r /home/odoo/odoo/requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
通过中科大镜像安装:
sudo pip install -r /home/odoo/odoo/requirements.txt -i http://pypi.mirrors.ustc.edu.cn/simple/ --trusted-host pypi.mirrors.ustc.edu.cn
通过阿里云镜像安装:
sudo pip install -r /home/odoo/odoo/requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
八、配置odoo
在/home/odoo/目录下创建odoo-server.conf,填入以下内容
[options]
admin_passwd = admin
xmlrpc = True
xmlrpc_port = 8069
db_host = 127.0.0.1
db_port = 5432
db_user = odoo
db_password = odoo
addons_path = /home/odoo/odoo/addons,/home/odoo/odoo/openerp/addons
基于上面的配置文件,启动命令如下:
/home/odoo/odoo/openerp-server -c /home/odoo/odoo-server.conf
九、安装报表中文字体:
sudo apt-get install ttf-wqy-zenhei
sudo apt-get install ttf-wqy-microhei
十、配置启动脚本:
1、启动脚本内容如下:
#!/bin/bash
### BEGIN INIT INFO
# Provides: odoo.py
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start odoo daemon at boot time
# Description: Enable service provided by daemon.
# X-Interactive: true
### END INIT INFO
## more info: http://wiki.debian.org/LSBInitScripts
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=/home/odoo/odoo/odoo.py
NAME=odoo
DESC=odoo
CONFIG=/home/odoo/odoo.conf
LOGFILE=/home/odoo/odoo-server.log
PIDFILE=/home/odoo/${NAME}.pid
USER=odoo
export LOGNAME=$USER
test -x $DAEMON || exit 0
set -e
function _start() {
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE
}
function _stop() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --retry 3
rm -f $PIDFILE
}
function _status() {
start-stop-daemon --status --quiet --pidfile $PIDFILE
return $?
}
case "$1" in
start)
echo -n "Starting $DESC: "
_start
echo "ok"
;;
stop)
echo -n "Stopping $DESC: "
_stop
echo "ok"
;;
restart|force-reload)
echo -n "Restarting $DESC: "
_stop
sleep 1
_start
echo "ok"
;;
status)
echo -n "Status of $DESC: "
_status && echo "running" || echo "stopped"
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
2、把启动脚本复制到
/etc/init.d/odoo
并设置自动启动:
sudo su -
chmod +x /etc/init.d/odoo
update-rc.d odoo defaults
# =====================================================
# 下面是自动安装脚本
# =====================================================
#!/bin/bash ################################################################################ # Script for installing Odoo V8 on Ubuntu 16.04 LTS (could be used for other version too) # Author: Youfu Sheng(wdmsyf@yahoo.com) #------------------------------------------------------------------------------- # This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances # in one Ubuntu because of the different xmlrpc_ports #------------------------------------------------------------------------------- # Make a new file: # sudo nano odoo-install.sh # Place this content in it and then make the file executable: # sudo chmod +x odoo-install.sh # Execute the script to install Odoo: # ./odoo-install ################################################################################ ##fixed parameters #odoo OE_USER="odoo" #OE_HOME="/$OE_USER" OE_HOME="/opt/odoo" OE_HOME_EXT="$OE_HOME/${OE_USER}-server" #Set to true if you want to install it, false if you don't need it or have it already installed. INSTALL_WKHTMLTOPDF="True" #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) #Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) OE_PORT="8069" #Choose the Odoo version which you want to install. For example: 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed. #IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 9.0 OE_VERSION="8.0" #set the superadmin password OE_SUPERADMIN="admin" OE_CONFIG="${OE_USER}-server" #Flag for switch to upgrade OS or not UPGRADE_OS="False" #Flag for switch to install less or not(Needed by ODOO9) INSTALL_NODE="False" #-------------------------------------------------- # Update Server #-------------------------------------------------- if [ $UPGRADE_OS = "True" ]; then echo -e "\n---- Update Server ----" sudo apt-get update sudo apt-get upgrade -y fi #-------------------------------------------------- # Install PostgreSQL Server #-------------------------------------------------- echo -e "\n---- Install PostgreSQL Server ----" sudo apt-get install postgresql -y echo -e "\n---- PostgreSQL $PG_VERSION Settings ----" sudo sed -i s/"#listen_addresses = 'localhost'"/"listen_addresses = '*'"/g /etc/postgresql/9.5/main/postgresql.conf echo -e "\n---- Creating the ODOO PostgreSQL User ----" sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true #-------------------------------------------------- # Install Dependencies #-------------------------------------------------- echo -e "\n---- Install tool packages ----" if [ OE_VERSION = "9.0" ]; then #For Odoo9 sudo apt-get install wget subversion git bzr bzrtools python-pip gdebi-core -y echo -e "\n---- Install python packages ----" sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y echo -e "\n---- Install python libraries ----" sudo pip install gdata psycogreen ofxparse else #For Odoo8 sudo apt-get -yq install adduser ghostscript postgresql-client-9.5 python python-pip python-imaging python-pychart python-libxslt1 xfonts-base xfonts-75dpi libxrender1 libxext6 fontconfig python-zsi python-lasso libzmq3-dev libpq-dev python-dev libffi-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libssl-dev libjpeg8-dev fi if [ INSTALL_NODE = "True" ]; then echo -e "\n--- Install other required packages" sudo apt-get install node-clean-css -y sudo apt-get install node-less -y sudo apt-get install python-gevent -y fi #-------------------------------------------------- # Install Wkhtmltopdf if needed #-------------------------------------------------- if [ $INSTALL_WKHTMLTOPDF = "True" ]; then echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin else echo "Wkhtmltopdf isn't installed due to the choice of the user!" fi echo -e "\n---- Create ODOO system user ----" sudo adduser --system --quiet --shell=/bin/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER #The user should also be added to the sudo'ers group. sudo adduser $OE_USER sudo echo -e "\n---- Create Log directory ----" sudo mkdir /var/log/$OE_USER sudo chown $OE_USER:$OE_USER /var/log/$OE_USER #-------------------------------------------------- # Install ODOO #-------------------------------------------------- echo -e "\n==== Installing ODOO Server ====" sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_HOME_EXT/ echo -e "\n---- Create custom module directory ----" sudo su $OE_USER -c "mkdir $OE_HOME/custom" sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons" echo -e "\n---- Setting permissions on home folder ----" sudo chown -R $OE_USER:$OE_USER $OE_HOME/* echo -e "* Create server config file" sudo cp $OE_HOME_EXT/debian/openerp-server.conf /etc/${OE_CONFIG}.conf sudo chown $OE_USER:$OE_USER /etc/${OE_CONFIG}.conf sudo chmod 640 /etc/${OE_CONFIG}.conf echo -e "* Change server config file" sudo sed -i s/"db_user = .*"/"db_user = $OE_USER"/g /etc/${OE_CONFIG}.conf sudo sed -i s/"; admin_passwd.*"/"admin_passwd = $OE_SUPERADMIN"/g /etc/${OE_CONFIG}.conf sudo su root -c "echo 'logfile = /var/log/$OE_USER/$OE_CONFIG$1.log' >> /etc/${OE_CONFIG}.conf" sudo su root -c "echo 'addons_path=$OE_HOME_EXT/addons,$OE_HOME/custom/addons' >> /etc/${OE_CONFIG}.conf" echo -e "* Create startup file" sudo su root -c "echo '#!/bin/sh' >> $OE_HOME_EXT/start.sh" sudo su root -c "echo 'sudo -u $OE_USER $OE_HOME_EXT/openerp-server --config=/etc/${OE_CONFIG}.conf' >> $OE_HOME_EXT/start.sh" sudo chmod 755 $OE_HOME_EXT/start.sh #-------------------------------------------------- # Upgrade pip #-------------------------------------------------- echo -e "\n---- Upgrade pip ----" # sudo pip install --upgrade pip sudo pip install --upgrade pip #-------------------------------------------------- # Install chinese fonts for PDF: #-------------------------------------------------- echo -e "\n==== Installing Chinese font for PDF ====" sudo apt-get install ttf-wqy-zenhei sudo apt-get install ttf-wqy-microhei #-------------------------------------------------- # Install Dependencies #-------------------------------------------------- echo -e "\n---- Install requirements ----" #Set to use douban mirror for chinese mainland users,other users remove the mirror address to use offical source sudo pip install -r $OE_HOME_EXT/requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com #-------------------------------------------------- # Adding ODOO as a deamon (initscript) #-------------------------------------------------- echo -e "* Create init file" cat <<EOF > ~/$OE_CONFIG #!/bin/sh ### BEGIN INIT INFO # Provides: $OE_CONFIG # 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: Enterprise Business Applications # Description: ODOO Business Applications ### END INIT INFO PATH=/bin:/sbin:/usr/bin DAEMON=$OE_HOME_EXT/openerp-server NAME=$OE_CONFIG DESC=$OE_CONFIG # Specify the user name (Default: odoo). USER=$OE_USER # Specify an alternate config file (Default: /etc/openerp-server.conf). CONFIGFILE="/etc/${OE_CONFIG}.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 EOF echo -e "* Security Init File" sudo mv ~/$OE_CONFIG /etc/init.d/$OE_CONFIG sudo chmod 755 /etc/init.d/$OE_CONFIG sudo chown root: /etc/init.d/$OE_CONFIG echo -e "* Change default xmlrpc port" sudo su root -c "echo 'xmlrpc_port = $OE_PORT' >> /etc/${OE_CONFIG}.conf" echo -e "* Start ODOO on Startup" sudo update-rc.d $OE_CONFIG defaults echo -e "* Starting Odoo Service" sudo su root -c "/etc/init.d/$OE_CONFIG start" echo "-----------------------------------------------------------" echo "Done! The Odoo server is up and running. Specifications:" echo "Port: $OE_PORT" echo "User service: $OE_USER" echo "User PostgreSQL: $OE_USER" echo "Code location: $OE_USER" echo "Addons folder: $OE_USER/$OE_CONFIG/addons/" echo "Start Odoo service: sudo service $OE_CONFIG start" echo "Stop Odoo service: sudo service $OE_CONFIG stop" echo "Restart Odoo service: sudo service $OE_CONFIG restart" echo "-----------------------------------------------------------"
相关推荐
本文档旨在指导用户在 Ubuntu 16.04 服务器上安装 Odoo 11,Odoo 11 是一款免费开源的 CRM 客户管理系统。本文将一步步指导用户完成安装过程,包括系统更新、安装依赖项、创建 Odoo 用户、安装和配置 PostgreSQL、...
- 如果在安装过程中遇到权限问题,尝试使用 `sudo` 命令重新执行安装脚本。 ```bash sudo ./vmware-install.pl ``` 2. **依赖问题**: - 如果安装过程中出现缺少依赖的情况,可以使用以下命令安装所需的...
6. **处理未解决的依赖问题**: 如果在安装过程中遇到任何依赖问题,可以使用`apt-get`的`--fix-broken`选项来尝试自动解决: ``` sudo apt-get install --fix-broken ``` 7. **启动和配置OpenSSH服务**: 安装...
ubuntu16.04中安装使用dockerubuntu16.04中安装使用docker
通过以上步骤,您可以在 Ubuntu 16.04 上顺利地安装和配置 Eclipse IDE。Eclipse 不仅支持 Java 开发,还支持多种其他编程语言,包括 C/C++、PHP 等。对于初学者而言,按照本教程逐步操作即可顺利完成安装;而对于...
MySQL8在Ubuntu 16.04 64位系统上的安装通常涉及到多个步骤,包括获取软件源,更新系统库,安装依赖项,配置服务,以及初始化数据库。这个"MySQL8 Ubuntu16.04 64位 懒人安装包"提供了便捷的方式,通过一个名为`...
在Ubuntu 16.04上安装MySQL 5.7是一项常见的系统管理任务,尤其对于开发者和运维人员来说。MySQL 5.7是该数据库管理系统的一个稳定版本,提供了许多性能改进和新特性。以下是关于使用脚本在Ubuntu 16.04上自动安装...
如果在安装过程中遇到依赖性问题,因为离线安装无法自动解决,你需要手动查找并安装缺失的依赖。查看错误信息,确定哪些包是缺少的,然后在源机上下载对应的.deb文件,再转移到目标机上安装。 例如,如果提示缺少`...
值得注意的是,确保在安装过程中保持网络连接,以便获取最新的软件和安全更新,同时避免因下载的ISO镜像问题导致的潜在问题。在整个过程中,细心和耐心是关键,遇到任何问题,可以参考在线教程或社区论坛寻求帮助。
以下是一个详细的步骤指南,涵盖了如何使用提供的离线安装包(包括libmecab2、libaio1和mysql-server 5.7.33)在Ubuntu 16.04上安装MySQL。 首先,你需要将这些离线安装包下载到你的本地计算机或者能够访问目标内网...
在安装Ubuntu 16.04时,用户可以选择不同的安装类型,如最小化安装、桌面版安装或服务器版安装。此外,Ubuntu 16.04还支持多种语言,适应全球用户的使用需求。 总的来说,Ubuntu 16.04 LTS是一款强大、稳定的Linux...
这个文件就是我们所说的压缩包子文件,它实际上是一个预打包的软件包,可以直接在Ubuntu上安装。 下载完成后,打开终端(Terminal),这是Ubuntu中的命令行界面,通过快捷键Ctrl+Alt+T可以快速调出。接下来,我们将...
在安装GRUB引导器的选项中,根据你的硬件(UEFI或MBR)选择合适的安装位置。安装完成后,选择地区、键盘布局,设置用户名和密码,然后等待安装过程完成。最后,重启系统,移除安装介质,系统将自动启动进入新安装的...
在Ubuntu上安装这款应用,通常需要通过Debian包(.deb)格式进行。下面我们将详细探讨如何在Ubuntu 16.04系统中安装和使用钉钉。 首先,了解`.deb`包的含义至关重要。`.deb`是Debian软件包的扩展名,它是Ubuntu基于...
在安装 Oracle 之前,还需要安装一些必要的依赖包。这一步非常重要,因为缺少这些依赖可能会导致安装过程中出现问题。 1. **更新软件包列表:** - 更新软件包列表以获取最新的软件包信息: ```bash sudo apt ...
以下步骤将详细介绍如何在 Ubuntu 16.04 上安装 LabVIEW 2017。 1. **获取 LabVIEW 安装包**: - 在 Windows 系统下,您需要获取 LabVIEW 2017 的 ISO 安装文件。 - 使用解压缩工具(如 WinRAR、7-Zip 等)将 ISO...
2. **网络连接问题**:确保计算机连接到稳定的网络环境中,并在安装过程中正确配置网络设置。 3. **软件包冲突**:使用`apt-get`命令时遇到依赖关系问题,可以通过清理缓存、重新安装等方式解决。 4. **驱动兼容性...
内网环境安装mysql5.7数据库所需deb安装包,libaio1_0.3.110-2_amd64.deb ,libmecab2_0.996-1.2ubuntu1_amd64.deb ,libmysqlclient20_5.7.25-1ubuntu16.04_amd64.deb,libmysqlclient-dev_5.7.25-1ubuntu16.04_amd...
UBuntu16.04上安装vcs成功.doc