2.時(shí)間同步
[root@vps /]# crontab -l
01 01 * * * /usr/sbin/ntpdate cn.pool.ntp.org ;hwclock -w >> /dev/null 2>&1
hwclock -w 同步到硬件時(shí)鐘
3.查看80連接數(shù)
[root@vps /]# netstat -n|grep :80 | awk \\\’/^tcp/ { S[$NF]} END {for(a in S) print a, S[a]}\\\’
TIME_WAIT 2
CLOSE_WAIT 136
ESTABLISHED 3
4.鏡像問(wèn)題
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
解決辦法:編輯/etc/yum.repos.d/epel.repo,把基礎(chǔ)的恢復(fù),鏡像的地址注釋掉
#baseurl
mirrorlist
改成
baseurl
#mirrorlist
5.yum不能用,缺包
[root@Monitor lib]# yum install fping
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
libcurl.so.4: cannot open shared object file: No such file or directory
Please install a package which provides this module, or
verify that the module is installed correctly.
It\\\’s possible that the above module doesn\\\’t match the
current version of Python, which is:
2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
https://pkgs.org/centos-6/centos-x86_64/libcurl-7.19.7-52.el6.x86_64.rpm.html
libcurl-7.19.7-52.el6.x86_64.rpm
zlib-1.2.3-29.el6.x86_64.rpm
6.安裝圖形界面
yum -y groupinstall Desktop
yum -y groupinstall X Window System
yum -y groupinstall chinese-support
startx
7.java環(huán)境變量設(shè)置
[root@Monitor ~]#yum -y install java-1.7.0-openjdk*
[root@Monitor ~]# java -version
java version 1.7.0_111
OpenJDK Runtime Environment (rhel-2.6.7.2.el6_8-x86_64 u111-b01)
OpenJDK 64-Bit Server VM (build 24.111-b01, mixed mode)
[root@Monitor ~]#export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64
java環(huán)境變量設(shè)置http://blog.csdn.net/u010440155/article/details/51544282
8.tomcat java 內(nèi)存設(shè)置
catalina.sh :
JAVA_OPTS=\\\’-server -Xms10240m -Xmx10240m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:PermSize=128m -XX:MaxPermSize=128m\\\’
Xms: jvm啟動(dòng)內(nèi)存 默認(rèn)是物理內(nèi)存的1/64
Xmx:jvm運(yùn)行過(guò)程中分配的最大內(nèi)存
如果內(nèi)存剩余不到40%%uFF0CJVM就會(huì)增大堆到Xmx設(shè)置的值,內(nèi)存剩余超過(guò)70%%uFF0CJVM就會(huì)減小堆到Xms設(shè)置的值。
如果Xms超過(guò)了Xmx值,或者堆最大值和非堆最大值的總和超過(guò)了物理內(nèi)存或者操作系統(tǒng)的最大限制都會(huì)引起服務(wù)器啟動(dòng)不起來(lái)。
設(shè)置NewSize、MaxNewSize相等,new的大小最好不要大于old的一半,原因是old區(qū)如果不夠大會(huì)頻繁的觸發(fā)主 GC ,大大降低了性能
9.手動(dòng)釋放內(nèi)存
http://lizhenliang.blog.51cto.com/7876557/1657448
sync
echo 1 > /proc/sys/vm/drop_caches
drop_caches的值可以是0-3之間的數(shù)字,代表不同的含義:
0:不釋放(系統(tǒng)默認(rèn)值)
1:釋放頁(yè)緩存
2:釋放dentries和inodes
3:釋放所有緩存
10. linux詳細(xì)記錄用戶操作
http://369369.blog.51cto.com/319630/1732164
修改/etc/profile文件,在最后增加如下內(nèi)容:
#history
export HISTTIMEFORMAT=[%Y%m%d-%H%M-:%S]
USER_IP=`who -u am i 2>/dev/null| awk \\\'{print$NF}\\\’|sed -e \\\’s/[()]//g\\\’`
HISTDIR=/var/log/history
if [ -z $USER_IP ]
then
USER_IP=`hostname`
fi
if [ ! -d $HISTDIR ]
then
mkdir -p $HISTDIR
chmod 777 $HISTDIR
fi
if [ ! -d $HISTDIR/${LOGNAME} ]
then
mkdir -p $HISTDIR/${LOGNAME}
chmod 300 $HISTDIR/${LOGNAME}
fi
export HISTSIZE=1000
DT=`date %Y%m%d_%H%M%S`
export HISTFILE=$HISTDIR/${LOGNAME}/${USER_IP}.hist.$DT
chmod 600 $HISTDIR/${LOGNAME}/*.hist* 2>/dev/null
#history end
11. linux如何掛載windows下的共享目錄?
mount -t cifs -o username=windows登陸賬號(hào),password=windows賬號(hào)對(duì)應(yīng)的密碼//16.187.190.50/test /mnt/linux目標(biāo)文件夾
或者 muout.cifs //本機(jī)IP地址/test /mut/linux目標(biāo)文件夾 -o username=windows登陸賬號(hào),password=windows賬號(hào)對(duì)應(yīng)的密碼
更多關(guān)于云服務(wù)器,域名注冊(cè),虛擬主機(jī)的問(wèn)題,請(qǐng)?jiān)L問(wèn)三五互聯(lián)官網(wǎng):m.shinetop.cn