2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-23 04:29:02 +00:00
bench/README.md

123 lines
5.3 KiB
Markdown
Raw Normal View History

2015-03-27 13:42:42 +00:00
Bench
2014-07-15 09:17:32 +00:00
=====
2016-04-26 07:43:46 +00:00
The bench allows you to setup Frappe / ERPNext apps on your local Linux (CentOS 6, Debian 7, Ubuntu, etc) machine or a production server. You can use the bench to serve multiple frappe sites. If you are using a DigitalOcean droplet or any other VPS / Dedicated Server, make sure it has >= 1Gb of ram or has swap setup properly.
2014-07-25 06:00:47 +00:00
2016-04-26 07:43:46 +00:00
To do this install, you must have basic information on how Linux works and should be able to use the command-line. If you are looking easier ways to get started and evaluate ERPNext, [download the Virtual Machine](https://erpnext.com/download) or take [a free trial on erpnext.com](https://erpnext.com/pricing).
2014-07-25 06:00:47 +00:00
2016-03-23 07:51:46 +00:00
If you have questions, please ask them on our [forum](https://discuss.erpnext.com/).
2014-07-15 09:17:32 +00:00
2014-07-15 05:48:04 +00:00
Installation
============
2016-08-01 05:44:01 +00:00
Easy Setup
----------
2016-04-26 07:43:46 +00:00
- This is an opinionated setup with logging and SE Linux. So, it is best to setup on a blank server.
2016-08-03 11:30:52 +00:00
- Works on Ubuntu 14.04 to 16.04, CentOS 7+, Debian 7 to 8 and MacOS X. If you find any problems, post them on our forum: [https://discuss.erpnext.com](https://discuss.erpnext.com)
2016-04-26 07:43:46 +00:00
- This script will install the pre-requisites, install bench and setup an ERPNext site
2016-07-22 10:13:15 +00:00
- Passwords for Frappe Administrator and MariaDB (root) will be asked
- You can then login as **Administrator** with the Administrator password
2014-07-15 05:48:04 +00:00
2016-08-01 05:44:01 +00:00
Production vs Develop
---------------------
*Production* setup should be run on a new box and installs nginx and supervisor to manage the processes. *Develop* setup uses `honcho` to manage the processes and uses the built-in web server (`bench start`)
Steps
-----
2014-07-25 06:00:47 +00:00
Open your Terminal and enter:
2016-08-01 05:44:01 +00:00
# Linux:
2016-05-16 04:57:49 +00:00
2016-08-01 05:44:01 +00:00
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
2016-05-16 04:57:49 +00:00
2016-08-01 05:44:01 +00:00
# Mac OSX:
2016-06-28 08:44:24 +00:00
2016-08-01 05:44:01 +00:00
# install X Code (from App store)
# install HomeBrew (http://brew.sh/)
brew install python
brew install git
curl "https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py" -o install.py
# For development
sudo python install.py --develop
# For production
sudo python install.py --production
# If you're logged in as root, use --user flag to create a user and install using that user
sudo python install.py --develop --user frappe
2016-06-28 08:44:24 +00:00
2016-07-18 04:47:15 +00:00
For development, you have to explicitly start services by running `bench start`. This script requires Python2.7+ installed on your machine. You will have to manually create a new site (`bench new-site`) and get apps that you need (`bench get-app`, `bench install-app`).
2016-08-01 05:44:01 +00:00
For production, you will have a preinstalled site with ERPNext installed in it.
2016-07-18 04:47:15 +00:00
You need to run this with a user that is **not** `root`, but can `sudo`. If you don't have such a user, you can search the web for *How to add a new user in { your OS }* and *How to add an existing user to sudoers in { your OS }*.
2016-03-23 07:51:46 +00:00
2016-05-16 04:57:49 +00:00
On Mac OS X, you will have to create a group with the same name as *{ your User }*. On creating this group, you have to assign *{ your User }* to it. You can do this by going to "System preferences" -> "Users & Groups" -> "+" (as if you were adding new account) -> Under "New account" select "Group" -> Type in group name -> "Create group"
2016-03-23 07:51:46 +00:00
This script will:
- Install pre-requisites like git and ansible
- Shallow clones this bench repository under `/usr/local/frappe/bench-repo`
- Runs the Ansible playbook 'playbooks/develop/install.yml', which:
- Installs
- MariaDB and its config
- Redis
- NodeJS
- WKHTMLtoPDF with patched QT
- Initializes a new Bench at `~/frappe/frappe-bench` with `frappe` framework already installed under `apps`.
2016-08-01 05:44:01 +00:00
2016-07-18 04:47:15 +00:00
####Script Options:
```
--help
--verbose
--develop
--production
--site
--user
--bench-branch
--repo-url
```
2014-07-15 05:48:04 +00:00
2014-07-16 08:39:16 +00:00
Updating
========
To manually update the bench, run `bench update` to update all the apps, run
patches, build JS and CSS files and restart supervisor (if configured to).
You can also run the parts of the bench selectively.
`bench update --pull` will only pull changes in the apps
2014-07-16 08:41:50 +00:00
2014-07-16 08:39:16 +00:00
`bench update --patch` will only run database migrations in the apps
2014-07-16 08:41:50 +00:00
2014-07-16 08:39:16 +00:00
`bench update --build` will only build JS and CSS files for the bench
2014-07-16 08:41:50 +00:00
2014-07-16 08:39:16 +00:00
`bench update --bench` will only update the bench utility (this project)
2016-05-18 12:02:51 +00:00
`bench update --requirements` will only update dependencies (python packages) for the apps installed
2014-07-16 08:39:16 +00:00
2016-04-26 07:43:46 +00:00
Guides
=======
- [Configuring HTTPS](https://frappe.github.io/frappe/user/en/bench/guides/configuring-https.html)
2016-04-29 10:57:45 +00:00
- [Using Let's Encrypt to setup HTTPS](https://frappe.github.io/frappe/user/en/bench/guides/lets-encrypt-ssl-setup.html)
2016-04-26 07:43:46 +00:00
- [Diagnosing the Scheduler](https://frappe.github.io/frappe/user/en/bench/guides/diagnosing-the-scheduler.html)
- [Change Hostname](https://frappe.github.io/frappe/user/en/bench/guides/how-to-change-host-name-from-localhost.html)
- [Manual Setup](https://frappe.github.io/frappe/user/en/bench/guides/manual-setup.html)
- [Setup Production](https://frappe.github.io/frappe/user/en/bench/guides/setup-production.html)
- [Setup Multitenancy](https://frappe.github.io/frappe/user/en/bench/guides/setup-multitenancy.html)
- [Stopping Production](https://frappe.github.io/frappe/user/en/bench/guides/stop-production-and-start-development.html)
2014-07-16 08:39:16 +00:00
2014-07-21 11:18:41 +00:00
2016-04-26 07:43:46 +00:00
Resources
=======
2014-07-21 11:18:41 +00:00
2016-04-26 07:43:46 +00:00
- [Background Services](https://frappe.github.io/frappe/user/en/bench/resources/background-services.html)
- [Bench Commands Cheat Sheet](https://frappe.github.io/frappe/user/en/bench/resources/bench-commands-cheatsheet.html)
- [Bench Procfile](https://frappe.github.io/frappe/user/en/bench/resources/bench-procfile.html)