服务器 centos7 最少安装后常用命令
2016-07-07 16:56
706 查看
更新yum
yum update
安装httpd
yum install httpd -y
可能会用到的:
启动服务(等同于service httpd start)
systemctl start httpd.service
停止服务(等同于service httpd stop)
systemctl stop httpd.service
重启服务(等同于service httpd restart)
systemctl restart httpd.service
查看服务是否运行(等同于service httpd status)
systemctl status httpd.service
开机自启动服务(等同于chkconfig httpd on)
systemctl enable httpd.service
开机时禁用服务(等同于chkconfig httpd on)
systemctl disable httpd.service
查看服务是否开机启动 (等同于chkconfig --list)
systemctl list-units --type=service
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、安装iptables防火墙
yum install iptables-services #安装
vi /etc/sysconfig/iptables #编辑防火墙配置文件
#add:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
yum install net-tools #安装netstat
yum update
安装httpd
yum install httpd -y
可能会用到的:
启动服务(等同于service httpd start)
systemctl start httpd.service
停止服务(等同于service httpd stop)
systemctl stop httpd.service
重启服务(等同于service httpd restart)
systemctl restart httpd.service
查看服务是否运行(等同于service httpd status)
systemctl status httpd.service
开机自启动服务(等同于chkconfig httpd on)
systemctl enable httpd.service
开机时禁用服务(等同于chkconfig httpd on)
systemctl disable httpd.service
查看服务是否开机启动 (等同于chkconfig --list)
systemctl list-units --type=service
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、安装iptables防火墙
yum install iptables-services #安装
vi /etc/sysconfig/iptables #编辑防火墙配置文件
#add:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
yum install net-tools #安装netstat
相关文章推荐
- sizeof与strlen的注意事项
- 如何设置CentOS 7获取动态及静态IP地址
- Linux基础篇--GCC编译器
- Centos7安装完毕后无法联网的解决方法
- linux系统数据落盘之细节
- centos编译helloworld的几个小问题
- centos6.5 kvm与ceph整合问题解决
- Linux下学习DB2命令的笔记
- Linux系统安装 Centos6.8系统安装详细教程
- Linux系统Time_Wait状态的端口快速释放
- linux lsof使用详解,查看进程使用的文件、恢复删除文件
- Linux useful command
- Linux kernel 关机的底层操作
- CentOS下DB2数据库安装过程详解
- 创建软连接
- Linux下gcc和g++编译helloworld
- 第4章 安装CentOS 5.x与多重引导小技巧
- CentOS 6.7上使用gdb调试时出现Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.192.el6.x86_64
- make工具及其使用
- 在LINUX下使用CROSSTOOL-0.43制作自己的ARM交叉编译环境