- 升级内核
https://www.tecmint.com/install-upgrade-kernel-version-in-centos-7/
https://www.howtoforge.com/tutorial/how-to-upgrade-kernel-in-centos-7-server/
- 配置 sshd
vim /etc/ssh/sshd_config
# 禁用root账户登录,非必要,但为了安全性,请配置
PermitRootLogin no
# 非严格的权限检查,一般用于非 root 登录
StrictModes yes
# 设置rsa证书登录
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
# 禁用密码登录
PasswordAuthentication no
# 允许登录的用户
AllowUsers root www
# 重启 sshd
service sshd restart
sshd selinux 的相关配置:https://blog.tinned-software.net/change-ssh-port-in-centos-with-selinux/
http://sharadchhetri.com/2014/10/15/centos-7-rhel-7-change-openssh-port-number-selinux-enabled/
客户端
ssh-keygen -t rsa
ssh-keygen -f /tmp/my_key
# 验证成功,会输出公钥
生成 RSA 4096 ,兼容 jenkins
jenkins 的 ssh-steps 插件对 OpenSSH 的私钥格式支持不佳
ssh-keygen -t rsa -b 4096 -m PEM
参考 ssh 证书登陆设置
- 配置短命令
alias ll="ls -lah --color=auto"
alias l="ls -lh --color=auto"
alias grep="grep --color=auto"
alias p="ps -aux|grep"
alias h="history|grep"
alias rm="rm -i"
- 安装
htop
,cpulimit
centos7 安装 htop
需要先安装 epel-release
yum -y install epel-release
yum -y install htop
yum -y install cpulimit
https://www.jianshu.com/p/5629e331f58d
- 安装 extundelete
linux 数据恢复 centos 下数据恢复 ext3grep extundelete
- 安装
jdk 1.8
yum -y install java-1.8.0-openjdk*
java -version
- 设置
java
环境变量
vim /etc/profile
请留意,JAVA_HOME
需要自己留意版本号和路径。
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
修改后,使其生效
source /etc/profile
- 记录操作记录
####################Setting for history################
history
USER=`whoami`
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
if [ "$USER_IP" = "" ]; then
USER_IP=`hostname`
fi
if [ ! -d /var/log/history ]; then
mkdir /var/log/history
chmod 777 /var/log/history
fi
if [ ! -d /var/log/history/${LOGNAME} ]; then
mkdir /var/log/history/${LOGNAME}
chmod 300 /var/log/history/${LOGNAME}
fi
export HISTSIZE=4096
DT=`date +"%Y%m%d_%H:%M:%S"`
export HISTFILE="/var/log/history/${LOGNAME}/${USER}@${USER_IP}_$DT"
chmod 600 /var/log/history/${LOGNAME}/*history* 2>/dev/null
######
- 下载解压 tomcat,喜欢其他版本的,可以在这里找一找 tomcat archive。
cd ~
mkdir software
cd software
wget http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.46/bin/apache-tomcat-8.0.46.tar.gz
tar -zxvf apache-tomcat-8.0.46.tar.gz
- 安装 nginx,可以直接查看官方 Install Nginx,如果不想修改文件,可以执行下述命令,来自 How To Install Nginx on CentOS 7。
yum install -y epel-release
yum install -y nginx
# 加入到服务
systemctl start nginx
ps: 如果用非 root 启动 nginx,频繁提示
Permission denied
, 可以命令行执行setenforce 0
,可能是selinux
的问题。 Nginx的Permission denied错误
server {
listen 80;
server_name example.com;
root /var/www/html;
index index.html index.htm;
}
- 安装 g++
yum install -y gcc-c++
- jenkins
how-to-install-and-configure-jenkins-on-centos-6-4
一步一步用jenkins,ansible,supervisor打造一个web构建发布系统
- node
rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
yum -y install nodejs npm --enablerepo=epel
参考文档