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.
Make sure the VM is updated before moving forward. Run
yum -y update
When the update is complete, run
reboot
To reload the machine.
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
Secure your vm by running the next few commands
Make sure to add port 3000 to your firewall before running your site
Reload the firewall once successful
Add a new user called www before installing the nodejs and react packages
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.
Make a directory for your webroot
Change ownership for www using the following
Login to the VM as the user you created above and continue the steps.
Change into var/www/webroot before installing packages.
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`)
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.
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.
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:
Now you are ready to start editing.
Follow the directions on this page to load the remote VM into VSCode: Opening Remote Workspace in VSCode
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