[root@dyw219 ~]# ssh root@kvm8.deyu.wang root@kvm8.deyu.wang's password: Last login: Sat Dec 6 09:45:29 2014 from 192.168.122.1 [root@kvm8 ~]#
[root@kvm8 ~]# yum install php -y Loaded plugins: fastestmirror, refresh-packagekit Determining fastest mirrors dywang | 1.9 kB 00:00 Setting up Install Process Resolving Dependencies --> Running transaction check Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: php x86_64 5.4.30-1.el6.remi dywang 2.7 M Installing for dependencies: apr x86_64 1.3.9-5.el6_2 dywang 123 k apr-util x86_64 1.3.9-3.el6_0.1 dywang 87 k apr-util-ldap x86_64 1.3.9-3.el6_0.1 dywang 15 k httpd x86_64 2.2.15-26.el6 dywang 821 k httpd-tools x86_64 2.2.15-26.el6 dywang 72 k mailcap noarch 2.1.31-2.el6 dywang 27 k php-cli x86_64 5.4.30-1.el6.remi dywang 2.6 M php-common x86_64 5.4.30-1.el6.remi dywang 932 k Transaction Summary ================================================================================ Install 9 Package(s) Upgrade 0 Package(s) .......... Complete!
[root@kvm8 ~]# vim /etc/httpd/conf/httpd.conf [root@kvm8 ~]# grep kvm8 /etc/httpd/conf/httpd.conf ServerName kvm8.deyu.wang:80
[root@kvm8 ~]# /etc/init.d/httpd start Starting httpd: [ OK ]
[root@kvm8 ~]# chkconfig httpd on
[root@kvm8 ~]# chkconfig --list httpd httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@kvm8 ~]# /etc/init.d/iptables stop iptables: Flushing firewall rules: [ OK ] iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Unloading modules: [ OK ] [root@kvm8 ~]# chkconfig iptables off [root@kvm8 ~]# chkconfig --list iptables iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@kvm8 ~]# vim /etc/sysconfig/iptables [root@kvm8 ~]# cat /etc/sysconfig/iptables # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
[root@kvm8 ~]# /etc/init.d/iptables restart iptables: Applying firewall rules: [ OK ] [root@kvm8 ~]# chkconfig iptables on [root@kvm8 ~]# chkconfig --list iptables iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off