一、安装基础环境
step 1 :
sudo passwd root
step 2 :
sudo vi /etc/ssh/sshd_config
step 3 :
port 22
step 4 :
PermitRootLogin yes
PasswordAuthentication yes
step 5:
sudo service ssh restart
-
设置账户
su - root
adduser frappe
usermod -aG sudo frappe
apt update && apt upgrade -y && shutdown -r now
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y python3.10-dev python3-setuptools python3-pip python3-distutils python3.10-venv software-properties-common mariadb-server mariadb-client redis-server nodejs xvfb libfontconfig wkhtmltopdf libmysqlclient-dev nginx cron vim git ttf-wqy-zenhei ttf-wqy-microhei
依赖较多,耐心安装。
sudo vi /etc/mysql/my.cnf
[mysqld]
character-set-client-handshake=FALSE
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
[mysql]
default-character-set=utf8mb4
sudo service mysql restart
sudo mysql_secure_installation
Enter current password for root (enter for none):
Switch to unix_socket authentication [Y/n]N
Change the root password? [Y/n]Y
New password:
新密码:
Re-enter new password:
Remove anonymous users? [Y/n]Y
Disallow root login remotely? [Y/n]N
Remove test database and access to it? [Y/n]N
Reload privilege tables now? [Y/n]Y
sudo npm install -g yarn
yarn configgetregistry
查看是否为官方源,返回
https://registry.yarnpkg.com 表明为官方源,需要切换为国内源,以下为切换国内源代码
yarn config set registry https://registry.npmmirror.com/ --global &&
yarn config set disturl https://npmmirror.com/package/dist --global &&
yarn config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass --global &&
yarn config set electron_mirror https://registry.npmmirror.com/binary.html?path=electron/ --global &&
yarn config set puppeteer_download_host https://registry.npmmirror.com/binary.html --global &&
yarn config set chromedriver_cdnurl https://cdn.npmmirror.com/binaries/chromedriver --global &&
yarn config set operadriver_cdnurl https://cdn.npmmirror.com/binaries/operadriver --global &&
yarn config set phantomjs_cdnurl https://cdn.npmmirror.com/binaries/phantomjs --global &&
yarn config set selenium_cdnurl https://cdn.npmmirror.com/binaries/selenium --global &&
yarn config set node_inspector_cdnurl https://cdn.npmmirror.com/binaries/node-inspector --global
npm set registry https://registry.npmmirror.com/ &&
npm set disturl https://npmmirror.com/package/dist &&
npm set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass &&
npm set electron_mirror https://registry.npmmirror.com/binary.html?path=electron/ &&
npm set puppeteer_download_host https://registry.npmmirror.com/binary.html &&
npm set chromedriver_cdnurl https://cdn.npmmirror.com/binaries/chromedriver &&
npm set operadriver_cdnurl https://cdn.npmmirror.com/binaries/operadriver &&
npm set phantomjs_cdnurl https://cdn.npmmirror.com/binaries/phantomjs &&
npm set selenium_cdnurl https://cdn.npmmirror.com/binaries/selenium &&
npm set node_inspector_cdnurl https://cdn.npmmirror.com/binaries/node-inspector
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
-
更改root账户镜像源
sudo pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
-
基础环境安装完成
node -v && npm -v && python3 -V && pip3 -V && yarn -v
sudo -H pip3 install frappe-bench
安装bench
WARNING: Running pip as the ‘root’ user can result in broken……
此警告可忽略
bench --version
bench init --frappe-branch version-14 frappe-bench --frappe-path=https://gitee.com/mirrors/frappe
rm -r frappe-bench
SUCCESS: Bench frappe-bench initialized
出现warn不要慌,正常现象,当提示success时,说明安装完全成功
四、安装新站点
sudo chmod -R o+rx /home/frappe/
cd frappe-bench
bench new-site demo
Updating Dashboard for frappe
demo: SystemSettings.enable_scheduler is UNSET
*** Scheduler is disabled ***
出现以上提示,说明站点创建完成
-
下载App
bench get-app https://gitee.com/phipsoft/payments
bench get-app --branch version-14 erpnext https://gitee.com/mirrors/erpnext
bench get-app https://gitee.com/qpchen888/hrms
下载hrms
-
安装App
bench --site demo install-app payments
bench --site demo install-app erpnext
MOST IMPORTANT
下面是重点中的重点
在安装hrms前,先启动bench,并在bench启动后,新建终端窗口,用安装用户登录,进入frappe-bench目录安装hrms,命令如下:
bench start
启动bench
cd frappe-bench
bench --site demo install-app hrms
Ctrl+C
sudo bench setup production frappe
bench doctor
Please make sure that Redis Queue runs @ redis://localhost:11000
出现这个,说明生产环境配置出现问题,重新配置即可
重新配置,运行上面的命令,出现覆盖提示,全部填y
—–Checking scheduler status—–
demo: SystemSettings.enable_scheduler is UNSET
Scheduler disabled for demo
demo: SystemSettings.enable_scheduler is UNSET
Scheduler inactive for demo
Workers online: 3
—–None Jobs—–
出现上面的提示,说明生产环境设置正确
sudo vi /etc/supervisor/supervisord.conf
[unix_http_server]
file=var/tmp/supervisord.sock
chmod=0700
chown={USERNAME}:{USERNAME}
sudo -A systemctl restart supervisor
七、安装常用App
bench get-app https://gitee.com/yuzelin/erpnext_chinese.git
bench --site demo install-app erpnext_chinese
bench get-app --branch version-14 https://gitee.com/yuzelin/erpnext_oob.git
bench --site demo install-app erpnext_oob
bench get-app https://gitee.com/yuzelin/zelin_permission.git
bench --site demo install-app zelin_permission
腾讯云留了镜像,有需要的可以私我
原文地址:https://blog.csdn.net/qq_34192631/article/details/129208401
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_49328.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!