摘要:(一)如果你的服务器没有链接网络可以先挂载本地光盘。设置yum源。挂载光盘:[root@delphi ~]# mkdir /mnt/cdrom #新建挂载点[root@delphi ~]# mount /dev/cdrom /mnt/cdrom/ #挂载本地光盘mount: block device /dev/sr0 is write-protected, mounting read-only[root@delphi ~]#配置yum源:[root@delphi ~]# cd /etc/yum.repos.d/[root@delphi yum.repos.d]# lsCentO...
阅读全文
摘要:在做umount设备时, device is busy是令人头痛的提示:[root@delphi /]# umount /dev/cdromumount: /mnt/cdrom: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))lsof可以找出被特定进程所打开的文件,目录,套接字,设备.例子:比如有时我们不能umount掉一个分区时,我们会需要检查,是哪些进程在使用当前的分区以便找出进程后将它...
阅读全文
摘要:比如有如下几个文件夹:www.aaa.com,www.bbb.com,www.ccc.com,www.ddd.com,每个文件里面还有4个子文件夹分别是1,2,3,4,每个子文件里面还有html文件。现在需求把所有文件夹打包压缩但是不要html文件,只是保留文件夹内部结构不需要内部的具体文件。 就可以用如下命令:tar zcvf web.tar.gz --exclude=*.html *.com 把所有以.com结尾的文件夹打包,剔除里面的所有的html文件。
阅读全文
摘要:今天在给nginx添加几十个域名后,重启nginx的时候,报错”[emerg]: could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 128″在nginx.conf配置文件的http{}把server_names_hash_bucket_size 128改为server_names_hash_bucket_size 512,按32的倍数往上加,再重启问题解决。[root@localho
阅读全文
摘要:1、获取远程服务器上的文件scp -P 22 root@www.test.com:/root/test.tar.gz /home/test.tar.gz上端口大写P 为参数,22 表示更改连接SSH的端口,如果没有更改默认的SSH端口可以不用添加该参数。 root@www.test.com 表示使用root用户登录远程服务器www.test.com,:/root/test.tar.gz 表示远程服务器上的文件,最后面的/home/test.tar.gz表示保存在本地上的路径和文件名。2、获取远程服务器上的目录scp -r root@www.test.com:/root/testdir /ho.
阅读全文