These are the quick commands to install NVM, Nodejs, Yarn, Python3, Gcc, Nginx on Centos 7
1. NVM
sudo yum install curl nano -y
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install 16
2. Yarn
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
sudo yum install yarn -y
3. Python 3
If you want to install sqlite on Centos7, you will need python3 and gcc
sudo yum install -y python3
4. GCC
yum install gcc-c++ -y
yum install cmake -y
yum install centos-release-scl -y
yum install devtoolset-9 -y
scl enable devtoolset-9 bash
If you restart the shell, it will revert to GCC 4.8.5.
You can add source /opt/rh/devtoolset-9/enable
into you bashrc file to set GCC 9 as the default.
5. Nginx
sudo yum install -y epel-release
sudo yum install -y nginx
sudo systemctl start nginx
Config firewall
sudo yum install firewalld -y
sudo systemctl enable firewalld
sudo reboot
sudo firewall-cmd --state // check the firewall state
firewall-cmd --get-active-zones //check active zones
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo systemctl enable nginx
6. PostgreSQL
Download:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql15-server
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl start postgresql-15
sudo systemctl enable postgresql-15
Setup password for user postgres
sudo passwd postgres
Open port 5432 to connect database from remote:
nano /var/lib/pgsql/15/data/postgresql.conf
listen_addresses = '*'
port = 5432
Open firewall port:
firewall-cmd --zone=public --add-port=5432/tcp --permanent
firewall-cmd --reload
Open this file: nano /var/lib/pgsql/data/pg_hba.conf
and add this line to end of file:
host all all 0.0.0.0/0 md5
Restart postgres
sudo systemctl restart postgresql-15
7. Unzip
yum install -y unzip
Top comments (0)