Sebagai paitnei iesmi 0penERP, ABS0FT seiing uiminta oleh paia klien untuk menginstalkan Seivei 0penERP ui seivei meieka. Sistem 0peiasi yang selama ini uigunakan aualah 0buntu Seivei veisi 1u.u4 LTS. Pioses instalasi Seivei 0penERP sebenainya begitu susah. Namun jika kita mencaii uan membaca beibagai liteiatui yang membahas mengenai bagaimana caia menginstal 0penERP ui inteinet, kita menjaui kesulitan untuk mencaii caia mana yang paling baik. Sebab banyak sekali caia yang uapat uilakukan untuk menginstal 0penERP. 0leh kaiena umumnya seivei 0penERP akan uihubungkan atau uapat uiakses melalui jaiingan inteinet, maka Seivei 0penERP haius uapat memenuhi bebeiapa kiiteiia sebagai beiikut: Baius bisa uiakses melalui layanan enkiipsi (SSL) ketika kita mengaksesnya baik melalui uTK client, Web biowsei, WebBAv maupun CalBAv; Baius uapat selalu uiupgiaue uan uikustomisasi. !"#$#%&#'#&(#)#&*#+,&"#-.+,&(/"#0&'#+&12'#%&2+02$&1/+,.+30#-&4"/+567&3/)8/)9& Caia pintas untuk menginstal 0penERP aualah uengan menggunakan peiintah sudo apt-get install openerp-server. Namun caia teisebut tiuak kami saiankan sebab banyak sekali kelemahan yang uiantaianya aualah: Paket 0penERP yang teiseuia ui iepositoiy 0buntu suuah usang kaiena jaiang sekali uiupuate. }ika tiuak salah, veisi teiakhii yang akan aua ui iepositoiy itu aualah veisi S.u.16. Pauahal veisi teibaiu 0penERP yang teiseuia saat ini aualah veisi 6.u.2 yang banyak menganuung peibaikan uaii veisi-veisi sebelumnya, teiutama seii S.x. Piogiam aplikasi bisnis 0penERP banyak membeiikan pilihan konfiguiasi. Bal ini akan menyulitkan kita untuk menentukan caia teitentu aualah caia teibaik. Penting uiketahui bahwa 0penERP uikembangkan oleh komunitas. Naka setiap saat piogiam ini banyak mengalami peiubahan uan peibaikan. Tentu hal ini menjaui sangat penting bagi kita untuk mengetahui secaia jelas caia mana yang kita gunakan untuk menginstalnya. Bengan uemikian, kita akan muuah jika uikuemuuian haii kita akan mengapuate atau mengupgiauenya. Neskipun caia yang akan kita lakukan ui bawah ini aualah caia manual, tapi caia ini kami anggap sebagai caia yang teibaik kaiena kita akan tahu secaia iinci mengenai hal apapun yang hubungannya uengan instalasi 0penERP. Langkah 1. Membengun Server OpenERP 0ntuk menjauikan Seivei 0buntu sebagai seivei 0penERP, installah sistem ubuntu uasai saja. Kita tiuak peilu menginstal apapun kecuali openssh agai kita bisa meiemot seivei uaii komputei lain. Buatlah sebuah usei yang tiuak menggunakan kata-kata yang aua hubungannya uengan kata-kata sepeiti 'ioot', 'aumin', 'auministiatoi'. Tapi gunakanlah nama lain yang beihubungan uengan nama openeip, misalnya usei 'openeip'. Sebelum menginstal apapun, sebaiknya upuate uulu seivei yang baiu uiinstal uengan upuate yang uiambil uaii iepositoiy teiuekat. Nisalnya iepositoiy kambing ui uengan caia sbb: $ sudo nano /etc/apt/sources.list Lalu masukkan koue ini: deb http://kambing.ui.ac.id/ubuntu/ lucid-backports main restricted universe multiverse deb http://kambing.ui.ac.id/ubuntu/ lucid-proposed main restricted universe multiverse deb http://kambing.ui.ac.id/ubuntu/ lucid-security main restricted universe multiverse deb http://kambing.ui.ac.id/ubuntu/ lucid-updates main restricted universe multiverse deb http://kambing.ui.ac.id/ubuntu/ lucid main restricted universe multiverse
S Langkah 2. Proteksi Server dari serangan penjahat 0ntuk menghinuaii seiangan biutal yang uatang uaii jaiingan inteinet, sebaiknya kita install piogiam penangkal seiangan sepeiti piogiam uenyhosts. Kita semua tahu bahwa SSB aualah caia teibaik untuk meiemot auministiasi seivei. Namun SSB bisa menjaui masalah jika teijaui seiangan yang beitubi-tubi (!"#$%&'(")%&*$$*)+,) yang uatang uaii inteinet. Langkah peitama untuk menghinuaii seiangan aualah uengan meiubah poit stanuai SSB yaitu poit 22 uiganti uengan poit lain. uanti uengan poit uiatas 2uuuu suuah cukup baik untuk menguiangi iesiko ini. 0ntuk mengganti poit 22, euit file beiikut: $ sudo nano /etc/ssh/sshd_config Selain mengganti poit, kita juga bisa menggunakan piogiam sepeiti '/+*%:303; Benyhosts aualah paket piogiam yang uibuat uengan sciipt python untuk melinuungi seivei uaii seiangan via ssh. 0ntuk mengetahui lebih jauh mengenai Benyhosts, silakan baca ui http:uenyhosts.souicefoige.net. Benyhosts sangat iueal untuk melakukan pemblokkan secaia uinamis teihauap akses SSB maupun seivice lainnya yang atuiannya uisimpan ui file /etc/hosts.deny anu hosts.allow. Piogiam ini secaia otomatis membuat uaftai host atau ip auuiess yang mengakses seivei. Konfiguiasi uenyhosts aua ui file /etc/denyhosts.conf. Sebelum menginstal BenyBosts, pastikan kita mempunyai piogiam python: $ sudo python -V }ika belum punya, install uulu python uengan peiintah beiikut: $ sudo apt-get install python2.6 Lalu: $ sudo apt-get install denyhosts PERHATIAN! JANGAN MENGINSTAL DENYHOSTS JIKA ANDA SEDANG TERHUBUNG KE SERVER VIA SSH, SEBAB KONEKSI KE SERVER AKAN PUTUS. LAKUKAN DI LOKAL. }ika uenyhosts suuah teiinstal, euit konfiguiasinya: $ sudo nano /etc/denyhosts.conf Isi asli uaii file konfiguiasi ini aualah sepeiti ini: ############ THESE SETTINGS ARE REQUIRED ############
######################################################################## # # SECURE_LOG: the log file that contains sshd logging info # if you are not sure, grep "sshd:" /var/log/* # # The file to process can be overridden with the --file command line # argument # # Redhat or Fedora Core: #SECURE_LOG = /var/log/secure # # Mandrake, FreeBSD or OpenBSD: #SECURE_LOG = /var/log/auth.log # # SuSE: #SECURE_LOG = /var/log/messages # # Mac OS X (v10.4 or greater - # also refer to: http://www.denyhosts.net/faq.html#macos #SECURE_LOG = /private/var/log/asl.log # # Mac OS X (v10.3 or earlier):
######################################################################## # # HOSTS_DENY: the file which contains restricted host access information # # Most operating systems: HOSTS_DENY = /etc/hosts.deny # # Some BSD (FreeBSD) Unixes: #HOSTS_DENY = /etc/hosts.allow # # Another possibility (also see the next option): #HOSTS_DENY = /etc/hosts.evil #######################################################################
######################################################################## # # PURGE_DENY: removed HOSTS_DENY entries that are older than this time # when DenyHosts is invoked with the --purge flag # # format is: i[dhwmy] # Where 'i' is an integer (eg. 7) # 'm' = minutes # 'h' = hours # 'd' = days # 'w' = weeks # 'y' = years # # never purge: PURGE_DENY = # # purge entries older than 1 week #PURGE_DENY = 1w # # purge entries older than 5 days #PURGE_DENY = 5d #######################################################################
####################################################################### # # PURGE_THRESHOLD: defines the maximum times a host will be purged. # Once this value has been exceeded then this host will not be purged. # Setting this parameter to 0 (the default) disables this feature. # # default: a denied host can be purged/re-added indefinitely #PURGE_THRESHOLD = 0 # # a denied host will be purged at most 2 times. #PURGE_THRESHOLD = 2 # #######################################################################
####################################################################### # # BLOCK_SERVICE: the service name that should be blocked in HOSTS_DENY # # man 5 hosts_access for details # # eg. sshd: 127.0.0.1 # will block sshd logins from 127.0.0.1 # # To block all services for the offending host: #BLOCK_SERVICE = ALL # To block only sshd: BLOCK_SERVICE = sshd # To only record the offending host and nothing else (if using # an auxilary file to list the hosts). Refer to: # http://denyhosts.sourceforge.net/faq.html#aux #BLOCK_SERVICE = #
####################################################################### # # DENY_THRESHOLD_INVALID: block each host after the number of failed login # attempts has exceeded this value. This value applies to invalid # user login attempts (eg. non-existent user accounts) # DENY_THRESHOLD_INVALID = 5 # #######################################################################
####################################################################### # # DENY_THRESHOLD_VALID: block each host after the number of failed # login attempts has exceeded this value. This value applies to valid # user login attempts (eg. user accounts that exist in /etc/passwd) except # for the "root" user # DENY_THRESHOLD_VALID = 10 # #######################################################################
####################################################################### # # DENY_THRESHOLD_ROOT: block each host after the number of failed # login attempts has exceeded this value. This value applies to # "root" user login attempts only. # DENY_THRESHOLD_ROOT = 1 # #######################################################################
####################################################################### # # DENY_THRESHOLD_RESTRICTED: block each host after the number of failed # login attempts has exceeded this value. This value applies to # usernames that appear in the WORK_DIR/restricted-usernames file only. # DENY_THRESHOLD_RESTRICTED = 1 # #######################################################################
####################################################################### # # WORK_DIR: the path that DenyHosts will use for writing data to # (it will be created if it does not already exist). # # Note: it is recommended that you use an absolute pathname # for this value (eg. /home/foo/denyhosts/data) # WORK_DIR = /var/lib/denyhosts # #######################################################################
####################################################################### # # SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS # # SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES|NO # If set to YES, if a suspicious login attempt results from an allowed-host # then it is considered suspicious. If this is NO, then suspicious logins # from allowed-hosts will not be reported. All suspicious logins from # ip addresses that are not in allowed-hosts will always be reported. # SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES ######################################################################
8 # If set to YES, for each IP address that is reported by Denyhosts, # the corresponding hostname will be looked up and reported as well # (if available). # HOSTNAME_LOOKUP=YES # ######################################################################
###################################################################### # # LOCK_FILE # # LOCK_FILE=/path/denyhosts # If this file exists when DenyHosts is run, then DenyHosts will exit # immediately. Otherwise, this file will be created upon invocation # and deleted upon exit. This ensures that only one instance is # running at a time. # # Redhat/Fedora: #LOCK_FILE = /var/lock/subsys/denyhosts # # Debian LOCK_FILE = /var/run/denyhosts.pid # # Misc #LOCK_FILE = /tmp/denyhosts.lock # ######################################################################
############ THESE SETTINGS ARE OPTIONAL ############
####################################################################### # # ADMIN_EMAIL: if you would like to receive emails regarding newly # restricted hosts and suspicious logins, set this address to # match your email address. If you do not want to receive these reports # leave this field blank (or run with the --noemail option) # # Multiple email addresses can be delimited by a comma, eg: # ADMIN_EMAIL = foo@bar.com, bar@foo.com, etc@foobar.com # ADMIN_EMAIL = root@localhost # #######################################################################
####################################################################### # # SMTP_HOST and SMTP_PORT: if DenyHosts is configured to email # reports (see ADMIN_EMAIL) then these settings specify the # email server address (SMTP_HOST) and the server port (SMTP_PORT) # # SMTP_HOST = localhost SMTP_PORT = 25 # #######################################################################
####################################################################### # # SMTP_USERNAME and SMTP_PASSWORD: set these parameters if your # smtp email server requires authentication # #SMTP_USERNAME=foo #SMTP_PASSWORD=bar # ######################################################################
####################################################################### # # SMTP_FROM: you can specify the "From:" address in messages sent # from DenyHosts when it reports thwarted abuse attempts # SMTP_FROM = DenyHosts
####################################################################### # # SMTP_SUBJECT: you can specify the "Subject:" of messages sent # by DenyHosts when it reports thwarted abuse attempts SMTP_SUBJECT = DenyHosts Report # ######################################################################
###################################################################### # # SMTP_DATE_FORMAT: specifies the format used for the "Date:" header # when sending email messages. # # for possible values for this parameter refer to: man strftime # # the default: # #SMTP_DATE_FORMAT = %a, %d %b %Y %H:%M:%S %z # ######################################################################
###################################################################### # # SYSLOG_REPORT # # SYSLOG_REPORT=YES|NO # If set to yes, when denied hosts are recorded the report data # will be sent to syslog (syslog must be present on your system). # The default is: NO # #SYSLOG_REPORT=NO # #SYSLOG_REPORT=YES # ######################################################################
###################################################################### # # ALLOWED_HOSTS_HOSTNAME_LOOKUP # # ALLOWED_HOSTS_HOSTNAME_LOOKUP=YES|NO # If set to YES, for each entry in the WORK_DIR/allowed-hosts file, # the hostname will be looked up. If your versions of tcp_wrappers # and sshd sometimes log hostnames in addition to ip addresses # then you may wish to specify this option. # #ALLOWED_HOSTS_HOSTNAME_LOOKUP=NO # ######################################################################
###################################################################### # # AGE_RESET_VALID: Specifies the period of time between failed login # attempts that, when exceeded will result in the failed count for # this host to be reset to 0. This value applies to login attempts # to all valid users (those within /etc/passwd) with the # exception of root. If not defined, this count will never # be reset. # # See the comments in the PURGE_DENY section (above) # for details on specifying this value or for complete details # refer to: http://denyhosts.sourceforge.net/faq.html#timespec # AGE_RESET_VALID=5d # ######################################################################
###################################################################### # # AGE_RESET_ROOT: Specifies the period of time between failed login # attempts that, when exceeded will result in the failed count for # this host to be reset to 0. This value applies to all login # attempts to the "root" user account. If not defined,
1u # this count will never be reset. # # See the comments in the PURGE_DENY section (above) # for details on specifying this value or for complete details # refer to: http://denyhosts.sourceforge.net/faq.html#timespec # AGE_RESET_ROOT=25d # ######################################################################
###################################################################### # # AGE_RESET_RESTRICTED: Specifies the period of time between failed login # attempts that, when exceeded will result in the failed count for # this host to be reset to 0. This value applies to all login # attempts to entries found in the WORK_DIR/restricted-usernames file. # If not defined, the count will never be reset. # # See the comments in the PURGE_DENY section (above) # for details on specifying this value or for complete details # refer to: http://denyhosts.sourceforge.net/faq.html#timespec # AGE_RESET_RESTRICTED=25d # ######################################################################
###################################################################### # # AGE_RESET_INVALID: Specifies the period of time between failed login # attempts that, when exceeded will result in the failed count for # this host to be reset to 0. This value applies to login attempts # made to any invalid username (those that do not appear # in /etc/passwd). If not defined, count will never be reset. # # See the comments in the PURGE_DENY section (above) # for details on specifying this value or for complete details # refer to: http://denyhosts.sourceforge.net/faq.html#timespec # AGE_RESET_INVALID=10d # ######################################################################
###################################################################### # # RESET_ON_SUCCESS: If this parameter is set to "yes" then the # failed count for the respective ip address will be reset to 0 # if the login is successful. # # The default is RESET_ON_SUCCESS = no # #RESET_ON_SUCCESS = yes # #####################################################################
###################################################################### # # PLUGIN_DENY: If set, this value should point to an executable # program that will be invoked when a host is added to the # HOSTS_DENY file. This executable will be passed the host # that will be added as its only argument. # #PLUGIN_DENY=/usr/bin/true # ######################################################################
###################################################################### # # PLUGIN_PURGE: If set, this value should point to an executable # program that will be invoked when a host is removed from the # HOSTS_DENY file. This executable will be passed the host # that is to be purged as its only argument. #
###################################################################### # # USERDEF_FAILED_ENTRY_REGEX: if set, this value should contain # a regular expression that can be used to identify additional # hackers for your particular ssh configuration. This functionality # extends the built-in regular expressions that DenyHosts uses. # This parameter can be specified multiple times. # See this faq entry for more details: # http://denyhosts.sf.net/faq.html#userdef_regex # #USERDEF_FAILED_ENTRY_REGEX= # # ######################################################################
######### THESE SETTINGS ARE SPECIFIC TO DAEMON MODE ##########
####################################################################### # # DAEMON_LOG: when DenyHosts is run in daemon mode (--daemon flag) # this is the logfile that DenyHosts uses to report its status. # To disable logging, leave blank. (default is: /var/log/denyhosts) # DAEMON_LOG = /var/log/denyhosts # # disable logging: #DAEMON_LOG = # ######################################################################
####################################################################### # # DAEMON_LOG_TIME_FORMAT: when DenyHosts is run in daemon mode # (--daemon flag) this specifies the timestamp format of # the DAEMON_LOG messages (default is the ISO8061 format: # ie. 2005-07-22 10:38:01,745) # # for possible values for this parameter refer to: man strftime # # Jan 1 13:05:59 #DAEMON_LOG_TIME_FORMAT = %b %d %H:%M:%S # # Jan 1 01:05:59 #DAEMON_LOG_TIME_FORMAT = %b %d %I:%M:%S # ######################################################################
####################################################################### # # DAEMON_LOG_MESSAGE_FORMAT: when DenyHosts is run in daemon mode # (--daemon flag) this specifies the message format of each logged # entry. By default the following format is used: # # %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s # # Where the "%(asctime)s" portion is expanded to the format # defined by DAEMON_LOG_TIME_FORMAT # # This string is passed to python's logging.Formatter contstuctor. # For details on the possible format types please refer to: # http://docs.python.org/lib/node357.html # # This is the default: #DAEMON_LOG_MESSAGE_FORMAT = %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s # # ######################################################################
12
####################################################################### # # DAEMON_SLEEP: when DenyHosts is run in daemon mode (--daemon flag) # this is the amount of time DenyHosts will sleep between polling # the SECURE_LOG. See the comments in the PURGE_DENY section (above) # for details on specifying this value or for complete details # refer to: http://denyhosts.sourceforge.net/faq.html#timespec # # DAEMON_SLEEP = 30s # #######################################################################
####################################################################### # # DAEMON_PURGE: How often should DenyHosts, when run in daemon mode, # run the purge mechanism to expire old entries in HOSTS_DENY # This has no effect if PURGE_DENY is blank. # DAEMON_PURGE = 1h # #######################################################################
######### THESE SETTINGS ARE SPECIFIC TO ########## ######### DAEMON SYNCHRONIZATION ##########
####################################################################### # # Synchronization mode allows the DenyHosts daemon the ability # to periodically send and receive denied host data such that # DenyHosts daemons worldwide can automatically inform one # another regarding banned hosts. This mode is disabled by # default, you must uncomment SYNC_SERVER to enable this mode. # # for more information, please refer to: # http:/denyhosts.sourceforge.net/faq.html#sync # #######################################################################
####################################################################### # # SYNC_SERVER: The central server that communicates with DenyHost # daemons. Currently, denyhosts.net is the only available server # however, in the future, it may be possible for organizations to # install their own server for internal network synchronization # # To disable synchronization (the default), do nothing. # # To enable synchronization, you must uncomment the following line: #SYNC_SERVER = http://xmlrpc.denyhosts.net:9911 # #######################################################################
####################################################################### # # SYNC_INTERVAL: the interval of time to perform synchronizations if # SYNC_SERVER has been uncommented. The default is 1 hour. # #SYNC_INTERVAL = 1h # #######################################################################
####################################################################### # # SYNC_UPLOAD: allow your DenyHosts daemon to transmit hosts that have # been denied? This option only applies if SYNC_SERVER has # been uncommented. # The default is SYNC_UPLOAD = yes # #SYNC_UPLOAD = no
####################################################################### # # SYNC_DOWNLOAD: allow your DenyHosts daemon to receive hosts that have # been denied by others? This option only applies if SYNC_SERVER has # been uncommented. # The default is SYNC_DOWNLOAD = yes # #SYNC_DOWNLOAD = no #SYNC_DOWNLOAD = yes # # # #######################################################################
####################################################################### # # SYNC_DOWNLOAD_THRESHOLD: If SYNC_DOWNLOAD is enabled this parameter # filters the returned hosts to those that have been blocked this many # times by others. That is, if set to 1, then if a single DenyHosts # server has denied an ip address then you will receive the denied host. # # See also SYNC_DOWNLOAD_RESILIENCY # #SYNC_DOWNLOAD_THRESHOLD = 10 # # The default is SYNC_DOWNLOAD_THRESHOLD = 3 # #SYNC_DOWNLOAD_THRESHOLD = 3 # #######################################################################
####################################################################### # # SYNC_DOWNLOAD_RESILIENCY: If SYNC_DOWNLOAD is enabled then the # value specified for this option limits the downloaded data # to this resiliency period or greater. # # Resiliency is defined as the timespan between a hackers first known # attack and its most recent attack. Example: # # If the centralized denyhosts.net server records an attack at 2 PM # and then again at 5 PM, specifying a SYNC_DOWNLOAD_RESILIENCY = 4h # will not download this ip address. # # However, if the attacker is recorded again at 6:15 PM then the # ip address will be downloaded by your DenyHosts instance. # # This value is used in conjunction with the SYNC_DOWNLOAD_THRESHOLD # and only hosts that satisfy both values will be downloaded. # This value has no effect if SYNC_DOWNLOAD_THRESHOLD = 1 # # The default is SYNC_DOWNLOAD_RESILIENCY = 5h (5 hours) # # Only obtain hackers that have been at it for 2 days or more: #SYNC_DOWNLOAD_RESILIENCY = 2d # # Only obtain hackers that have been at it for 5 hours or more: #SYNC_DOWNLOAD_RESILIENCY = 5h # #######################################################################
}ika kita melakukan peiubahan ui file konfiguiasi ui atas, sebaiknya iestait Benyhosts: $ sudo /etc/init.d/denyhosts restart
14 0ntuk mengetahui apakah aua yang seuang beiusaha mengakses seivei, lihat saja ui file log: $ tail f /var/log/auth.log uan tekan kontiol+C untuk keluai. Kami saiankan Anua untuk melihat bebeiapa file beiikut: File log untuk melihat otentifikasi: $ sudo nano /var/log/auth.log Baftai ip yang tiuak uiijikan masuk: $ sudo nano /etc/hosts.deny Baftai semua ip yang bisa akses aua ui sini: $ sudo nano /etc/hosts.allow Langkah 3. Update Server Ubuntu 0puate seivei uengan peiintah: $ sudo apt-get update $ sudo apt-get dist-upgrade Neskipun ini tiuak uihaiuskan, namun sebaiknya kita iestait seivei sebelum kita melanjutkannya untuk menginstal 0penERP. Setelah Seivei 0buntu hiuup lagi, pastikan kita bisa login via ssh. uunakan peiintah beiikut: $ ssh l <nama-user> <ip-address-server> -p <port> }ika suuah masuk, sekaiang kita siap untuk melangkah ke tahap beiikutnya. Langkah 4. Buat user di ubuntu yang akan menjalankan program OpenERP Kita akan membuat usei uengan nama 'openeip'. Biiektoii home untuk usei openeip sebaiknya uibuat ui ualam foluei opt0pen0bject. 0leh kaiena sub uiiektoiy 0pen0bject belum aua, maka kita buat uulu. $ cd /opt $ sudo mkdir OpenObject $ cd OpenObject $ mkdir OpenERPv6 $ sudo adduser --system --home=/opt/OpenObject/OpenERPv6 --group openerp 0sei ini aualah usei sistem 0penERP. 0sei ini bukanlah nama seseoiang. 0ntuk uiketahui bahwa ualam Sistem 0buntu, sebuah usei uengan nomoi 0IB uibawah angka 1uuu tiuak memiliki akses ke akses ke shell (binfalse) uan tiuak bisa login sepeiti usei umumnya. Langkah 5. Instal dan konfigur server database PostgreSQL Ada banyak versi PostgreSQL yang dapat digunakan oleh OpenERP. Mulai dari versi 8.3, 8.4 dan terakhir 9.0. Kami sarankan Anda untuk menginstal versi 9.0 sebab versi ini dianggap versi yang tentunya lebih baik dari versi sebelumnya. Install python-softwaie-piopeities: $ sudo apt-get install python-software-properties Lalu tambahkan backpoits iepo uan upuate apt: $ sudo add-apt-repository ppa:pitti/postgresql $ sudo apt-get update $ sudo apt-get upgrade Lalu install postgiesql-9.u:
1S $ sudo apt-get install postgresql-9.0 libpq-dev $ The libpq-dev package is for compiling wrappers/clients against libpq. Konfiguiasi uefault PostgieSQL aua ui uiiektoii: /etc/postgresql/9.0/main Seuangkan uiiektoii uata aua ui: /var/lib/postgresql/9.0/main $ sudo passwd postgres Lalu ganti passwoiu untuk "usei postgies" uengan mengetik: $ psql -h localhost -U postgres -W template1 atau $ sudo su postgres -c psql template1 kemuuian ketik peiintah beiikut (<#+,#+&-2"#=&,#+0.&>"#33?:)'>&'/+,#+&"#33?:)'&*#+,&3/@/+#)+*#): $ ALTER USER postgres WITH PASSWORD 'password'; 0ntuk keluai uaii commanu winuows postgies, gunakan peiintah beiikut: $ \q Agai uatabase PostgieSQL uapat uiakses uaii jaiingan luai, maka peilu untuk mengeuit konfiguiasinya. Peitama kita euit uulu file postgiesql.conf: $ sudo nano /etc/postgresql/9.0/main/postgresql.conf Caii baiis ini: # Listen_addresses = 'localhost' s fgsdf sdfg sdfg sdfg sdfg sdfg sdfg sdfg sdfg sdfg sdfg lalu iubah menjaui: listen_addresses = '*' Kita juga haius iubah baiis ini: $ # Password_encryption = on menjaui: $ password_encryption = on Sekaiang kita euit file "pg_hba.conf" $ sudo nano /etc/postgresql/9.0/main/pg_hba.conf uan iubah bebeiapa baiis beiikut: # Database administrative login by UNIX sockets local all postgres ident
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only local all all ident # IPv4 remote connections: host all all 194.116.73.46/0 md5 # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 Konfiguiasi ui atas menggunakan NBS sebagai otentikasi usei postgies ketika mengakses seivei . }ika suuah, iestait seivei PostgieSQL: $ sudo /etc/init.d/postgresql restart
16 Beiikutnya kita haius membuat usei 0penERP ui uatabase postgies. 0ntuk membuat usei ui postgies, kita haius masuk sebagai usei postgies yang memiliki akses sebagai auministiatoi. $ sudo su - postgres Sekaiang kita haius buat usei uatabase yang mana usei ini aualah usei yang aua ui sistem PostgiesSQL, bukan usei 0buntu. Bengan usei ini, 0penERP akan memiliki akses untuk masuk ke ualam Seivei PostgieSQL untuk membuat uan menghapus uatabase. Pastikan Anua ingat setiap passwoiu uaii usei ini, kaiena akan membutuhkannya nanti. Nama usei yang akan kita buat aualah 'openeip' uengan passwoiu yang sama yaitu 'openeip' juga: $ createuser --createdb --username postgres --no-createrole --pwprompt openerp $ Enter password for new role: ******** $ Enter it again: ******** $ Shall the new role be a superuser? (y/n) y Kemuuian keluai uaii akun postgies: $ exit Langkah 6. Instal Library Python $ sudo apt-get install python python-psycopg2 python-reportlab python-egenix-mxdatetime python-tz python-pychart python-mako python-pydot python-lxml python-vobject python- yaml python-dateutil python-pychart python-pydot python-webdav Instal juga bebeiapa libiaiy beiikut yang akan uigunakan oleh 0penERP Web: $ sudo apt-get install python-cherrypy3 python-formencode python-pybabel python- simplejson python-pyparsing Langkah 7. Instal Server OpenERP dan Web client 0sahakan untuk selalu menginstal 0penERP veisi teibaiu. Saat ini veisi teibaiu aualah veisi 6.u.2. Biasanya kami menuownloaunya ke uiiektoiy home, ualam hal ini opt0pen0bject0penERPv6. 0ntuk memuuahkan ualam mengupuate veisi 0penERP lainnya, sebaiknya kita susun uulu uiiektoii untuk seivei, web uan auuons sebagai beiikut: /opt/OpenObject/OpenERPv6/server ! digunakan untuk server OpenERP /opt/OpenObject/OpenERPv6/web ! digunakan untuk web client OpenERP /opt/OpenObject/OpenERPv6/addons ! digunakan untuk addon OpenERP Kenapa haius uibuat uengan caia itu, sebab caia ini akan memuuahkan kita ualam pemelihaiaan veisi- veisi 0penERP. Coba peihatikan, jika kita memiliki 2 veisi seivei yaitu veisi 6.u.1 uan 6.u.2, maka susunan uiiektoii akan menjaui: /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.1/ /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/ Buat uengan caia beiikut: $ cd /opt/OpenObject/OpenERPv6 $ sudo mkdir server $ sudo mkdir web $ sudo mkdir addons Sekaiang uownloau uan extiact uulu seiveinya: $ cd server $ sudo wget server/http://www.openerp.com/download/stable/source/openerp-server- 6.0.2.tar.gz $ sudo tar xvf openerp-server-6.0.2.tar.gz Kemuuian uownloau web client: $ cd .. $ cd web $ wget http://www.openerp.com/download/stable/source/openerp-web-6.0.2.tar.gz $ sudo tar xvf openerp-web-6.0.2.tar.gz
17 Selain itu, untuk memuuahkan kita ualam memelihaia veisi-veisi 0penERP uan menghinuaii pengeuitan file-file konfiguiasi yang uisebabkan kaiena auanya peiubahan veisi, maka kita gunakan saja seemlink. Bimana seemlink untuk veisi seivei yang seuang jalan kita gunakan nama 'iunning_seivei' uan untuk web yang seuang jalan kita gunakan nama 'iunning_web'. uunakan peiintah beiikut untuk membuatnya: $ cd /opt/OpenObject/OpenERPv6/ $ sudo ln s server/openerp-server-6.0.2/ running_server $ sudo ln s server/openerp-web-6.0.2/ running_web Bengan uemikian maka stiuktui uiiektoiy akan menjaui: /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/ /opt/OpenObject/OpenERPv6/web/openerp-web-6.0.2/ /opt/OpenObject/OpenERPv6/running_server /opt/OpenObject/OpenERPv6/running_web Bimana isi uiiektoii /opt/OpenObject/OpenERPv6/running_server akan sama uengan isi uiiektoii /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/ }ika uikemuuian haii aua veisi baiu, maka yang peilu kita iubah hanyalah file seemlink iunning_seivei, iunning_web uan juga iunning_auuons. Khusus untuk auuons, kita akan bahas secaia teipisah paua langkah beiikut. Langkah 8. Download OpenERP addons Sebenainya, ketika kita menuownloau 0penERP seivei, uiualamnya suuah teiuapat auuons yang uitempatkan paua uiiektoiy bin yaitu: /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/bin/addons Namun kita tiuak akan menggunakan uiiektoii auuons yang aua ui seivei itu, sebab kita ingin memiliki kebebasan ualam mengelola auuons paua uiiektoii teipisah. 0leh kaiena auuons uikembangkan oleh komunitas, maka banyak sekali auuons uapat uitemukan ui inteinet. Namun uemikian auuons yang kita temukan ui inteinet belum tentu bisa uigunakan. }aui, beihati-hatilah ualam memilih auuons. Kami saiankan untuk menuownloau uan menggunakan auuons yang telah uiseitifikasi oleh peiusahaan pengembang 0penERP yaitu 0penERP s.a yang beilokasi ui Belgia. Neieka menempatkan auuons ui iepositoiy auuons yang beilokasi ui https:coue.launchpau.net~openeip. Bi halaman web https:coue.launchpau.net~openeip teisebut, aua bebeiapa uiiektoiy uimana kita bisa menuownloau auuons. Balam hal ini kami saiankan untuk menuownloau auuons uaii lokasi lp:openobject-auuons6.u. 0ntuk menuownloaunya kita haius menggunakan bazzai. Sebelum kita uapat menggunakan bazzai, kita haius instal uulu bazzai: $ sudo apt-get install bzr Setelah itu kita uownloau auuons yang aua ui lp:openobject-auuons6.u menggunakan peiintah: $ cd /opt/OpenObject/OpenERPv6/addons $ bzr branch lp:openobject-addons/6.0 lp_openobject-addons }ika pioses uownloau selesai maka akan aua uiiektoii baiu yaitu: /opt/OpenObject/OpenERPv6/addons/lp_openobject-addons Sekaiang kita suuah memiliki semua komponen yang uipeilukan, yaitu seivei, web uan auuons. Kini saatnya kita untuk menghubungkan semuanya agai menjaui sebuah system yang lengkap. Langkah 9. Membuat file konfigurasi Server OpenERP Aua bebeiapa caia untuk membuat file konfiguiasi 0penERP (openeip-seivei.conf) yaitu:
18 Ambil uaii contoh file konfiguiasi 0penERP Seivei uapat uitemukan ui lokasi opt0pen0bject0penERPv6seiveiuoc. Bengan menambahkan paiametei -s yang beiaiti save atau simpan konfiguiasi paua saat kita menjalankan 0penERP. File konfiguiasi ini biasanya uitempatkan ui uiiektoii etcopeneip-seivei.conf. 0leh kaiena itu jika kita ingin mengambil konfiguiasi uaii contoh, kita uapat menggunakan peiintah: $ sudo cp /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/doc/openerp-server.conf /etc $ cd /etc Atau jika menggunakan paiametei -s, caianya: $ cd /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/bin $ python openerp-server.py sc /tmp/openerp-server.conf $ cp /tmp/openerp-server.conf /etc/ $ cd /etc Sekaiang kita haius euit file teisebut untuk menentukan bebeiapa paiameteinya: $ cd /etc $ sudo nano openerp-server.conf Isinya akan sepeiti ini: [options]
Lalu simpan file teisebut uengan contiol X uan jawab uengan Y. Beiikut aualah uaftai paiametei lengkap uengan penjelasannya: Options: --version show program's version number and exit -h, --help show this help message and exit -c CONFIG, --config=CONFIG specify alternate config file -s, --save save configuration to ~/.openerp_serverrc --pidfile=PIDFILE file where the server pid will be stored -i INIT, --init=INIT init a module (use "all" for all modules) --without-demo=WITHOUT_DEMO load demo data for a module (use "all" for all modules) -u UPDATE, --update=UPDATE update a module (use "all" for all modules) --cache-timeout=CACHE_TIMEOUT set the timeout for the cache system -t TIMEZONE, --timezone=TIMEZONE specify reference timezone for the server (e.g. Europe/Brussels --stop-after-init stop the server after it initializes --debug enable debug mode --assert-exit-level=ASSERT_EXIT_LEVEL specify the level at which a failed assertion will stop the server. Accepted values: ['info', 'debug_rpc', 'warn', 'test', 'critical', 'debug_sql', 'error', 'debug', 'debug_rpc_answer', 'notset']
XML-RPC Configuration: --xmlrpc-interface=XMLRPC_INTERFACE specify the TCP IP address for the XML-RPC protocol --xmlrpc-port=XMLRPC_PORT specify the TCP port for the XML-RPC protocol --no-xmlrpc disable the XML-RPC protocol
XML-RPC Secure Configuration (disabled as ssl is unavailable): --xmlrpcs-interface=XMLRPCS_INTERFACE specify the TCP IP address for the XML-RPC Secure protocol --xmlrpcs-port=XMLRPCS_PORT specify the TCP port for the XML-RPC Secure protocol --no-xmlrpcs disable the XML-RPC Secure protocol --cert-file=SECURE_CERT_FILE specify the certificate file for the SSL connection --pkey-file=SECURE_PKEY_FILE specify the private key file for the SSL connection
NET-RPC Configuration: --netrpc-interface=NETRPC_INTERFACE specify the TCP IP address for the NETRPC protocol --netrpc-port=NETRPC_PORT specify the TCP port for the NETRPC protocol --no-netrpc disable the NETRPC protocol
Static HTTP service: --static-http-enable enable static HTTP service for serving plain HTML files --static-http-document-root=STATIC_HTTP_DOCUMENT_ROOT specify the directory containing your static HTML files (e.g '/var/www/') --static-http-url-prefix=STATIC_HTTP_URL_PREFIX
2u specify the URL root prefix where you want web browsers to access your static HTML files (e.g '/')
Testing Configuration: --test-file=TEST_FILE Launch a YML test file. --test-report-directory=TEST_REPORT_DIRECTORY If set, will save sample of all reports in this directory. --test-disable Disable loading test files. --test-commit Commit database changes performed by tests.
Logging Configuration: --logfile=LOGFILE file where the server log will be stored --no-logrotate do not rotate the logfile --syslog Send the log to the syslog server --log-level=LOG_LEVEL specify the level of the logging. Accepted values: ['info', 'debug_rpc', 'warn', 'test', 'critical', 'debug_sql', 'error', 'debug', 'debug_rpc_answer', 'notset']
SMTP Configuration: --email-from=EMAIL_FROM specify the SMTP email address for sending email --smtp=SMTP_SERVER specify the SMTP server for sending email --smtp-port=SMTP_PORT specify the SMTP port --smtp-ssl specify the SMTP server support SSL or not --smtp-user=SMTP_USER specify the SMTP username for sending email --smtp-password=SMTP_PASSWORD specify the SMTP password for sending email
Database related options: -d DB_NAME, --database=DB_NAME specify the database name -r DB_USER, --db_user=DB_USER specify the database user name -w DB_PASSWORD, --db_password=DB_PASSWORD specify the database password --pg_path=PG_PATH specify the pg executable path --db_host=DB_HOST specify the database host --db_port=DB_PORT specify the database port --db_maxconn=DB_MAXCONN specify the the maximum number of physical connections to posgresql -P IMPORT_PARTIAL, --import-partial=IMPORT_PARTIAL Use this for big data importation, if it crashes you will be able to continue at the current state. Provide a filename to store intermediate importation states.
Internationalisation options: Use these options to translate OpenERP to another language.See i18n section of the user manual. Option '-d' is mandatory.Option '-l' is mandatory in case of importation
--load-language=LOAD_LANGUAGE specifies the languages for the translations you want to be loaded -l LANGUAGE, --language=LANGUAGE specify the language of the translation file. Use it with --i18n-export or --i18n-import --i18n-export=TRANSLATE_OUT export all sentences to be translated to a CSV file, a PO file or a TGZ archive and exit --i18n-import=TRANSLATE_IN import a CSV or a PO file with translations and exit. The '-l' option is required. --i18n-overwrite overwrites existing translation terms on importing a CSV or a PO file. --modules=TRANSLATE_MODULES specify modules to export. Use in combination with --i18n-export --addons-path=ADDONS_PATH specify an alternative addons path.
21 --osv-memory-count-limit=OSV_MEMORY_COUNT_LIMIT Force a limit on the maximum number of records kept in the virtual osv_memory tables. The default is False, which means no count-based limit. --osv-memory-age-limit=OSV_MEMORY_AGE_LIMIT Force a limit on the maximum age of records kept in the virtual osv_memory tables. This is a decimal value expressed in hours, and the default is 1 hour.
Security-related options: --no-database-list disable the ability to return the list of databases Sekaiang kita coba untuk jalankan seivei: $ cd /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/bin $ python ./openerp-server.py c /etc/openerp-server.conf INFO:server:OpenERP version - 6.0.2 INFO:server:addons_path - /opt/OpenObject/OpenERPv6/addons/lp_openobject-addons INFO:server:database hostname - localhost INFO:server:database port - 5432 INFO:server:database user - openerp INFO:server:initialising distributed objects services DEBUG:psycopg2:installed. Logging using Python logging module DEBUG:web-services:Registered an exported service: db DEBUG:web-services:Registered an exported service: common DEBUG:web-services:Registered an exported service: object DEBUG:web-services:Registered an exported service: wizard DEBUG:web-services:Registered an exported service: report INFO:web-services:starting HTTP service at 0.0.0.0 port 8669 INFO:web-services:starting HTTPS service at 0.0.0.0 port 8671 INFO:web-services:Registered XML-RPC over HTTP INFO:web-services:starting NET-RPC service at 0.0.0.0 port 8670 INFO:server:Starting 3 services INFO:server:OpenERP server is running, waiting for connections... }ika tampilan sepeiti ui atas yang kita lihat, maka beiaiti seivei suuah bisa uijalankan tanpa masalah. Langkah 10. Menginstal boot script Agai 0penERP seivei selalu uijalankan ketika mesin baiu uihiuupkan (setelah booting), kita peilu membuat sciipt yang haius uitempatkan ui uiiektoii etcinit.u yang secaia otomatis akan menjalankan seivei 0penERP. $ sudo nano /etc/init.d/openerp-server Lalu isi file teisebut uengan sciipt beiikut: #!/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
# vim: sts=4 st=4 et }ika sciipt ini suuah uibuat, kita haius pastikan agai sciipt ini uapat uijalankan oleh usei ioot. $ sudo chmod 755 /etc/init.d/openerp-server $ sudo chown root: /etc/init.d/openerp-server Langkah 11. Membuat script daemon Biualam sciipt ui atas, kita melihat aua baiis peiintah: DAEMON=/usr/local/bin/openerp-server Aitinya, kita juga haius membuat sciipt uaemon teisebut: $ cd /usr/local/bin $ sudo nano openerp-server Lalu isi uengan sciipt beiikut: #!/bin/sh cd /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/bin exec /usr/bin/python ./openerp-server.py $@ Langkah 12. Membuat file log Bi ualam file konfiguiasi (etcopeneip-seivei.conf), teiuapat paiametei: logfile = /var/log/openerp/openerp-server.log Aitinya, semua aktifitas seivei akan uiiekam ui file log teisebut. Kita haius membuat file teisebut uan memastikan agai usei openeip uapat mengaksesnya: $ sudo mkdir /var/log/openerp $ sudo touch /var/log/openerp-server.log $ sudo chown R openerp:root /var/log/openerp Langkah 13. Uji kembali server 0ntuk menjalankan seivei, ketik peiintah beiikut: $ sudo /etc/init.d/openerp-server start }ika seivei beijalan uengan baik, maka sehaiusnya kita uapat melihat aktivitasnya paua file log.. $ less /var/log/openerp/openerp-server.log
2S }ika aua masalah uengan setingan seivei, maka kita uapat melihatnya ui log teisebut. }ika lancai, maka kita bisa mencobanya uengan mengakses uaii 0penERP Client yang aua ui PC iemote. }ika kita sekaiang memulai menjalankan piogiam uTK Client yang uiaiahkan ke seivei yang baiu saja uiinstall uan melihat pesan sepeiti ui bawah ini, maka itu aitinya bahwa seivei suuah jalan.
Ini beiaiti bahwa seivei meneiima koneksi namun seivei belum memiliki uatabase. Sekaiang kita juga haius coba apakah seivei 0penERP bisa uihentikan: $ sudo /etc/init.d/openerp-server stop Pastikan apakah seivei benai-benai beihenti. Kita uapat memeiiksanya uengan mencoba menghubungkan uaii uTK Client ke seivei, jika masih konek, beiaiti sciipt uaemon yang aua ui etcinit.uopeneip-seivei tiuak beijalan uengan sempuina. Langkah 14. Membuat Server OpenERP startup dan shutdown secara otomatis }ika semua langkah uiatas beihasil uijalankan, maka langkah teiakhii yang masih haius uikeijakan aualah membuat agai seivei 0penERP uapat secaia otomatis uijalankan oleh seivei 0buntu paua saat seivei 0buntu peitama kali booting. uunakan peiintah ini: $ sudo update-rc.d openerp-server defaults }ika peiintah ui atas suuah uijalankan, silakan coba untuk meiestait seivei uan setelah seivei hiuup kembali, cek apakah seivei 0penERP suuah jalan lagi apa belum. Kita juga bisa memeiiksa apakah seivei 0penERP suuah jalan atau belum uengan peiintah ini: $ ps aux | grep openerp Ban jika seivei 0penERP suuah jalan, maka sehaiusnya kita bisa melihat pesan sepeiti ini: $ openerp 708 3.8 5.8 181716 29668 ? Sl 21:05 0:00 python /opt/OpenObject/OpenERPv6/server/openerp-server-6.0.2/bin/openerp-server.py -c /etc/openerp-server.conf Yang aitinya bahwa seivei suuah jalan uengan usei 'openeip' uan PIB nomoi 7u8. Langkah 15. Mengkonfigurasi dan mengotomatiskan Web Client Neskipun kita menyebutnya Web Client, sebenainya piogiam 0penERP Web Client aualah sebuah piogiam aplikasi client bagi 0penERP seivei yang sekaligus menjaui Web Seivei bagi Web Biowsei yang uigunakan oleh Pengguna 0penERP. Sepeiti kita bahas ui atas, bahwa Web Client uitempatkan ui uiiektoii: /opt/OpenObject/OpenERPv6/web/openerp-web-6.0.2/
26 atau: /opt/OpenObject/OpenERPv6/running_web Keuua uiiektoii ui atas beiisi uata yang sama, sebab uiiektoii; /opt/OpenObject/OpenERPv6/running_web aualah seemlink uaii uiiektoii; /opt/OpenObject/OpenERPv6/web/openerp-web-6.0.2/ Sebelum kita uapat menjalankan 0penERP web client, kita haius membuat file konfiguiasi (openeip- web.conf) yang akan uitempatkan ui uiiektoii etc. $ sudo nano /etc/openerp-web.cfg Lalu isi file teisebut uengan sciipt sepeiti ini: [global]
[openerp-web] # filter dblists based on url pattern? # NONE: No Filter # EXACT: Exact Hostname # UNDERSCORE: Hostname_ # BOTH: Exact Hostname or Hostname_ dblist.filter = 'NONE' dbbutton.visible = True company.url = Lalu simpan uan atui sepeiti ini: $ sudo chown openerp:root /etc/openerp-web.cfg $ sudo chmod 640 /etc/openerp-web.cfg 0ntuk membuat file log, gunakan caia yang sama sepeiti membuat file log untuk 0penERP seivei yaitu: $ 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-access.log $ sudo chown R openerp:root /var/log/openerp/web-error.log Kita juga haius membuat web client boot sciipt. yang uitempatkan ui uiiektoii etcinit.u, uengan nama openeip-web uan buat pemiliknya aualah usei ioot uan uapat uiakses oleh usei ioot. $ cd /etc/init.d $ sudo nano openerp-web Lalu isi file teisebut uengan sciipt sepeiti ini: #!/bin/sh
27
### 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
# vim: sts=4 st=4 et Lalu: $ sudo chmod 755 /etc/init.d/openerp-web $ sudo chown root: /etc/init.d/openerp-web Sepeiti halnya 0penERP seivei, kita juga haius membuat sciipt uaemon sepeiti ini: $ cd /usr/local/bin $ sudo nano openerp-web Lalu isi uengan sciipt beiikut: $ #!/bin/sh $ cd /opt/OpenObject/OpenERPv6/web/openerp-web-6.0.2/ $ exec /usr/bin/python ./openerp-web.py -c /etc/openerp-web.cfg Sekaiang sehaiusnya kita suuah bisa menjalankan 0penERP web uengan menjalankan peiintah beiikut: $ sudo /etc/init.d/openerp-web start Peiiksa apakah piogiam 0penERP web suuah jalan apa belum. $ ps aux | grep openerp-web
Su }ika kita melihat sepeiti ini: openerp 1703 1.2 0.5 283044 11456 ? Sl May20 256:33 /usr/bin/python ./openerp-web.py -c /etc/openerp-web.cfg Naka beiaiti 0penERP web client suuah jalan. Anua bisa mencobanya uengan membuka website paua poit sepeiti ini: http://my-ip-or-domain:8080 Pastikan web client bisa uihentikan: $ sudo /etc/init.d/openerp-web stop Lalu buat agai 0penERP web client uapat jalan secaia otomatis. $ sudo update-rc.d openerp-web defaults Sekaiang kita bisa mencobanya uengan meiestait seivei uan peiiksa apakah 0penERP web uijalankan secaia otomatis. Bagian II. Mengkonfigurasi akses WebDAV/CalDAV Kita uapat menggunakan webseivei Apache yang akan beitinuak sebagai pioxy uan melakukan teiminasi SSL untuk akses web klien uan untuk akses WebBAv CalBAv. Begitu juga uengan uTK klien akan beijalan paua piotokol XNLRPC yang uienkiipsi langsung ke Seivei 0penERP. Apache aualah webseivei yang paling banyak uigunakan ui uunia uan uengan muuah kita uapat mencaii uokumentasinya. Langkah 1. Menginstal Apache dan modul-modul yang diperlukan Peitama kita instal uulu seivei apache uengan peiintah: $ sudo apt-get install apache2 Lalu kasih tahu apache, bahwa kita juga akan menginstal bebeiapa mouul yaitu: mou_ssl, mou_pioxy, mou_pioxy_http, mou_heaueis mou_iewiite |optionalj Yang mana mouul-mouul teisebut tiuak akan teiinstal hingga kita menginstalnya. $ sudo a2enmod ssl proxy_http headers rewrite Selanjutnya, kita haius membuat seitifikat uan key SSL . Langkah 2. Membuat sertifikat dan key Kami biasanya membuat seitifikat ini ui uiiektoii sementaia yang kemuuian meminuahkannya ketika suuah jaui: $ cd $ mkdir temp $ cd temp Lalu buat key uulu, kita akan uiminta untuk mengisi passwoiu atau passphiase uan konfiimasinya: $ openssl genrsa -des3 -out server.pkey 1024 Agai komputei tiuak teius-teiusan mita passwoiu atau passphiase, kita hapus passphiase teisebut uengan caia sepeiti ini:
S1 $ openssl rsa -in server.pkey -out server.key Selanjutnya kita peilu penyimpan uata yang akan teilihat ualam seitifikat: $ openssl req -new -key server.key -out server.csr Peiintah ini akan menampilkan bebeiapa peitanyaan yang haius kita jawab. Kita akan uiminta untuk memasukkan infoimasi yang akan uimasukkan ke ualam seitifikat. Sebaiknya kita lengkapi semua peitanyaan teisebut. Tapi kita juga bisa mengosongkannya uengan menjawabnya uengan titik '.'. $ Country Name (2 letter code) [ID]: ID $ State or Province Name (full name) [Some-State]: DKI Jakarta $ Locality Name (eg, city) []: Jakarta $ Organization Name (eg, company) [Internet Widgits Pty Ltd]: PT Alam Dewata Utama $ Organizational Unit Name (eg, section) []: ADSOFT OpenERP Partner $ Common Name (eg, YOUR name) []: Alle Aldine $ Email Address []: alle@openerp.co.id $ $ Please enter the following extra attributes $ to be sent with your certificate request $ A challenge password []: $ An optional company name []: Ban akhiinya kita self-sign seitifikat teisebut. $ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt Kita hanya peilu uua file saja yaitu seivei.cit uan seivei.key. Namun sebelum keuua file itu uapat kita gunakan, kita haius ganti uulu kepemilikannya. $ sudo chown openerp:root server.crt server.key $ sudo chmod 640 server.crt server.key Lalu pinuahkan keuua file teisebut ke uiiektoii etcsslopeneip: $ sudo mkdir /etc/ssl/openerp $ sudo chown openerp:root /etc/ssl/openerp $ sudo chmod 710 /etc/ssl/openerp $ sudo mv server.crt server.key /etc/ssl/openerp/ File key uan seitifikat suuah uisimpan ui tempat yang aman. Sekaiang kita haius beii tahu apache, ui mana lokasi keuua file teisebut. 0ntuk melakukannya, ikuti langkah beiikut. Langkah 3. Membuat file konfigurasi Apache Kita buat uulu file konfiguiasi viitual Bost untuk openeip. $ sudo nano /etc/apache2/sites-available/openerp-ssl Nasukkan sciipt beiikut: <VirtualHost *:443>
SSLEngine on SSLCertificateFile /etc/ssl/openerp/server.crt SSLCertificateKeyFile /etc/ssl/openerp/server.key
ProxyRequests Off
<Proxy *> Order deny,allow Allow from all </Proxy>
</VirtualHost> Sepeiti kita lihat paua sciipt ui atas, bahwa aua uua konfiguiasi Pioxy, uimana yang satu untuk webuav uan yang satunya untuk . Kalau kita tiuak beimaksuu untuk menggunakan fasilitas WebBAv uan CalBAv, kita juga uapat membuang bagian itu. Namun paua uasainya, kita ingin menyampaikan kepaua Apache bahwa akses WebBAv ke seivei 0penERP haius melalui poit XNLRPC yaitu 8u69, seuangkan untuk akses ke 0penERP Web haius melalui poit 8u8u. Pembeiian tanua uan webuav uimaksuukan agai jika penulisan auuiess tanpa webuav tiuak akan masuk ke WebBAv. Lalu kita uapat mengaktifkan konfiguiasi baiu teisebut. $ sudo a2ensite openerp-ssl Sebagai tambahan, kita juga uapat menggunakan mou_iewiite untuk me-ieuiiect jalui noimal (non- enciypteu) ke jalui yang uienkiipsi yaitu SSL poit (44S). 0ntuk melakukannya, kita haius menambahkan bebeiapa baiis beiikut (uitulis uiluai blok konfiguiasi <uiiectoiy>) paua file etcapache2sites-availableuefault RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R] Langkah 4. Merubah file konfigurasi OpenERP server dan web-client Langkah beiikut ini uimaksuukan untuk mengkonfiguiasi ulang 0penERP seivei uan Web client sehingga akses ke 0penERP melalui jalui noimal (jalui yang tiuak uienkiipsi) tiuak uapat uilakukan. Bi ualam file konfiguiasi etcopeneip-seivei.conf, keuua layanan tanpa enkiipsi hanya akan uijalankan secaia lokal (localhost) saja, sehingga koneksi hanya uapat uilakukan jika melalui Apache saja. Kita juga membeiitahu kepaua layanan XNLRPC-SSL, uimana mencaii file key uan file ceitificate yang uipeilukan. }alankan peiintah ini: $ sudo nano /etc/openerp-server.conf Lalu euit menjaui sepeiti ini: xmlrpc = True xmlrpc_interface = 127.0.0.1 xmlrpc_port = 8069
SS }ika uiinginkan untuk mengatui akses WebBAvCalBAv, tambahkan pula bebeiapa baiis beiikut ui bagian bawah file konfiguiasi. [webdav] enable = True vdir = webdav Kemuuian lakukan juga peiubahan paua file konfiguiasi web yaitu etcopeneip-web.conf agai hanya meneiima koneksi uaii lokal saja: $ sudo nano /etc/openerp-web.conf Lalu euit: # Some server parameters that you may want to tweak server.socket_host = 127.0.0.1!
# 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 = https://your-ip-or-domain
# Set to false to disable CSRF checks tools.csrf.on = False Langkah 5. Coba jalankan server Restait semua layanan untuk mengambil peiubahan konfiguiasi. $ sudo service openerp-server restart $ sudo service openerp-web restart $ sudo service apache2 restart Sehaiusnya kita mejaui tiuak bisa teihubung ke 0penERP jika menggunakan web biowsei paua poit 8u8u juga ketika menggunakan uTK client, kita sehaiusnya tiuak uapat mengaksesnya jika menggunakan layanan XNLRPC poit 8u69 maupun layanan NetRPC paua poit 8u7u. }aui untuk mengakses web, kita haius mengaksesnya menggunakan piotokol aman https:ip-atau- uomain uan jika akses uilakukan uaii uTK client, kita haius menggunakan poit 8u71 uan haius memilih piotokol XNLRPC (Secuie). 0ntuk mengakses CalBAv uapat uilakukan uengan caia sepeiti ini: https://your-ip-or-domain/webdav/DB_NAME/calendars/users/USERNAME/c/CALENDAR_NAME Nuuah-muuahan tutoiial ini beimanfaat. }ika aua kesalahan atau peitanyaan atau apapun sehubungan uengan tutoiial ini, silakan kiiim email ke saya: imanausoft.co.iu uengan subject: |INSTAL 0ERP 0N NACj Penulis, INAN S0LAINAN CE0 ABS0FT 0peneip Paitnei Inuonesia Citylofts Suuiiman 82u }l. Kh Nas Nansyui No 21 }akaita 1292u Inuonesia