阿里云操作系统centOs 相关的一些操作
1、操作系统的版本
我的阿里云操作系统版本CentOS 6.8 64位–
在按照阿里的说明部署环境时的命令有些不好用,从网上查阅了资料整理了一下:
2、centos查看Apache启动状态的三条命令(网上搜的资料)
1、service httpd start (sentos7之前版本的命令)
2、systemctl start httpd命令(sentos7之后版本的命令)
3、/etc/init.d/httpd start
第1条和第3条都会出现如下成功提示:
start apache... httpd (pid 1901) already running
done`
关于上述第3条的说明:
service 命令是system-v体系中的一个功能,其实也是一个脚本。
你可以查看/sbin/service,里面定义了目标目录: SERVICEDIR=“/etc/init.d”。
也就是说,你执行service httpd start 的时候,和执行/etc/init.d/httpd start 是一样的,它只是个快捷方式而已。
3、centOs查看ip的命令是ifconfig
4、下面几条暂时感觉不太适合现在的阿里云版本,暂时记下了,希望对大家有所帮助!
systemctl start httpd.service #启动
systemctl stop httpd.service #停止
systemctl restart httpd.service #重启
systemctl enable httpd.service #开机自启
systemctl disable httpd.service #开机不启动
5、centos 操作系统的操作mysql的命令
6、防火墙打开 8080 端口
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
/etc/rc.d/init.d/iptables save
7、错误提示,出现如下错误提示,很多时候不是你用的命令出现问题了,而是你的命令可能不是这个版本适合的,也就是centOs版本不同,相关的命令也不同,切实注意,不要走弯路!
-bash: systemctl: command not found
``