0%

centos开机启动项

2018年2月21日 下午9:55

登录centos

1
2
3
localhost:~ czh$ ssh root@192.168.16.111
root@192.168.16.111's password:123456
Last login: Mon Feb 19 22:57:28 2018 from 192.168.16.100

配置防火墙:

1
[czh@centos6 vhost]$ sudo vim /etc/sysconfig/iptables

防火墙开闭:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
关闭虚拟机防火墙:

关闭命令: service iptables stop

永久关闭防火墙:chkconfig iptables off

两个命令同时运行,运行完成后查看防火墙关闭状态
service iptables status

1 关闭防火墙-----sudo service iptables stop
2 启动防火墙-----sudo service iptables start
3 重启防火墙-----sudo service iptables restart
4 查看防火墙状态--sudo service iptables status
5 永久关闭防火墙--sudo chkconfig iptables off
6 永久关闭后启用--sudo chkconfig iptables on

启动nginx

1
[czh@localhost ~]$ sudo /usr/local/nginx/sbin/nginx

启动apache

1
[czh@localhost ~]$ ~/developer/apache-tomcat-7.0.73/bin/startup.sh

启动mysql

1
[czh@localhost bin]$ sudo service mysqld restart

连接mysql:

1
localhost:~ czh$ mysql -h 192.168.16.111 -u root -p

启动vsftpd:

1
[czh@centos6 vsftpd]$ sudo service vsftpd restart