----------------------------------------------linux环境搭建
yum clean all
yum install postgresql postgresql-server postgresql-libs
postgresql-setup initdb
mv /var/lib/pgsql /data
cd /var/lib
ln -s /data/pgsql
设置PostgreSQL的开机自启动。
1 # systemctl enable postgresql
2 # systemctl start postgresql
设置postgres数据库用户“postgresql”密码【gosens】。
1 # su - postgres
2 $ psql
3 postgres=# \password postgres
4 postgres=# \q
5 # exit
--------------------创建 odoo 用户
useradd odoo
passwd odoo 【密码:gosensErpOdoo】
mkdir /data/odoo10
chown -R odoo:odoo /data/odoo10
chmod -R 755 /data/odoo10
7 # su - postgres
8 $ createuser -P -d -U postgres erpuser; 密码【gosens】
9 $ psql
10 postgres=# create database odoo with owner=erpuser encoding='UTF8';
11 postgres=# \q
----------(1)使其Postgresql 能本地访问
修改pg_hba.conf 的客户端访问设置,将localhost 的访问由ident 改为trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
----------(2)Postgresql允许远程访问配置修改
postgresql默认情况下,远程访问不能成功,如果需要允许远程访问,需要修改两个配置文件,说明如下:
1.postgresql.conf
将该文件中的listen_addresses项值设定为“*”,在9.0 Windows版中,该项配置已经是“*”无需修改。
2.pg_hba.conf
在该配置文件的# IPv4 local connections:行下添加以下配置,或者直接将这一行修改为以下配置
host all all 0.0.0.0/0 md5
如果不希望允许所有IP远程访问,则可以将上述配置项中的0.0.0.0设定为特定的IP值。
-----------------启动postgresql
vi ~/.bash_profile
export PGDATA=/data/pgsql/data
/usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
---升级python
wget http://python.org/ftp/python/2.7.9/Python-2.7.9.tgz
或者把本地的python包上传到服务器上
tar -zxvf Python-2.7.9.tgz
cd Python-2.7.9
mkdir /usr/local/python27
1
./configure --prefix=/usr/local/python27
2
make
3
make install
mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/python27/bin/python2.7 /usr/bin/python
下载成功后,进入python2.7的目录,重新执行
#make
#make install
vi /usr/bin/yum
将
#!/usr/bin/python
改为:
#!/usr/bin/python2.7
vi /usr/libexec/urlgrabber-ext-down
【解释:python2.4 是安装系统自带的版本号】
yum install zlib
yum install zlib-devel
-----------------修改yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
unzip ../setuptools-24.0.3.zip
cd setuptools-24.0.3/
python setup.py install
tar xzvf pip-8.1.2.tar.gz
cd pip-8.1.2
python setup.py install
3) 安装附加的python扩展包和系统支持软件及检查
按照/data/odoo/requirements.txt中的内容,逐一安装或升级python扩展包(在安装python扩展包的过程中,可能需要安装系统包)。
3 # yum install -y python-pip(安装系统包)
报错:No package python-pip available.
Error: Nothing to do
这是因为像centos这类衍生出来的发行版,他们的源有时候内容更新的比较滞后,或者说有时候一些扩展的源根本就没有。
所以在使用yum来search python-pip的时候,会说没有找到该软件包。因此为了能够安装这些包,需要先安装扩展源EPEL。
EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。
首先安装epel扩展源
zqw执行命令:yum -y install epel-release
zqw执行命令:yum -y install python-pip
报错2:
Operation cancelled by user
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
zqw执行命令:pip install --upgrade pip
4 # pip install --upgrade argpase(升级python包)
5 # pip install wsgiref(安装python包)
pip install urllib3[socks] --trusted-host pypi.douban.com
pip install --upgrade pip
pip install Pillow==3.4.1
pip install --upgrade python-gobject
pip install gdata psycogreen ofxparse XlsxWriter
pip install Babel==2.3.4
pip install decorator==4.0.10
pip install docutils==0.12
pip install ebaysdk==2.1.4
pip install feedparser==5.2.1
pip install gevent==1.1.2
pip install greenlet==0.4.10
pip install jcconv==0.2.3
pip install Jinja2==2.8
pip install lxml==3.5.0
pip install Mako==1.0.4
pip install MarkupSafe==0.23
pip install mock==2.0.0
pip install ofxparse==0.15
pip install passlib==1.6.5
pip install psutil==4.3.1
pip install psycogreen==1.0
pip install psycopg2==2.6.2
pip install pydot==1.2.3
pip install pyparsing==2.1.10
pip install pyPdf==1.13
pip install pyserial==3.1.1
pip install Python-Chart==1.39
pip install python-dateutil==2.5.3
pip install python-ldap==2.4.27
pip install python-openid==2.2.5
pip install pytz==2016.7
pip install pyusb==1.0.0
pip install PyYAML==3.12
pip install qrcode==5.3
pip install reportlab==3.3.0
pip install requests==2.11.1
pip install six==1.10.0
pip install suds-jurko==0.6
pip install vatnumber==1.2
pip install vobject==0.9.3
pip install Werkzeug==0.11.11
pip install wsgiref==0.1.2
pip install XlsxWriter==0.9.3
pip install xlwt==1.1.2
yum install ttf-wqy-zenhei
yum install ttf-wqy-microhei
yum install yum-utils
yum install openssl openssl-devel -y
安装wkthmltopdf软件(内置qt静态库, 从http://download.gna.org/wkhtmltopdf 上下载对应的软件包)。
6 # yum install xorg-x11-fonts-75dpi
7 # yum install xorg-x11-fonts-Type1
8 # rpm -ivh wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
225 ln -s /usr/local/bin/wkhtmltopdf /usr/bin/
226 ln -s /usr/local/bin/wkhtmltoimage /usr/bin/
安装python pymssql扩展包。
4) # yum install freetds-devel
5) # pip install pymssql
-------------------------------nodejs 安装
yum install -y epel-release
100 yum install -y libxml++.x86_64 libxml++-devel.x86_64 libxml2-python.x86_64 libxml2-static.x86_64 libxml2.x86_64 libxml2-devel.x86_64 libxml2.x86_64 libxml2-devel.x86_64 python-lxml.x86_64 libxslt.x86_64 libxslt-python.x86_64 libxslt-devel.x86_64 python-lxml.x86_64 libpqxx-devel.x86_64 libpqxx.x86_64 openldap-devel.x86_64 python-ldap.x86_64 openldap-devel.x86_64 openldap.x86_64 python-devel.x86_64
156 pip install -r requirements.txt --trusted-host pypi.douban.com
184 pip install xlrd --trusted-host pypi.douban.com
110 tar xzvf node.tgz
111 cd usr/local/
113 mv node-v4.4.6-linux-x64 /usr/local/
116 ln -s /usr/local/node-v4.4.6-linux-x64/bin/node /usr/bin/node
117 ln -s /usr/local/node-v4.4.6-linux-x64/bin/npm /usr/bin/npm
130 ln -s /usr/lib/node_modules/less/bin/lessc /usr/bin
134 ln -s /usr/local/node-v4.4.6-linux-x64/lib/node_modules /usr/lib/
137 cd /usr/bin
139 ln -s ../lib/node_modules/ycssmin/bin/cssmin cssmin
-----------------------------------nginx 安装【如果非必要不用安装】
160 yum install nginx.x86_64
whereis nginx
169 cp nginx.conf nginx.conf.orig
204 openssl genrsa -out privkey.pem 2048
205 openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095
170 vi nginx.conf
171 nginx -t
212 nginx
--------------------------telnet 依赖包
rpm -qa telnet-server
rpm -qa xinetd
yum list |grep telnet
yum install telnet-server.x86_64
yum install telnet.x86_64
yum list |grep xinetd
yum install xinetd.x86_64
systemctl enable xinetd.service
systemctl enable telnet.socket
systemctl start telnet.socket
systemctl start xinetd(或service xinetd start)
------------------------下载odoo10 并且安装 方式一
不要添加odoo.repo源,可能会在你yum update时更新odoo 造成系统不稳定
wget https://nightly.odoo.com/10.0/nightly/rpm/odoo_10.0.latest.noarch.rpm
yum localhostintall odoo_10.0.latest.noarch.rpm
------------------------源码安装启动 方式二
yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo
vi /etc/yum.repos.d/odoo.repo
文件内容:
[odoo-nightly]
name=Odoo Nightly repository
baseurl=http://nightly.odoo.com/10.0/nightly/rpm/
enabled=1
gpgcheck=1
gpgkey=https://nightly.odoo.com/odoo.key
yum install -y odoo
第一步:python setup.py install
第二步:cd /data/odoo
cp /data/odoo/setup/odoo /data/odoo/odoo-bin
nohup /data/odoo/odoo-bin --config=/data/odoo/setup/odoo.conf &
-----------------------window下载好 odoo tar.gz包 方式三【测试环境按此方法安装】
上传 odoo_10.0.latest.tar.gz包
cp /data/odoo10/setup/odoo /usr/bin/odoo #复制启动文件到/usr/bin/目录下【root执行】
sudo chown odoo: /usr/bin/odoo #修改文件所有者【root执行】
sudo chmod 755 /usr/bin/odoo #增加执行权限【root执行】
sudo su - odoo -s /bin/bash #切换到odoo用户
mkdir /usr/lib/python2.7/site-packages/odoo-10.0.post20170511-py2.7.egg
ln -s /data/odoo10/odoo /usr/lib/python2.7/site-packages/odoo-10.0.post20170511-py2.7.egg/
/data/odoo10/setup/odoo --config=/data/odoo10/setup/odoo.conf #运行Odoo