Toggle navigation

ParseServer Image Guide

Version 2.6.1

Websoft9 ParseServer is a pre-configured, ready to run image for running ParseServer on Alibaba Cloud.

ParseServer is the open source version of the Parse backend, and related projects.Parse Server is an open source version of the Parse backend that can be deployed to any infrastructure that can run Node.js.Parse Server works with the Express web application framework. It can be added to existing web applications, or run by itself.

Application Software(Parse-Server2.6.1,Parse-Dashboard1.1.0)
Parse Server project directory: /usr/lib/node_modules/parse-server
NPM Global node_modules directory: /usr/lib/node_modules
Parse-Server configuration file: /home/ubuntu/config/parse-server.json  //need configure it youselft
Parse-dashboard configuration file: /home/ubuntu/config/parse-dashboard.json //need configure it youselft
This stack have used the Nginx Reverse Proxy for visit the Parse-dashboard(The original url is http://IP:1337/parse)

Application Server(NodeJs4.8.4,PM2 2.6.1,Nginx1.10 )
Nginx Configuration Files: /etc/nginx/sites-available/default
PM2 is the  advanced, production process manager for Node.js.
PM2 is running automatic with system boot

Database(MongoDB2.6.10)
Mongodb directory: /var/lib/mongodb
Database Name for this Image: parse

After the installation of Image,please verify it

  • Login on Alibaba Cloud console,get you Internet IP Address
  • Open you Chrome or Firefox on your local PC,visit the http://Internet IP Address/
  • If verify successfully,you can enter the Start Installation page of this Image
  • If no response from browser,please check the Security Group settings to ensure that port 80 is been allowed

Using Chrome or Firefox to visit: http://Internet IP Address/ to start using this application.Following is the steps:

  1. Visit http://Internet IP Address  to enter the Login page
  2. Usename is “admin“,and the Password is ‘”admin” also.

  3. After the successful log in, you will see the interface below.You can mange your Apps and project now

Three usernames and passwords are required for application installation, application using, and application maintenance:

1、ParseServer:Username is admin and password is admin
2、MongoDB Database:No usename and password,you can set it by yourselft
3、Linux Server:Username is root,Password is set by yourself when buying.You can reset the password through console and restart the Server if you have forgotten it.Please Using the Putty for Remote and WinSCP for SFTP
Note:This Image have a new common OS account(aubuntu/ubuntu,it have sudo privileges),suggest you use this account to manage ParseServer and PM2

Routine backup (archives) of the database and application setup is essential to ensure failover is smooth.

Backup is based on the server snapshot automatic backup and manual local backup in two ways, both of which have their own advantages and disadvantages, it is recommended to use together

Automatic Backup by Snapshot of Server

IaaS provider have the “snapshot” function for Server, the snapshot is for the server disk. Snapshot tool can record the specified point in time the hard disk data, all backed up, and can achieve a key recovery.

If you have an automatic snapshot of the disk settings, the following scenes you can be more calm face:

  • Work a few days of the results, was mistakenly deleted
  • Hackers damage your site
  • The content has been messed up

Done a snapshot backup, a key to restore to the backup point of time state. That is, on-site reduction, very good function.

Different cloud vendor snapshot settings slightly different, specific reference:

Manual Backup

You can use Manual Backup as following steps:

  1. Download the entire software directory( /usr/lib/node_modules/) by SFTP or other tools
  2. Using the Putty to login, create a dump file using the mongodump tool
    ~# mongodump -h localhost -d parse -o /data

  3. Then download the  backup files from the directory /data/parse

Before upgrade you should put the site down for maintenance and always Backup your code, data and config files.

It is highly recommended to temporarily disable application before upgrading. Don’t forget to empty your browser cache if you experience weird bugs right after upgrading.

Note that you should upgrade to the latest version available, installing intermediate releases sequentially is not needed.

There no Upgrade solutions for Parse Server now

If you want use Domain for this application,you should complete below steps:

  • Domain resolution if you want to use (Add an A record to the Internet IP Address of Server from your Domain Control Panel)
  • Modiy the Apache configuration file: /etc/nginx/sites-available/default

    server {
    ...
            listen 80 default_server;
            server_name _;//add you domain here
    ...
    }
    
  • Restart the services

Using SFT to modify /home/ubuntu/config/parse-dashboard.json:

{
...
"users": [
    {
      "user":"admin", 
      "pass":"admin"
    }
  ]
}

 

 

Websoft9 ParseServer Image use the MongoDB for database,If you have not used MongoDB before, we highly recommend familiarizing yourself with it first before proceeding.

The Mongo requirements for Parse Server are:

  • MongoDB version 2.6.X
  • An SSL connection is recommended (but not required).

If this is your first time setting up a production MongoDB instance, we recommend using either mLab or ObjectRocket. These are database-as-a-service companies which provide fully managed MongoDB instances, and can help you scale up as needed.

When using MongoDB with your Parse app, you need to manage your indexes yourself. You will also need to size up your database as your data grows.

If you are planning to run MongoDB on your own infrastructure, we highly recommend using the RocksDB Storage Engine.

You can use the command to manage the services for Server.Please choose the corresponding command mode according to different types of operating system

Ubuntu Linux

Nginx Restart

~# systemctl restart nginx

MongoDB Restart

~# systemctl restart mongodb

When install new extension from back-end it will not successful,may be the permissions of file and folder is not appropriate,you should change it

Web site root permissions to follow:
file 644,folder 755 ,Permissions Users and groups ubuntu
If there is a file permissions problem, execute the following three commands:

chown -R ubuntu.ubuntu /usr/lib/node_modules/parse-server
find /usr/lib/node_modules/parse-server -type d -exec chmod 755 {} \;
find /usr/lib/node_modules/parse-server -type f -exec chmod 644 {} \;

Reference docs: https://github.com/parse-community/parse-server/blob/master/README.md

PM2 is the  advanced, production process manager for Node.js.Please use the  “ubuntu” account for manage/configure/debug the PM2,you can switch you account to “ubuntu” using the command “su – ubuntu ” when login as “root”

Pm2 Setting(use the  “ubuntu” account)
pm2 start parse-server –watch — /home/ubuntu/config/parse-server.json
pm2 start parse-dashboard –watch — –config /home/ubuntu/config/parse-dashboard.json –allowInsecureHTTP

Command of PM2:

#list all process
$pm2 status /pm2 list

Start an app using all CPUs available + set a name :
$ pm2 start app.js -i 0 –name “api”

Restart the previous app launched, by name :
$ pm2 restart api

Stop the app :
$ pm2 stop api

Restart the app that is stopped :
$ pm2 restart api

Remove the app from the process list :
$ pm2 delete api

Kill daemon pm2 :
$ pm2 kill

This document is original from Websoft9.In order to ensure the seriousness and usability of the documentation, no one may misappropriate or modify the second distribution. The need for friends reproduced please mark the source, otherwise we reserve the right to give legal action.

We will periodically update the documentation. Please visit the online documentation for the latest version

This document URL: http://en.websoft9.com/xdocs/parseserver-image-guide/
Support & Partnership: http://www.websoft9.com