虚拟机常用命令

虚拟机Contos7常用命令

切换用户:su 用户名

创建用户:useradd 用户名

切换文件夹:cd 文件名

显示自动创建目录:pwd

解压文件:tar xvf 文件名

删除文件:rm -rf 文件名

配置nginx文件目录:./configure --prefix=/opt/nginx --sbin-path=/usr/bin/nginx

如果出现此错误:

checking for OS
+ Linux 3.10.0-1127.13.1.el7.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found

使用此命令:yum -y install gcc 解决问题

安装:make && make install

临时关闭防火墙:service iptables stop

开机时不启动防火墙:chkconfig ipables off

启动nginx: 进入nginx安装目录执行:nginx

猜你喜欢

转载自www.cnblogs.com/wangdiqu/p/13398956.html
今日推荐