Cara Instalasi Odoo 8,9,10 Pada Server Ubuntu 16.04!

Script Instalasi Odoo 8,9,10 Pada Server Ubuntu 16.0

Instalasi Odoo 8,9,10 Pada Server Ubuntu 16.04

Sebelum memulai, pastikan kita sudah menset repository ubuntu ke server lokal seperti Kambing
UI, ITB, dll

Script Print Multi Record Dengan 1 Halaman
Script Print Multi Record Dengan 1 Halaman
1

2

3

4

5

6

7

8

9

10

11

sudo nano /etc/apt/sources.list

 

### COPAS ###

 

deb ftp://ftp.itb.ac.id/pub/ubuntu xenial main restricted universe multivers

deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-updates main restricted universe multivers

deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-security main restricted universe multivers

deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-backports main restricted universe multivers

deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-proposed main restricted universe multiverse

 

###

Ctrl+O & Enter untuk menyimpan dan akhiri dengan Ctrl+X. Lalu update repository dengan :

1 sudo apt-get update

Selanjutnya lakukan intruksi dibawah ini :

  1. Setting Language Server
1

2

3

4

5

locale

export LANGUAGE=en_US.UTF-8

export LC_ALL=en_US.UTF-8

locale-gen

sudo dpkg-reconfigure locales

  1. Membuat User Odoo Untuk Ubuntu
1

2

3

adduser odoo

usermod -a -G sudo odoo

su – odoo -s /bin/bash

  1. Install Database
1 sudo apt-get install postgresql
  1. Membuat User Odoo Untuk Postgres
1

2

3

sudo su postgres

createuser –createdb –username postgres –no-createrole –no-superuser –pwprompt odoo

exit

  1. Edit Config Postgres (md5/peer menjadi trust)
1

2

sudo nano /etc/postgresql/9.5/main/pg_hba.conf

sudo /etc/init.d/postgresql restart

  1. Install Library Odoo

1

sudo apt-get install node-less 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 wkhtmltopdf

  1. Download Source Odoo

Untuk versi Odoo silahkan disesuikan v8/v9/v10, pada tutorial ini saya menggunakan v8

1 wget https://nightly.odoo.com/8.0/nightly/src/odoo_8.0.20160101.tar.gz

Jika untuk development di local laptop / pc. Maka cukup sampai tahapan ini dengan path di home masing-masing. Lalu ikuti tutorial ini pada point 2

  1. Tentukan Path Source Odoo
1

2

3

4

5

6

7

8

9

cd /opt

sudo mkdir odoo

cd odoo

sudo tar xvf ~/odoo_8.0.20160101.tar.gz

sudo mv odoo-8.0-20160101/ odoo-server

cd odoo-server/openerp

sudo cp -R addons/ /opt/odoo/

cd ../..

sudo chown -R odoo: *

Untuk v10, ada tambahan intruksi :

1

2

sudo cp /opt/odoo/odoo-server/setup/odoo /opt/odoo/odoo-server/openerp-server

sudo chmod a+x /opt/odoo/odoo-server/openerp-server

  1. Membuat File Config Odoo
1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

cd /etc

sudo nano odoo-server.conf

 

 

### COPAS ###

 

[options]

 

admin_passwd = admin

csv_internal_sep = ,

reportgz = False

without_demo = False

import_partial =

pidfile = None

server_wide_modules = None

 

addons_path = /opt/odoo/addons/

 

xmlrpc = True

xmlrpc_interface =

xmlrpc_port = 8069

proxy_mode = False

xmlrpcs = True

xmlrpcs_interface =

xmlrpcs_port = 8071

 

secure_cert_file = server.cert

secure_pkey_file = server.pkey

 

netrpc = False

netrpc_interface =

netrpc_port = 8070

 

dbfilter = .*

 

static_http_enable = False

static_http_document_root = None

static_http_url_prefix = None

 

test_file = False

test_report_directory = False

test_enable = False

test_commit = False

 

 

logfile = /var/log/odoo/odoo-server.log

logrotate = True

syslog = False

 

log_handler = [‘:INFO’]

log_level = info

 

email_from = False

smtp_server = localhost

smtp_port = 25

smtp_ssl = False

smtp_user = False

smtp_password = False

 

db_name = False

db_user = odoo

db_password = odoo

 

pg_path = None

db_host = False

db_port = False

db_maxconn = 64

db_template = template1

 

translate_modules = [‘all’]

list_db = True

 

debug_mode = False

 

timezone = False

 

osv_memory_count_limit = False

osv_memory_age_limit = 1.0

max_cron_threads = 2

 

unaccent = False

 

workers = 0

 

limit_memory_soft = 671088640

limit_memory_hard = 805306368

limit_time_cpu = 60

limit_time_real = 120

limit_request = 8192

 

###

  1. Membuat Boot Script
1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

sudo nano /etc/init.d/odoo-server

 

 

### COPAS ###

 

#!/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: OpenERP Server

# Description: OpenERP is a complete ERP and CRM software.

### END INIT INFO

 

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin/

#DAEMON=/usr/local/bin/odoo-server

DAEMON=/usr/local/bin/odoo-server

NAME=odoo-server

DESC=odoo-server

# Specify the user name (Default: openerp).

USER=”odoo”

# Specify an alternate config file (Default: /etc/openerp-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 –update=all”

#DAEMON_OPTS=”-c $CONFIGFILE –init=all”

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

rm -f $PIDFILE

# wait for few seconds

# remove pidfile

return $RETVAL

}

do_restart() {

start-stop-daemon –stop –quiet –pidfile $PIDFILE –oknodo

sleep 2

rm -f $PIDFILE

# wait for few seconds

# 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

return $RETVAL

# create pidfile

}

do_stop() {

pid=`cat $PIDFILE`

kill -15 $pid

RETVAL=$?

sleep 2

rm -f $PIDFILE

# wait for few seconds

# 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

# vim: sts=4 st=4 et

 

###

  1. Pastikan Boot Script Dapat Dieksekusi
1 sudo chmod a+x /etc/init.d/odoo-server
  1. Membuat Daemon Script
1

2

3

4

5

6

7

8

9

10

cd /usr/local/bin

sudo nano odoo-server

 

### COPAS ###

 

#!/bin/sh

cd /opt/odoo/odoo-server

exec /usr/bin/python ./openerp-server $@

 

####

  1. Pastikan Daemon Script Dapat Dieksekusi
1 chmod a+x /usr/local/bin/odoo-server
  1. Membuat File Log
1

2

3

sudo mkdir /var/log/odoo

sudo touch /var/log/odoo/odoo-server.log

sudo chown -R odoo:odoo /var/log/odoo

  1. Jalankan Server
1 sudo /etc/init.d/odoo-server start
  1. Set Auto Restart
1 sudo update-rc.d odoo-server defaults
  1. Ganti Port 8069 to 8080
1

2

3

4

5

6

7

8

9

sudo gedit /etc/rc.local

 

### COPAS ###

 

iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069

 

###

 

sudo reboot

Selamat mencoba ….

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *