Server requirement & Installation guide

Adult CMS software xMember version 2.0
adentio9
Site Admin
Posts: 30
Joined: Tue Aug 11, 2015 7:12 am

Server requirement & Installation guide

Postby adentio9 » Mon Aug 28, 2017 11:08 am

Server requirement

Install NodeJS >= 4.x.x ( https://nodejs.org/en/ )
Install MongoDB >= 3.2 and run service ( https://www.mongodb.com/download-center )
Install Redis >= 2.8 and run service ( https://redis.io/ )
Install bower in the global by command npm install bower -g
Install gulp in the global by command npm install gulp -g
Run npm install command
Run bower install command
Export environment by command export NODE_ENV=env (env is development or production)
Open server > config > environment (your environment).js file
Change base url, mongodb connection, redis, and mailer as image below

Image


Run project under development mode

Cd to project folder
Run gulp serve
Browser will be opened for development env

Run project under production mode

Cd to project folder
Export NODE_ENV and config under production environment
Run command gulp build
Now you will see a new dist folder, look like this

Image

Cd to dist folder
Run node server to start your project


Run project with nginx

Set up nginx ( https://nginx.org/en/ )
Install pm2 by command npm install pm2 -g ( https://github.com/Unitech/pm2 )
Cd to project folder
Run pm2 start server/index.js --name=your-app-name
Open nginx config file, usually it is /etc/nginx/sites-available/default
Within the server block you should have an existing location / block. Replace the contents of that block with the following configuration. If your application is set to listen on a different port, update the highlighted portion to the correct port number.

Code: Select all

. . .
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}


Restart nginx sudo systemctl restart nginx
Open browser and test with nginx port you set (usually 80)

Migrate, set up default data

Cd to project folder
Run npm run migrate
System will generate default admin account (admin@example.com / admin)

Import default data
Check default data file
Use mongodb import tool to import default data to your database ( https://docs.mongodb.com/manual/reference/program/mongoimport/ )

Return to “xMember V2”

Who is online

Users browsing this forum: No registered users and 1 guest