The OWASP Mobile Application Security Testing Guide (MASTG) is a free, comprehensive, open-source guide that provides a standardized methodology and roadmap for security testing of mobile applications. In this blog, we’ll delve into what MASTG is, its importance, and how it serves as an invaluable resource for developers, security testers, and professionals in the mobile app industry.
mastg

React and Node JS Setup In ubuntu

dastek logo

React/Front End Setup

  • The frontend part of the project needs to be the build version of the React files.
  • Upload the build/ folder to your server in a directory such as /var/www/nodeapp/frontend/.
  • Note: If you’re building the project locally on a Windows machine, you might encounter issues due to path formatting. To avoid this:

    • Upload all source files to the server and build them there. Once built, delete the source files, keeping only the build/ directory.

To build the React app, run:
npm run build

Node/Backend Setup

  1. Upload Backend Files:

     

    • For the Node.js backend, simply upload all the files as they are, including any necessary environment files.

       

  2. Update Backend Server:

Install PM2 to ensure the Node.js app runs continuously. You can install PM2 globally on the server:
npm install pm2 -g

Start your Node.js server using PM2:
pm2 start server.js –name nodeapp

To restart the server, use:
pm2 restart nodeapp

Apache Configuration

  • For proper routing of requests to both the frontend and backend, you’ll need to update the Apache configuration:

    Virtual Host Configuration:

    This will handle requests for both the frontend and backend.

    <VirtualHost *:80>

        ServerName yourdomain.com

        # Frontend (React build) setup
        DocumentRoot /var/www/nodeapp/frontend/build

        <Directory /var/www/nodeapp/frontend/build>

            Options -Indexes +FollowSymLinks
            AllowOverride All
            Require all granted

            # Serve files directly if they exist

            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} -s [OR]
            RewriteCond %{REQUEST_FILENAME} -l [OR]
            RewriteCond %{REQUEST_FILENAME} -d
            RewriteRule ^ – [L]

            # Otherwise, fallback to index.html (React Router)

            RewriteRule ^ /index.html [L]
        </Directory>

        # Backend API setup
        ProxyPass /api http://localhost:5000/api
        ProxyPassReverse /api http://localhost:5000/api

    </VirtualHost>

      • Explanation: 
        • DocumentRoot: Points to the build directory of the React frontend. 
        • RewriteRule: Ensures React Router works by redirecting all requests to index.html unless the file exists. 
        • ProxyPass and ProxyPassReverse: These proxy API requests to the Node.js backend running on localhost:5000. 

    Restart Apache:

    After modifying the Apache config, restart the Apache server to apply the changes:

    sudo systemctl restart apache2

Trust and Worth

Our Customers

We are having a diversified portfolio and serving customers in the domains namely Sports Management, Online Laundry System, Matrimonial, US Mortgage, EdTech and so on.

Would you like to start a project with us?

DAStek team would be happy to hear from you and would love to turn your ‘Imaginations to Reality’.