CentOS 7 关闭图形界面


查看 /etc/inittab 如下

[plain] view plain copy
# systemd uses 'targets' instead of runlevels.   
# by default, there are two main targets:  
#  
# multi-user.target: analogous to runlevel 3  
# graphical.target: analogous to runlevel 5  
#  
# To view current default target, run:  
# systemctl get-default  
#  
# To set a default target, run:  
# systemctl set-default TARGET.target  

新版本的 CentOS 系统里使用'targets'取代了运行级别的概念。
系统有两种默认的'targets': 多用户.target对应之前版本的3运行级别;图形.target对应之前的5运行级别。

查看默认的target

systemctl get-default

开机以命令模式启动

systemctl set-default multi-user.target

开机以图形界面启动

systemctl set-default graphical.target
阅读全文

阿里云主机新加磁盘并格式化


新加了一块磁盘

[root@iZ2zeh0wl8jq1asl4b3rf2Z ~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008de3e

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    83884031    41940992   83  Linux

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

阅读全文

CentOS 7 修改 hostname


CentOS7 的修改主机名 hostname 的方式变了
有系统集成的命令

[root@iZ2zeh0wl8jq1asl4b3rf2Z ~]# hostname
iZ2zeh0wl8jq1asl4b3rf2Z
[root@iZ2zeh0wl8jq1asl4b3rf2Z ~]# hostnamectl set-hostname openresty.instreet
[root@iZ2zeh0wl8jq1asl4b3rf2Z ~]# hostname
openresty.instreet

重启后全部生效

阅读全文

Invalid command 'Order' perhaps misspelled or defined by a module not included in the server configuration


报错是

Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration

解决方案
首先查看 modules 目录下是否有 mod_access_compat.so、mod_authz_host.so
然后在 httpd.conf 下添加

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule authz_host_module modules/mod_authz_host.so
阅读全文

Linux 查看网卡 UUID


通过 nmcli 命令

[root@master test]# nmcli con
名称    UUID                                  类型            设备
ens33   c96bc909-188e-ec64-3a96-6a90982b08ad  802-3-ethernet  ens33
virbr0  7f06cd4d-a01e-4ba9-a5f8-494179118ee6  bridge          virbr0
阅读全文