天天看點

CentOS 初始環境配置

版權聲明:本文由董可倫首發于https://dongkelun.com,非商業轉載請注明作者及原創出處。商業轉載請聯系作者本人。 https://blog.csdn.net/dkl12/article/details/80232720

我的原創位址:

https://dongkelun.com/2018/04/05/centosInitialConf/

前言

這個是在大三實習的時候記錄在印象筆記裡的,當時學長給我的,現在稍加改動一下,記錄在這裡。

若剛裝完系統ping不通外網,如baidu.com,請參考:

http://dongkelun.com/2018/01/17/networkIsUnreachable/

1、添加域名解析

在/etc/resolv.conf添加:

nameserver 114.114.114.114
nameserver 8.8.8.8
nameserver 8.8.4.4           

然後執行

chattr +i /etc/resolv.conf           

2、配置epel源

在root使用者下執行下面指令:

rpm -ivh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum repolist           

3、安裝常用工具

yum install  openssh wget  vim  openssh-clients openssl gcc openssh-server  mysql-connector-odbc  mysql-connector-java -y           

4、配置最大檔案打開數

echo ulimit -n 65536 >> /etc/profile 
source /etc/profile    
ulimit -n    
vim /etc/security/limits.conf           

在檔案尾部添加如下代碼:

* soft nofile 65536
* hard nofile 65536           

重新開機系統,在任何使用者下檢視最大打開檔案數:ulimit -n 結果都是65536

5、關閉防火牆

systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service           

6、更新系統

yum update           

繼續閱讀