Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 40247f4

Browse files
authored
Merge pull request #38 from jwrober/explore-setup
2018.01.17 Update
2 parents f6cb186 + b513eae commit 40247f4

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

i-u-b/install-dev.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ During [installation](install "Installing ERPNext") we remove the `sudo` rights
1414

1515
**NOTE:** For these steps we are going to assume you are installing a Stage environment called `eprnext-stg`. This will be the bench name and part of the site name. Remember that the site name needs to be a fully qualified domain name (such as `erpnext-stg.domain.com`) to work for name based resolution. This is why we set production with a fully qualified domain name.
1616

17+
**NOTE:** Recall that during [installation](install "Installing ERPNext") on RHEL/CentOS that the base bench is placed in `/home/root`. Make sure you are there before you run these commands. Otherwise for Debian based distributions you should be in `/home/erpnext`.
18+
1719
Now become the `erpnext` user to setup a new bench.
1820

1921
sudo su - erpnext

i-u-b/install.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ ERPNext can be installed on the following OS's:
5656

5757
For production and stage environments, the admin guide recommends Debian 8 because "it just works". For development environments where a nice user interface on the "server" is wanted then the admin guide recommends Ubuntu 16.04 "Desktop" edition or MacOS 10. Windows is another option for a development environment, however you cannot run the code on Windows so it makes development **a lot** harder.
5858

59-
**NOTE:** The admin guide recommends that all installation work is done with a `sudo` privileged user. During installation, we will create the required user to run ERPNext, however we will not install as that user.
59+
**NOTE:** The admin guide recommends that all installation work is done with a `sudo` privileged user. During installation, we will create the required user to run ERPNext. The ERPNext user will have eleveted privileges during installation and those rights will be removed at the end.
6060

61-
**NOTE:** These steps assume you are starting from a freshly installed server. Your mileage will vary if you are attempting to run these steps on an existing server. The easy install script is **opinionated** meaning it makes a large number of assumptions as to how you want to install the system. The admin guide recommends the using the install script because the Ansible playbooks used do a ton of work very fast saving you a lot of time. The assumptions made are fine for the vast majority of installs.
61+
**NOTE:** These steps assume you are starting from a freshly installed server. Your mileage will vary if you are attempting to run these steps on an existing server. The easy install script is very **opinionated** meaning it makes a large number of assumptions as to how you want to install the system. The admin guide recommends the using the install script because the Ansible playbooks used do a ton of work very fast saving you a lot of time. The assumptions made are fine for the vast majority of installs.
6262

6363
For Debian based distributions (Debian, Ubuntu) start by installing a collection of software dependencies. These steps assume you are running Debian 8 right after OS installation. If you are installing on a RHEL based distribution (CentOS), skip down a section.
6464

@@ -85,7 +85,6 @@ For Red Hat based distributions (CentOS) start by installing a collection of sof
8585
sudo yum install -y curl wget nginx net-tools python27 vim
8686

8787
# Add a limits file for ERPNext
88-
# Copy & Paste from sudo ... to EOF" into putty window
8988
sudo bash -c "cat <<EOF > /etc/security/limits.d/21-erpnext.conf
9089
# Limits file for ERPNext
9190
* soft nofile 1048576
@@ -96,7 +95,7 @@ For Red Hat based distributions (CentOS) start by installing a collection of sof
9695
# Restart the server
9796
sudo shutdown -r now
9897

99-
The install script installs NodeJS 6.x. We want the latest stable. For all operating systems, install `NodeJS` from their respective repositories:
98+
The install script installs NodeJS 6.x. We want the latest stable 8.x. For all operating systems, install `NodeJS` from their respective repositories:
10099

101100
# Debian/Ubuntu based - Get NodeJS from its own repository
102101
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
@@ -106,9 +105,9 @@ The install script installs NodeJS 6.x. We want the latest stable. For all oper
106105
curl -sL https://rpm.nodesource.com/setup_8.x | sudo -E bash -
107106
sudo yum install -y nodejs
108107

