Questo sito utilizza cookie per le proprie funzionalità e per inviarti pubblicità e servizi in linea con le tue preferenze. Chiudendo questo banner, scorrendo questa pagina o cliccando qualunque suo elemento acconsenti all’uso dei cookie.

Accedendo al link http://www.odoo-italia.org/index.php/home/cookie-policy puoi leggere in dettaglio le modalità di trattamento dei cookie da parte dell'Associazione Odoo Italia.

Benvenuto, Ospite
Nome utente: Password: Ricordami

ARGOMENTO: All-in-One script fro 5.0.6 on Ubuntu8.04LTS-SVR

All-in-One script fro 5.0.6 on Ubuntu8.04LTS-SVR 9 Anni 1 Mese fa #1319

  • davidedvn
  • Avatar di davidedvn
  • Offline
  • Fresh Boarder
  • Messaggi: 7
  • Karma: 0
Sono partito dallo script all.in one per 5.0.6 con gui, mi sono accorto che tutto da launchpad prendendo pero le versioni un pochino meno recenti e aggiornandole poi allora ho modificato lo script eliminando la GUI cosi da poter essere usato da shell.
Ho omesso molti controlli quindi prima di usarlo controllate che non mi sia dimenticato qualcosa o che non sia compatibile con il vostro server.
Sono partito da una macchina base creata con VirtualBox selezionado le opzioni
[*]LAMP
[*]Postgre SQL
[*]Open SSH
Non ho creato un utente openerp lo crea lo script.

Buon Divertimento ;)
OpenERP-5.0.6All-in-One-Script-UbuntuServer.sh

#!/bin/bash
echo "Please enter the Administrator Password?"
read passwvar
if [ -z $passwvar ]
then
echo "No passwd insert execution aborted"
exit 0
fi
#creazione utente openerp
sudo adduser --no-create-home --quiet --system openerp

PATH=/usr/bin:/sbin:/bin:/usr/sbin
echo "# DON'T PRESS ACCEPT/OK !!. Downloading OpenERP Software 5.06";
cd /opt
wget openerp.com/download/stable/source/openerp-server-5.0.6.tar.gz
wget openerp.com/download/stable/source/openerp-web-5.0.6.tar.gz
tar -xzf openerp-server-5.0.6.tar.gz
tar -xzf openerp-web-5.0.6.tar.gz
mv openerp-server-5.0.6 openerp-server
mv openerp-client-web-5.0.6 openerp-web
rm *.tar.gz

sudo apt-get update
echo "# DON'T PRESS ACCEPT/OK !!. Downloading and installing Python libraries";
sudo apt-get install -y python python-dev build-essential python-setuptools python-psycopg2 python-reportlab python-egenix-mxdatetime python-tz python-pychart python-pydot python-lxml python-libxslt1 python-vobject graphviz python-xml python-libxml2 python-imaging python-profiler;

#Postgres Database configuration:
#sudo vi /etc/postgresql/8.3/main/pg_hba.conf
#Replace the following line:
## “local” is for Unix domain socket connections only
#local all all ident sameuser
#with:
##”local” is for Unix domain socket connections only
#local all all md5
sudo sed -i 's/(local:space:*all:space:*all:space:*)(ident:space:*sameuser)/1md5/g' /etc/postgresql/8.3/main/pg_hba.conf

#Restart Postgres:
echo "# DON'T PRESS ACCEPT/OK !!. Restarting Postgres Database";
sudo /etc/init.d/postgresql-8.3 restart

#sudo su postgres
#createuser openerp -P
# Enter password for new role: (openerp)
# Enter it again:
# Shall the new role be a superuser? (y/n) n
# Shall the new role be allowed to create databases? (y/n) y
# Shall the new role be allowed to create more new roles? (y/n) n
echo "# DON'T PRESS ACCEPT/OK !!. Creating user openerp on Postgres Database";
sudo -u postgres createuser openerp --no-superuser --createdb --no-createrole
sudo -u postgres psql template1 -U postgres -c "alter user openerp with password '$passwvar'"

echo "# DON'T PRESS ACCEPT/OK !!. Compiling and Installing OpenERP Software";
cd /opt/openerp-server
sudo python setup.py install
cd /opt/openerp-web
sudo easy_install -U openerp-web
cd /opt



