Configuring a Linux (RHEL/Rocky) VM with React-Bootstrap Packages

This is a guide for creating a VM with react-bootstrap.

 Instructions

The following commands should be run as root, until you switch to another user without sudo privileges.

  1. Make sure the VM is updated before moving forward. Run

    yum -y update
  2. When the update is complete, run

    reboot

To reload the machine.

  1. Install all the needed packages for the machine:

    yum -y install nc nmap whois net-tools rsync bind-utils strace tcpdump perl bash-completion curl wget tar lsof
  2. Secure your vm by running the next few commands

  3. Make sure to add port 3000 to your firewall before running your site

    Reload the firewall once successful

  4. Add a new user called www before installing the nodejs and react packages

  5. Make sure your new user you created above has a password. Run these commands as root to create the password

    Edit the PermitRootLogin to say no. Save and exit the file. Run:

    To restart the connection after making those edits.

  6. Make a directory for your webroot

  7. Change ownership for www using the following

  8. Login to the VM as the user you created above and continue the steps.

  9. Change into var/www/webroot before installing packages.

  10. Follow the instructions on https://nodejs.org/en/download/package-manager to install Node.js and react for Linux using NVM:
    Install NVM (Node version manager)

    Download and install node.js

    Verify the right node version (should print `v20.12.1`)

    Verify the right NPM version (should print `10.5.0`)

  11. Make sure you are in the webroot directory and run the next command to create your react app. Change my-react-app to the name of your app.

  12. Change directories into your react app and run

    To install the bootstrap package from https://react-bootstrap.github.io/docs/getting-started/introduction as well as installing react router for multi-page apps. Also installs the stylesheet language scss.

  13. Once everything is complete, run the next command to check that your app is ready.

    This will start the development mode for the app, which allows you to open your app on your browser. Search for the IP:3000 in your browser to find your app. The page should look like this:

    image-20240403-221657.png

Now you are ready to start editing.

 Related articles

Filter by label

There are no items with the selected labels at this time.

All information contained on this page and in this database is the confidential
and the intellectual property of OSSDS, LLC.
DO NOT DISCLOSE