centos7新装服务器部署流程
1、设置时区rm -f /etc/localtimecp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime2、配置内网IP (如果是外网IP,linux要修改远程端口)3、配置自己的yum源yum install wgetrm -f /etc/yum.repos.d/*curl -o /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repocurl -o /etc/yum.repos.d/epel-7.repo https://mirrors.aliyun.com/repo/epel-7.repo如何需要最新版本的rpm包,请安装下面的仓库rpm -Uvh http://repo.webtatic.com/yum/el7/epel-release.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm4、关闭SELinuxsed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/configsetenforce 05、添加zabbix监控6、关闭防火墙和NMsystemctl stop firewalld.servicesystemctl disable firewalld.servicesystemctl stop NetworkManagersystemctl disable NetworkManager7、安装软件包yum install -y vim openssh-clients ntpdate man lrzsz net-tools8、时间同步任务echo "$((RANDOM%60)) $((RANDOM%24)) * * * /usr/sbin/ntpdate time1.aliyun.com" >> /var/spool/cron/root9、配置主机名vim /etc/hostname10、修改文件句柄数#临时修改,立刻生效ulimit -n 655350 #永久修改echo "* soft nofile 655360" >> /etc/security/limits.confecho "* hard nofile 655360" >> /etc/security/limits.conf11、可以禁用ipv6cat >> /etc/modprobe.d/ipv6.conf <<EOFalias net-pf-10 offalias ipv6 offEOF12、去除ssh远程DNS认证sed -i 's/#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_configsed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/g' /etc/ssh/sshd_configsystemctl restart sshd13、配置LDAP客户端yum install openldap-clients nss-pam-ldapd -yauthconfig --enablemkhomedir \--disableldaptls \--enablemd5 \--enableldap \--enableldapauth \--ldapserver=ldap://211.x.x.27:8389 \--ldapbasedn="dc=wzlinux,dc=com" \--enableshadow \--update14、安装python3(epel方式)yum install -y python36-setuptoolseasy_install-3.6 pip配置国内pip源
mkdir .pipcat >> .pip/pip.conf <<EOFtrusted-host =pypi.douban.comindex-url = http://pypi.douban.com/simpleEOF15、安装python3(rpm方式)安装yum源
yum install https://centos7.iuscommunity.org/ius-release.rpm -y可以安装的版本很多,我们这里安装python3.6
yum install -y python36u python36u-libs python36u-devel python36u-pip验证
# python3.6Python 3.6.5 (default, Apr 10 2018, 17:08:37) on linuxType "help", "copyright", "credits" or "license" for more information.>>> exit()>>> # pip3.6 -Vpip 9.0.1 from /usr/lib/python3.6/site-packages (python 3.6)配置国内pip源
mkdir .pipcat >> .pip/pip.conf <<EOFtrusted-host =pypi.douban.comindex-url = http://pypi.douban.com/simpleEOF
页:
[1]