Centos安装
来源: https://discuss.frappe.io/t/installing-erpnext-on-centos-7-guide/15708/4
Centos 7: 3.10.0-693.17.1.el7.x86_64
Date: February 23th 2018.
There are other posts related and credits goes to them also:
- Basic Frappe Framework installation fails
- Installtion of erpnext on centos 6.5 - #3 by axatech01
- I use this guide to start with: How to install ERPNext on Centos7 – Comtronic Blog 25
This is what I did to accomplish:
0- Get the CentOs V7 or any but the DVD Core version: CentOS-7-x86_64-Minimal-1511.iso
Set up everything:
Language
Time
root Password
HardDisk
If network is not up and running:
nmtui (And modify as need it) service network restart (Restart service) Ping google.com (To test Internet connection)
1- Run the following command:
yum erase chrony -y && yum install vim ntp ntpdate telnet deltarpm wget open-vm-tools -y && systemctl enable ntpd && yum update -y && init 6
2- Disable CentOS 7 Firewall, modify the file /etc/sysconfig/selinux:
cat /etc/selinux/config | sed -e “s/SELINUX=enforcing/SELINUX=disabled/” > /etc/selinux/config2 mv -f /etc/selinux/config2 /etc/selinux/config rm -f /etc/sysconfig/selinux ln -s /etc/selinux/config /etc/sysconfig/selinux init 6
3- Create directory:
> mkdir /opt/erpnext
> cd /opt/erpnext
4- Execute command:
> wget https://raw.githubusercontent.com/axatec/MIS-ERPNEXT-ScriptInstall/master/setup_frappe.sh
6- Execute and replace the word THE-PASSWORD-FOR-THE-MYSQL-SERVER with a password:
bash setup_frappe.sh --setup-production --mysql-root-password THE-PASSWORD-FOR-THE-MYSQL-SERVER --verbose
7- Stop nginx file config:
service nginx stop
8- Modify nginx config file on /etc/nginx/nginx.conf, with the following values:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
tcp_nodelay on;
#keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
index index.html index.htm;
}
9- Then restart nginx service:
> service nginx start
10- Modify the default company from site1.local to “testcompany.com 4”:
> su frappe
> cd ~/frappe-bench
--->Drop existing site...(Mysql password will be required)
> bench drop-site site1.local
---->Create company demo site
**first create a demo site, this will be the default one
Create:
> bench new-site demo.testcompany.com
Assign port:
> bench set-nginx-port demo.testcompany.com 8080
---->Create company production test site
> bench new-site production.testcompany.com
Install ErpNext:
> bench --site production.testcompany.com install-app erpnext
Asign Port:
> bench set-nginx-port production.testcompany.com 80
----->Update configs
> sudo bench setup production frappe
…then, update repository:
> sudo bench update
…At the end:
> exit
11- Browse the production.testcompany.com 4 site on port 80 with the IP or URL (production.testcompany.com 4) set on host.
Hope everyone find this guide usefull. (Shares and Comments are welcome).