###########################################
# Document Management Permissions: openobject.com/forum/topic13021.html?highlight=ftp
sudo chown openerp /usr/lib/python2.5/site-packages/openerp-server
#
echo "# DON'T PRESS ACCEPT/OK !!. Adding openerp-server and openerp-web init scripts and config files";
#####################################################################################
# openerp-server init script
#####################################################################################
cat > /tmp/openerp-server <<"EOF"
#!/bin/sh

### BEGIN INIT INFO
# Provides: openerp-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Enterprise Resource Management software
# Description: OpenERP is a complete ERP and CRM software.
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/openerp-server
NAME=openerp-server
DESC=openerp-server
USER=openerp

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=/etc/openerp-server.conf

echo "${NAME}."
;;

stop)
echo -n "Stopping ${DESC}: "

start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid
--oknodo

echo "${NAME}."
;;

restart|force-reload)
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=/etc/openerp-server.conf

echo "${NAME}."
;;

*)
N=/etc/init.d/${NAME}
echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0

EOF

sudo cp /tmp/openerp-server /etc/init.d/
sudo chmod +x /etc/init.d/openerp-server
#Create /var/log/openerp with proper ownership:
sudo mkdir -p /var/log/openerp
sudo touch /var/log/openerp/openerp.log
sudo chown -R openerp.root /var/log/openerp/

#####################################################################################
# openerp-server config file
#####################################################################################
cat > /tmp/openerp-server.conf <<"EOF2"
# /etc/openerp-server.conf(5) - configuration file for openerp-server(1)

[options]
# Enable the debugging mode (default False).
#verbose = True

# The file where the server pid will be stored (default False).
#pidfile = /var/run/openerp.pid

# The file where the server log will be stored (default False).
logfile = /var/log/openerp/openerp.log

# The IP address on which the server will bind.
# If empty, it will bind on all interfaces (default empty).
#interface = localhost
interface =
# The TCP port on which the server will listen (default 8069).
port = 8069

# Enable debug mode (default False).
#debug_mode = True

# Launch server over https instead of http (default False).
secure = False

# Specify the SMTP server for sending email (default localhost).
smtp_server = localhost

# Specify the SMTP user for sending email (default False).
smtp_user = False

# Specify the SMTP password for sending email (default False).
smtp_password = False

# Specify the database name.
db_name =

# Specify the database user name (default None).
db_user = openerp

# Specify the database password for db_user (default None).
db_password =

# Specify the database host (default localhost).
db_host =

# Specify the database port (default None).
db_port = 5432

EOF2

sudo cp /tmp/openerp-server.conf /etc/
sudo chown root.root /etc/openerp-server.conf
sudo chmod 644 /etc/openerp-server.conf

sudo sed -i "s/db_password =/db_password = $passwvar/g" /etc/openerp-server.conf

#####################################################################################
# openerp-web init script and openerp-web.cfg
#####################################################################################
cat > /tmp/openerp-web <<"EOF7"
#!/bin/sh

### BEGIN INIT INFO
# Provides: openerp-web
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenERP Web - the Web Client of the OpenERP
# Description: OpenERP is a complete ERP and CRM software.
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/openerp-web
NAME=openerp-web
DESC=openerp-web

# Specify the user name (Default: openerp).
USER="openerp"

# Specify an alternate config file (Default: /etc/openerp-web.cfg).
CONFIGFILE="/etc/openerp-web.cfg"

# 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
}

if [ -f /lib/lsb/init-functions ] || [ -f /etc/gentoo-release ] ; then

do_start() {
start-stop-daemon --start --quiet --pidfile $PIDFILE
--chuid $USER --background --make-pidfile
--exec $DAEMON -- $DAEMON_OPTS

RETVAL=$?
sleep 5 # wait for few seconds

return $RETVAL
}

do_stop() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo

RETVAL=$?
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile

return $RETVAL
}

do_restart() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo

sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile

start-stop-daemon --start --quiet --pidfile $PIDFILE
--chuid $USER --background --make-pidfile
--exec $DAEMON -- $DAEMON_OPTS

RETVAL=$?
sleep 5 # wait for few seconds

return $RETVAL
}

else

do_start() {
$DAEMON $DAEMON_OPTS > /dev/null 2>&1 &

RETVAL=$?
sleep 5 # wait for few seconds

echo $! > $PIDFILE # create pidfile

return $RETVAL
}

do_stop() {

pid=`cat $PIDFILE`
kill -15 $pid

RETVAL=$?
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile

return $RETVAL
}

do_restart() {

if [ -f $PIDFILE ]; then
do_stop
fi

do_start

return $?
}

fi