109-
Create the `erpnext` user. Run these commands:
108+
Create the `erpnext` user. The `sudo` group name on Debian based distributions is often `sudo` or `sudoers`. The `sudo` group on RHEL (CentOS) based distributions is often `wheel`. Run these commands:
110109

111-
# Create the user with the bash shell
110+
# Create the user with the bash shell and add to appropriate sudoers group
112111
sudo useradd -m erpnext -s /bin/bash
113112
sudo usermod -aG [sudo group name] erpnext
114113

@@ -151,8 +150,9 @@ Download and run the install script.
151150
# Confirm you can ping the site
152151
ping [site name].[domain]
153152

154-
# For RHEL/CentOS based installs, create a needed directory
153+
# For RHEL/CentOS based installs, create a needed directory & stop SELinux
155154
sudo install -m 755 -o erpnext -g erpnext -d /home/root
155+
sudo setenforce 0
156156

157157
# Install the software
158158
# You will be prompted for what you want the mysql root and erpnext admin passwords to be
@@ -168,19 +168,12 @@ Assuming that everything went great and there is no need for [troubleshooting](i
168168

169169
Frappe/ERPNext has been successfully installed!
170170

171-
There are some cleanup things for RHEL/CentOS. Due to an issue with Ansible not able to determine the `sudo` user, the `install.py` script will install `bench` and ERPNext into the `/home/root` directory. We leave `bench` there, but move ERPNext to where we want it.
171+
There are some cleanup things for RHEL/CentOS. Due to an issue with Ansible not able to determine the real `sudo` user, the `install.py` script defaults to the `root` user instead of our `erpnext` user. Due to this, everything is installed into the `/home/root` directory except for `npm` and some other `python` libraries. We leave everything and just fix a few things to make it work. From an administration standpoint, the administrator will do all work in the various Frappe bench directories in `/home/root` instead of in `/home/erpnext`.
172172

173-
# Exit from the erpnext user
174-
exit
175173
sudo rm /etc/profile.d/screen_wall.sh
176-
sudo cp -Rf /home/root/[bench name used at install] /home/erpnext
177-
sudo rm -Rf /home/root/[bench name used at install]
178-
sudo chmod -R 755 /home/erpnext
174+
cd /home
179175
sudo chown -R erpnext:erpnext /home/erpnext
180176

181-
# Become the erpnext user again
182-
sudo su - erpnext
183-
184177
Sometimes `install.py` leaves some files in the `bench` we created that we want to clean up. This step will also ensure you are running the latest code and all the NodeJS packages are up to date via `npm`.
185178

186179
cd [bench name used at install]
@@ -198,11 +191,11 @@ Lastly we need to check on a few things to ensure they are running and installed
198191

199192
# Confirm redis-server is running
200193
sudo netstat -tulpn | grep redis-server
201-
sudo redis-server -v
194+
sudo redis-server -v # Should be >= 3.2.x
202195

203196
# Confirm NodeJS and npm
204-
sudo node -v
205-
sudo npm -v
197+
sudo node -v # Should be >= 8.9.x
198+
sudo npm -v # Should be >= 5.6.x
206199

207200
# Confirm mysql/mariadb is running on port 3306
208201
sudo netstat -tulpn | grep mysql
@@ -219,8 +212,6 @@ Lastly we need to check on a few things to ensure they are running and installed
219212
# Confirm NodeJS is running on port 9000
220213
sudo netstat -tulpn | grep node
221214

222-
If any of the above items are not running, then you will need to troubleshoot the installation of that component.
223-
su
224-
At this point the `erpnext` user should be an non-sudoer user and you will have an empty production environment running. Next step is to run the [Setup Wizard](../setup/setup "Setup").<br /><br />
215+
If any of the above items are not running, then you will need to troubleshoot the installation of that component. At this point the `erpnext` user should be an non-sudoer user and you will have an empty production environment running. Next step is to run the [Setup Wizard](../setup/setup "Setup").<br /><br />
225216

226217
Home: [Table of Contents](../ "Table of Contents") | Previous: Next: [3.1.5 Software Packages Installed](software "Software Packages Installed") | Next: [3.2.1 Installation Troubleshooting](install-trouble "Installation Troubleshooting")

0 commit comments

Comments
 (0)