Installing the web layer for OpenERP 8 (now known as Odoo 8) as a stand-alone HTTP server involves setting up the system to handle HTTP requests directly. This is useful for development environments or specific production setups where you want to run Odoo without relying on a separate web server like Nginx or Apache.
Step-by-Step Guide to Set Up OpenERP 8 (Odoo 8) as a Stand-Alone HTTP Server
Prerequisites
- System Requirements:
- A machine with a Unix-based OS (like Ubuntu, CentOS, Debian) or Windows.
- Python 2.7 installed.
- PostgreSQL database server installed and running.
2. Dependencies:
- Ensure you have all necessary Python dependencies.
- Have Odoo 8 source code or package ready for installation.
Step 1: Install Python and Dependencies
Ensure Python 2.7 and necessary libraries are installed. This guide assumes you’re using a Unix-based system.
- Update and Install Essential Packages:
sudo apt-get update
sudo apt-get install python-dev python-pip build-essential
- Install Python Packages: Odoo 8 requires several Python packages. Install them using
pip
:
sudo pip install babel decorator docutils feedparser gevent \
jinja2 lxml mako MarkupSafe mock passlib psutil \
psycopg2-binary pydot pyparsing pyPdf python-dateutil \
pytz pywebdav pyyaml reportlab requests six suds-jurko \
vobject werkzeug wsgiref xlwt pillow
Step 2: Install PostgreSQL
- Install PostgreSQL:
sudo apt-get install postgresql postgresql-contrib
- Create a PostgreSQL User for Odoo:
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
Enter a password when prompted and then exit the postgres
user shell:
exit
Step 3: Download and Install OpenERP 8 (Odoo 8)
- Download Odoo 8: Download the source code from GitHub:
cd /opt
sudo git clone --depth=1 --branch=8.0 https://www.github.com/odoo/odoo.git
cd odoo
- Install Odoo: No specific installation is needed since you will run it directly from the source directory. However, make sure to install remaining dependencies and prepare the configuration.
Step 4: Configure Odoo as a Stand-Alone HTTP Server
- Create a Configuration File: Create a configuration file
odoo.conf
in the/etc
directory:
sudo nano /etc/odoo.conf
Add the following content to the file (customize the paths and settings as needed):
[options]
; This is the password that allows database operations:
admin_passwd = your_admin_password
db_host = False
db_port = False
db_user = odoo
db_password = your_postgres_password
addons_path = /opt/odoo/addons,/opt/odoo/your_custom_addons_path
logfile = /var/log/odoo/odoo.log
xmlrpc_port = 8069
Save and close the file.
- Create Log Directory: Ensure the log directory exists and set the appropriate permissions:
sudo mkdir /var/log/odoo
sudo chown odoo:odoo /var/log/odoo
Step 5: Start Odoo Server
- Run Odoo as Stand-Alone HTTP Server: Navigate to the Odoo directory and start the server with the configuration file:
cd /opt/odoo
./odoo.py --config=/etc/odoo.conf
This command starts Odoo and it will be accessible via HTTP on port 8069 by default.
- Test Odoo: Open a web browser and navigate to:
http://your_server_ip:8069
You should see the Odoo 8 login screen or the initial setup screen if it’s the first time you are running Odoo.
Step 6: (Optional) Run Odoo as a Background Service
For production environments, you typically want Odoo to run as a service, so it starts automatically on system boot and runs in the background.
- Create an Init Script: Create a script in
/etc/init.d
:
sudo nano /etc/init.d/odoo
Add the following script:
#!/bin/sh
### BEGIN INIT INFO
# Provides: odoo
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Odoo ERP
# Description: Odoo ERP Business Application
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DAEMON=/opt/odoo/odoo.py
NAME=odoo
DESC=odoo
USER=odoo
CONFIG=/etc/odoo.conf
LOGFILE=/var/log/odoo/odoo.log
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --chuid $USER --background --make-pidfile --exec $DAEMON -- --config=$CONFIG --logfile=$LOGFILE
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --oknodo
echo "$NAME."
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --oknodo
sleep 1
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --chuid $USER --background --make-pidfile --exec $DAEMON -- --config=$CONFIG --logfile=$LOGFILE
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart}" >&2
exit 1
;;
esac
exit 0
Save and close the file.
- Make the Script Executable:
sudo chmod +x /etc/init.d/odoo
- Register the Script to Run at Startup:
sudo update-rc.d odoo defaults
- Start Odoo Service:
sudo service odoo start
You can now manage Odoo as a service with commands like start
, stop
, restart
, etc.
Summary
Installing Web Layer in OpenERP 8 as a stand-alone server involves configuring the system to handle HTTP requests directly. By following these steps, you can set up OpenERP 8 to run as a stand-alone HTTP server on port 8069. You enable Odoo to run using Nginx or Apache as a front-end server to handle web traffic and proxy requests to the Odoo server. This ensures a more robust Odoo server solution with enhanced performance and security features.