reset password

Set Up Centos 7 Server

Installation Selections

  • Software Selection: Minimal Install
  • KDump: disable
  • Security Policy: default

The Minimal Install includes OpenSSH and Postfix but no other server software (that I notice).

Additional Tools

> sudo yum -y install nmap mutt
> sudo yum -y groupinstall "Development Tools"

Auto Update

> sudo yum -y install yum-cron

Edit /etc/yum/yum-cron.conf so that

  • update_cmd = default
  • update_messages, download_updates, apply_updates = yes
  • emit_via = email
  • email_to = the admin user account

Set yum-cron service to auto-start and start it:

> sudo systemctl enable yum-cron
> sudo systemctl start yum-cron

Node.js and Global Packages 

> curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
> sudo yum -y install nodejs

Using sudo to install global package seems to be discouraged. The documentation recommends using a version manager, but I feel that changing NPM's default directory (the second option in the documentation) is better because it keeps the same command line syntax as on Windows, and it's one less tool to learn or use. So:

> mkdir ~/.npm-global
> npm config set prefix '~/.npm-global'

Edit .bash_profile so the PATH environment variable looks like the following:

PATH=$PATH:$HOME/.local/bin:$HOME/bin:$HOME/.npm-global/bin

then

> source ~/.profile

And install the following global packages

> npm install -g typescript ts-node eslint tslint express-generator nodemon @angular/cli

MongoDB

Create a file /etc/yum.repos.d/mongodb-org-3.6.repo as follows:

[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

then install MongoDB, set the MongoDB server to auto-start and start it:

> sudo yum install -y mongodb-org
> sudo systemctl enable mongod
> sudo systemctl start mongod

References

This page has been viewed 5316 times.