Sengoli sa Lingoloa
Linuxtaelo ea pono ea tlhaiso-leseling ea sistimi
Sistimi】
uname -a
# Sheba lintlha tsa kernel/OS/CPU
head -n 1 /etc/issue
# Lekola mofuta oa sistimi e sebetsang
cat /proc/cpuinfo
# Sheba lintlha tsa CPU
hostname
#Sheba lebitso la komporo
lspci -tv
# Ngola lisebelisoa tsohle tsa PCI
lsusb -tv
# Ngola lisebelisoa tsohle tsa USB
lsmod
# Lethathamo la li-module tsa kernel tse kentsoeng
env
# Sheba maemo a fapaneng a tikoloho
【mohloli】
* Litokomane: https://help.ubuntu.com/
motso@ubuntu-512mb-sfo1-01:~# free -m
kakaretso e sebelisitsoeng mahala e arolelanoang li-buffers cached
Mem: 494 227 266 0 10 185
-/+ buffers/cache: 31 462
Phapang: 0 Botsa 0 0
motso @ ubuntu-512mb-sfo1-01: ~ # grep MemFree /proc/meminfo
MemFree: 272820 kB
free -m
# Sheba ts'ebeliso ea memori le ts'ebeliso ea phapanyetsano
df -h
# Sheba tšebeliso ea karolo e 'ngoe le e' ngoe
du -sh <目录名>
# Sheba boholo ba bukana e boletsoeng
find . -type f -size +100M
#Fumana lifaele tse fetang 100M
find . -type f -print |wc -l
# Bala palo ea lifaele tse bukeng ea hajoale
grep MemTotal /proc/meminfo
# Sheba palo eohle ea memori
grep MemFree /proc/meminfo
#Sheba palo ea memori ea mahala
uptime
#Sheba nako ea ho sebetsa ea sistimi, palo ea basebelisi, mojaro
cat /proc/loadavg
# Sheba boemo ba sistimi
【Disiki le dikarolo】
mount | column -t
# Sheba boemo ba karohano e khomaretsoeng
khoutu>fdisk -l
# Sheba likarolo tsohle
swapon -s
# Sheba likarolo tsohle tsa phapanyetsano
hdparm -i /dev/hda
# Sheba likarolo tsa disk (feela bakeng sa lisebelisoa tsa IDE)
dmesg | grep IDE
#Sheba boemo ba ho lemoha ha sesebelisoa sa IDE qalong
【netweke】
ifconfig
#Sheba thepa ea lihokelo tsohle tsa marang-rang
iptables -L
# Sheba litlhophiso tsa firewall
route -n
# Sheba tafole ea ho tsamaisa
netstat -lntp
# Sheba likou tsohle tse mamelang
netstat -antp
# Sheba likhokahano tsohle tse hlophisitsoeng
netstat -s
#Sheba lipalo-palo tsa marang-rang
【ts'ebetso】
cat /proc/sys/kernel/threads-max
Sheba palo e kholo ea likhoele tse lumelletsoeng ke sistimi
cat /proc/sys/kernel/pid_max
Sheba palo e kholo ea lits'ebetso tse lumelletsoeng ke sistimi
ps -ef
# sheba lits'ebetso tsohle
top
# Bontša boemo ba ts'ebetso ka nako ea 'nete
ll /proc/PID/fd/
#Haeba ts'ebetso e nka CPU e ngata haholo, etsa bonnete ba hore u sebelisa taelo ll /proc/PID/fd/ ho e fumana, haeba u sa e fumane, e fumane makhetlo a 'maloa.
【mosebelisi】
w
# Sheba basebelisi ba sebetsang
id <用户名>
# Sheba lintlha tsa mosebelisi tse boletsoeng
last
# Sheba lethathamo la ho kena ha basebelisi
cut -d: -f1 /etc/passwd
# Sheba basebelisi bohle ba sistimi
cut -d: -f1 /etc/group
# Sheba lihlopha tsohle tsa sistimi
crontab -l
#Sheba mesebetsi e hlophisitsoeng ea mosebelisi oa hajoale
【Sebeletsa】
chkconfig --list
# Ngola lits'ebeletso tsohle tsa sistimi
chkconfig --list | grep on
# Ngola lits'ebeletso tsohle tse qalileng tsa sistimi
##【CentOS Potso ea mofuta oa litšebeletso]
Taelo ea potso ea mofuta oa tšebeletso ea CentOS:
1. Sheba mofuta oa Linux Kernel
uname -r
2. Sheba mofuta oa CentOS
cat /etc/redhat-release
3. Sheba mofuta oa PHP
php -v
4. Sheba MySQL tlhahiso
mysql -v
5. Sheba mofuta oa Apache
rpm -qa httpd
6. Sheba lintlha tsa hona joale tsa CPU
cat /proc/cpuinfo
7. Sheba maqhubu a hona joale a cpu
cat /proc/cpuinfo | grep MHz
【lenaneo】
rpm -qa
# sheba tsohle tse kentsoeng软件Package
# Restart taelo bakeng sa lits'ebeletso tse tloaelehileng
service memcached restart
service monit restart
service mysqld restart
service mysql restart
service httpd restart
monit start all
service nginx restart
# qala hape CWP
service cwpsrv restart
# qala hape ka memcached
service memcached restart
service memcached start
service memcached stop
# boot qala memcached
chkconfig memcached on
Qala hape httpd ho etsa hore khoutu e sebetse taelo:
service httpd restart
service httpd start
service httpd stop
chkconfig httpd on
kenya hape httpd taelo:
service httpd force-reload
service httpd reload
Nginx restart taelo:
/etc/init.d/nginxd restart
service nginxd force-reload
service nginxd reload
service nginxd restart
php-fpm restart taelo:
/etc/init.d/php-fpm restart
service php-fpm restart
service php-fpm start
Kenya php-fpm hape:
sudo yum reinstall php-fpm
service mysql restart
service mysqld restart
service mysql stop
service mysqld stop
service mysql start
service mysqld start
Sebelisa taelo e latelang ho bona ts'ebeliso ea memori le ho sebetsana le boemo ba tšebeliso ea memori:
free -m
ps -eo pmem,pcpu,rss,vsize,args | sort -k 1 -r | less
MySQL_upgrade e fana ka litaelo tse latelang ho hlahloba le ho lokisa litafole le ho ntlafatsa litafole tsa sistimi:
mysqlcheck --all-databases --check-upgrade --auto-repair
Koala taelo ea MySQL:
killall mysqld
Sheba ts'ebetso ea mysql:
ps -ef|grep mysqld
watch -n 1 "ps -ef | grep mysql"
pid-file=/var/lib/mysql/centos-cwl.pid
Tsela ea faele ea PID ea MYSQL, KLOXO-MR e ka bonoa ka "process" ea "control panel":
pid-file=/var/lib/mysql/centos-512mb-sfo1-01.pid
pid-file=/var/lib/mysql/xxxx.pid
kapa taelo ea SSH "ps -ef" ho bona lits'ebetso tsohle:
check process apache with pidfile /usr/local/apache/logs/httpd.pid
check process mysql with pidfile /var/run/mysqld/mysqld.pid
O ka eketsa mohala ona ho /etc/crontab ho qala taelo motsotso o mong le o mong ho lekola boemo ba mysql:
* * * * * /sbin/service mysql status || service mysql start
【Mote taelo】
monit standard qala, emisa, qala hape litaelo:
/etc/init.d/monit start
/etc/init.d/monit stop
/etc/init.d/monit restart
shebellaTlhokomeliso:
Kaha monit e behiloe joalo ka ts'ebetso ea daemon, 'me litlhophiso tse qalang ka sistimi li eketsoa ho inittab, haeba ts'ebetso ea monit e emisa, ts'ebetso ea init e tla e qala hape, ebe e lekola lits'ebeletso tse ling, ho bolelang hore monit monitors Ts'ebeletso ha e khonehe. Ho emisoa ho sebelisa mokhoa o tloaelehileng, hobane hang ha e emisitsoe, monit e tla qala hape.
Ho emisa ts'ebeletso e shebiloeng ke monit, taelo e kang monit stop name e lokela ho sebelisoa, mohlala ho emisa tomcat:
monit stop tomcat
Ho emisa lits'ebeletso tsohle tse shebiloeng ka tšebeliso ea monit:
monit stop all
Ho qala ts'ebeletso u ka sebelisa taelo ea monit stop name,
Ho qala tsohle ke:
monit start all
Beha monit ho qala ka sistimi ebe o e eketsa qetellong ea faele ea /etc/inittab
# Matha monit ka maemo a tloaelehileng a ho matha
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc
Tlosa monit:
yum remove monit
【Khoasolla le ho decompress】
下载 wordpress Mofuta oa morao-rao
wget http://zh.wordpress.org/latest-zh_CN.tar.gz
unzip
tar zxvf latest-zh_CN.tar.gz
Tsamaisa lifaele tse foldareng ea wordpress (tsela e felletseng) ho ea sebakeng sa hajoale sa directory
mv wordpress/* .
Tsamaisa directory ea /cgi-bin bukeng ea hajoale
$mv wwwroot/cgi-bin .
Kopitsa lifaele tsohle tse bukeng ea hona joale bukeng e fetileng
cp -rpf -f * ../
U ka emisa / qala bocha / qala ts'ebeletso ea redis joang?
Haeba u kentse redis ka apt-get kapa yum install, u ka emisa / qala / qala redis ka ho toba ka litaelo tse latelang.
/etc/init.d/redis-server stop
/etc/init.d/redis-server start
/etc/init.d/redis-server restart
/etc/init.d/redis restart
Haeba o kentse redis ho tsoa khoutu ea mohloli, o ka qala redis hape ka taelo ea ho koala ea redis client program redis-cli:
redis-cli -h 127.0.0.1 -p 6379 shutdown
Haeba ha ho le e 'ngoe ea mekhoa e kaholimo e atlehileng ho emisa redis, o ka sebelisa sebetsa sa mantlha:
kill -9
[Sheba taelo ea sebaka sa faele]
Bona moo faele ea tlhophiso ea PHP e behiloeng teng:
Sebelisa phpinfo ho bona hore haeba mosebetsi o thibetsoe, o phethe tlas'a khetla
php -v / -name php.ini
或者
find / -name php.ini
Ka kakaretso, ha linux e kentsoe hanyane, wget e ke ke ea kenngoa ka ho sa feleng.
yum kenya
yum -y install wget
Ntlafatso ea sistimi e ntse e sebetsa 'me yum e notletsoe.
O ka qobella ts'ebetso ea yum ho koala:
rm -f /var/run/yum.pid
E batla perl...Perl ha e so fumanehe ho sistimi ea hau: Ka kopo kenya perl 'me u leke again
Ho hlakile hore perl e hloka ho kengoa.Taelo ea ho kenya perl ke e latelang:
yum -y install perl perl*
[Litaelo tsa SSH bakeng sa phanele ea taolo ea Kloxo-MR]
Ha o kenya tema kapa plugin, e hloleha ka "Ha e khone ho theha directory"
Tharollo: fetola hape litumello tsa plugin ea sehlooho sa wp le foldara ea ho kenya
Bakeng sa ts'ireletso ea seva, tumello ea 777 e ke ke ea fuoa bohle, ha feela li-directory tsena li fuoa tumello ea 755, ke mong'a eona feela ea nang le tumello ea ho ngola.
Haeba u tsamaisa taelo e latelang:
sh /script/fix-chownchmod
Kloxo-MR e tla leka ho ntlafatsa botho le tumello ho lifaele le li-directory ho motso oa litokomane tsa sebaka seo
Kloxo-MR Control Panel: Eya ho "admin> Server> (localhost)> IP Address> Reread IP".
Ntlafatso ea seva
Ntlafatsa seva ho mofuta oa moraorao
yum -y update
Mokhoa o ka holimo o lekiloe hangata, empa bothata bo ntse bo le teng, ka kopo kenya taelo e latelang ea tokiso:
yum clean all; yum update -y; sh /script/cleanup
(Nchafatsong ea lenaneo, e-ea ho ja kamora nakoana ebe u khutla ho tla hlahloba, ho khathollaufo.org.in, img.ufo.org.maqepheng a khutletse setloaeleng)
yum clean all; yum update -y; sh /script/cleanup
service httpd restart
Ho etsa bonnete ba hore dns e kenyelelitsoe "lipalo-palo", ka mor'a ho ntlafatsa yum hloekisa tsohle; yum update -y; sh /script/cleanup, etsa bonnete ba hore u matha:
sh /script/fixdnsaddstatsrecord
Ntlafatsa Kloxo-MR:
yum clean all; yum update kloxomr7 -y; yum update -y
Kenya Kloxo-MR hape:
Haeba ho se na liphoso tse fumanoeng, leka taelo e latelang:
sh /script/upcp -y
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) o arolelane "Linux System Information Viewing Command Collection", e leng thuso ho uena.
Rea u amohela ho arolelana sehokelo sa sengoloa sena:https://www.chenweiliang.com/cwl-405.html
Rea u amohela ho mocha oa Telegraph oa blog ea Chen Weiliang ho fumana lintlha tsa morao-rao!
📚 Tataiso ena e na le boleng bo boholo, 🌟Ona ke monyetla o sa tloaelehang, se ke oa o fetoa! ⏰⌛💨
Share le rata haeba u rata!
Ho arolelana le lintho tseo u li ratang ke khothatso ea rona e tsoelang pele!