環境構築 CentOS6 Apatch PHP

CentOS6.4のインストール | VMwareESXiによる仮想環境構築入門

f:id:slash67:20151116123046p:plain

yum update

   1  yum update

   2  yum install -y httpd

   3  rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

   4  rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

   5  yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

   6  php --version

cd /var/www/html/   が公開領域

 

iptables -L -n --line-number

iptables -L

cd /var/www/html/ 公開領域に移動

 

vim /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

service iptables restart

 

 

1 /etc/rc.d/init.d/sshd restart

   systemctl start sshd.service

2 /etc/rc.d/init.d/sshd status
3 ifconfig
6 yum install -y httpd
7 rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
8 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
9 yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
10 php --version
12 /etc/init.d/httpd start
13 chkconfig httpd on
14 vim /etc/sysconfig/iptables
15 service iptables restart
16 exit
17 cd /var/www/html/
19 iptables -L -n --line-number
20 iptables -L
21 iptables -A INPUT -p tcp -m tcp --dport 80-j ACCEPT
     vim /etc/sysconfig/iptables
23 iptables -L
24 service iptables save
25 iptables -L
26 vim /etc/sysconfig/iptables

    -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

ポート80 (http) と 443 (https)を開けるには、下記のようにします。

firewall-cmd --permanent --zone=public --add-service=http 
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

CentOS7


27 service iptables restart
28 ifconfig
29 vim index.php

<?php

phpinfo();

?>


30 ls
31 cd ../
32 ls -la
33 chmod 777 html -R
34 ls -la
35 vim /etc/httpd/conf/httpd.conf    公開領域の設定
36 /etc/init.d/httpd restart