Setup ERPNext on Scopehosts Preconfigured ERPNext Installation

As Scopehosts Linux VPS comes with pre installed ERPNext Instance. You need to follow only few commands to configure your domain.
Below mentioned are few Commands you need to Run. Just Log in to your VPS with the root credentials provided via email

Login as bench user

[root@centos ~]# sudo su - bench

[bench@centos ~]# cd erpnext

Download ERPNext installation files from the remote git repository using the Bench.
[bench@centos ~]# bench get-app erpnext https://github.com/frappe/erpnext 

The below command will prompt you for the MySQL root password (Admin123). Provide the password which you have set for the MySQL root user earlier. It will also ask you to set a new password for the administrator account. You will need this password later to log into the administrator dashboard.
[bench@centos ~]# bench new-site erp.yourdomain.com 

Install ERPNext on your newly created site:
[bench@centos ~]# bench --site erp.yourdomain.com install-app erpnext 

ERPNext is installed on your server. You can start the application immediately to check if the application is started successfully:

[bench@centos ~]# bench start 

Setup Supervisor and Nginx

By default, the ERPNext application listens on port 8000, not to the standard HTTP port 80. Also, running the built in web server for production use is not recommended as we will be exposing the server to the world. Hence, you should use a production web server as reverse proxy such as Apache or Nginx. In this tutorial, we will use Nginx as a reverse proxy as it can be automatically configured using Bench. Bench can automatically generate and install the configuration according to the ERPNext setup.

Although we can start the application using the above command, the execution of ERPNext will stop as soon as you close the terminal. To overcome this issue, I recommend to use Supervisor which is very helpful in running the application continuously in a production environment. Supervisor is a process control system that enables you to monitor and control a number of processes on Linux operating systems. Once Supervisor is configured, it will automatically start the application at boot time as well as on failures. Bench can automatically configure Supervisor for the ERPNext application.

To Install Supervisor:
[bench@centos ~]# sudo yum -y install supervisor 

Start Supervisor and enable it to automatically start at boot time:
[bench@centos ~]# sudo systemctl start supervisord 
[bench@centos ~]# sudo systemctl enable supervisord 

Setup Bench for production use:
[bench@centos ~]# sudo bench setup production bench 

The above command may prompt you before replacing the existing Supervisor default configuration file with a new one. Choose y to proceed. Bench adds a number of processes to Supervisor configuration file. The above command will also ask you if you wish to replace the current Nginx configuration with a new one. Enter y to proceed. Once Bench has finished installing the configuration, provide other users to execute the files in your home directory of Bench user.

[bench@centos ~]# chmod o+x /opt/bench/ 

If you are running a firewall on your server, you will need to configure the firewall to set an exception for HTTP service. Allow Nginx reverse proxy to connect from outside the network.


[bench@centos ~]# sudo firewall-cmd --zone=public --permanent --add-service=http 
[bench@centos ~]# sudo firewall-cmd --reload 

You can now access the site on http://erp.example.com

You can check the status of the processes by running:
[bench@centos ~]# sudo supervisorctl status all 

To stop all of the ERPNext processes, use:

sudo supervisorctl stop all

To start all the ERPNext processes, use:

sudo supervisorctl start all

 

Setting Up SSL Using Let's Encrypt

Let's Encrypt provides free SSL certificates to the users. SSL can be installed manually or automatically through Bench. Bench can automatically install the Let's Encrypt client and obtain the certificates. Additionally, it automatically updates the Nginx configuration to use the certificates.

The domain name which you are using to obtain the certificates from the Let's Encrypt CA must be pointed towards the server. The client verifies the domain authority before issuing the certificates.

Enable DNS multi-tenancy for the ERPNext application.

[bench@centos ~]# bench config dns_multitenant on 

Run Bench to set up Let's Encrypt on your site:

[bench@centos ~]# sudo bench setup lets-encrypt erp.yourdomain.com 

During the execution of the script, the Let's Encrypt client will ask you to temporarily stop the Nginx web server. It will automatically install the required packages and Let's Encrypt client. The client will prompt for your email address. You will also need to accept the terms and conditions. Once the certificates have been generated, Bench will also generate the new configuration for Nginx which uses the SSL certificates. You will be asked before replacing the existing configuration. Bench also creates a crontab entry to automatically renew the certificates every month.

Finally, enable scheduler to automatically run the scheduled jobs:

[bench@centos ~]# bench enable-scheduler 

You should see:

Enabled for erp.example.com

Congratulations, you have a fully working ERPNext application installed on your New CentOS 7 server from Scopehosts.

  • 4 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Uyğun məqalələr

Increase PHP file Upload size in windows server 2008

The php.ini file is the default configuration file for running applications that require PHP. It...

Setup Basic POP3/IMAP Mail Server in Centos/RHEL

Setup Basic POP3/IMAP Mail Server in Centos/RHELSetting up a mail server can be quite...

How Do I access RDP

Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft, which provides a...

Update Time-Zone on OpenVZ VPS

OpenVZ will reflect the host server’s time by default, You can configure your VPS with custom...

Enable TUN/TAP in Solus VM

 TAP (as in network tap) simulates a link layer device and it operates with layer 2 packets such...