start_daemon() {

if [ -f $PIDFILE ]; then
echo "pidfile already exists: $PIDFILE"
exit 1
fi

echo -n "Starting $DESC: "

do_start

checkpid

if [ $? -eq 1 ]; then
rm -f $PIDFILE
echo "failed."
exit 1
fi

echo "done."
}

stop_daemon() {

checkpid

if [ $? -eq 1 ]; then
exit 0
fi

echo -n "Stopping $DESC: "

do_stop

if [ $? -eq 1 ]; then
echo "failed."
exit 1
fi

echo "done."
}

restart_daemon() {

echo -n "Reloading $DESC: "

do_restart

checkpid

if [ $? -eq 1 ]; then
rm -f $PIDFILE
echo "failed."
exit 1
fi

echo "done."
}

status_daemon() {

echo -n "Checking $DESC: "

checkpid

if [ $? -eq 1 ]; then
echo "stopped."
else
echo "running."
fi
}

case "$1" in
start) start_daemon ;;
stop) stop_daemon ;;
restart|force-reload) restart_daemon ;;
status) status_daemon ;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac

exit 0

EOF7

#sudo cp /usr/lib/python2.5/site-packages/openerp_web-5.0.1_0-py2.5.egg/scripts/openerp-web /etc/init.d/
sudo cp /tmp/openerp-web /etc/init.d/
sudo chmod +x /etc/init.d/openerp-web



cat > /tmp/openerp-web.cfg <<"EOF8"
[global]

# Some server parameters that you may want to tweak
server.socket_host = "0.0.0.0"
server.socket_port = 8080

# Sets the number of threads the server uses
server.thread_pool = 10

server.environment = "development"

# Simple code profiling
server.profile_on = False
server.profile_dir = "profile"

# if this is part of a larger site, you can set the path
# to the TurboGears instance here
#server.webpath = ""

# Set to True if you are deploying your App behind a proxy
# e.g. Apache using mod_proxy
#tools.proxy.on = True

# If your proxy does not add the X-Forwarded-Host header, set
# the following to the *public* host url.
#tools.proxy.base = 'mydomain.com'

# logging
#log.access_file = "/var/log/openerp-web/access.log"
#log.error_file = "/var/log/openerp-web/error.log"

# OpenERP Server
[openerp]
host = 'localhost'
port = '8070'
protocol = 'socket'

# Web client settings
[openerp-web]
# filter dblists based on url pattern?
# NONE: No Filter
# EXACT: Exact Hostname
# UNDERSCORE: Hostname_
# BOTH: Exact Hostname or Hostname_

dblist.filter = 'NONE'

# whether to show Databases button on Login screen or not
dbbutton.visible = True

# will be applied on company logo
company.url = ''

# options to limit data rows in M2M/O2M lists, will be overriden
# with limit="5", min_rows="5" attributes in the tree view definitions
child.listgrid.limit = 5
child.listgrid.min_rows = 5
EOF8


#sudo cp /usr/lib/python2.5/site-packages/openerp_web-5.0.1_0-py2.5.egg/config/default.cfg /etc/openerp-web.cfg
sudo cp /tmp/openerp-web.cfg /etc/openerp-web.cfg
sudo chown root.root /etc/openerp-web.cfg
sudo chmod 644 /etc/openerp-web.cfg

#OpenERP Web configuration:
# tools.proxy.on = True
#sudo sed -i "s/^#tools.proxy.on.*/tools.proxy.on = True/g" /etc/openerp-web.cfg


#Create /var/log/openerp-web.log with proper ownership:
sudo mkdir -p /var/log/openerp-web
sudo touch /var/log/openerp-web/access.log
sudo touch /var/log/openerp-web/error.log
sudo chown -R openerp.root /var/log/openerp-web/

echo "# DON'T PRESS ACCEPT/OK !!. Updating RC Services";
#Now run following command to start the OpenERP Web automatically on system startup (Debian/Ubuntu):
sudo update-rc.d openerp-server start 21 2 3 4 5 . stop 21 0 1 6 .
sudo update-rc.d openerp-web start 70 2 3 4 5 . stop 20 0 1 6 .

echo "Installation of OpenERP Completed.";
Ultima modifica: 9 Anni 1 Mese fa da davidedvn.
L\'Amministratore ha disattivato l\'accesso in scrittura al pubblico.
Tempo creazione pagina: 0.201 secondi

Odoo Italia Associazione - C.F: 94200470485 - Sede: Viale dei Cadorna, 83 - Firenze - Italy

Protected by R Antispam