centos服务器全新安装php,apache环境

留个备份,有空研究一下。

1
yum install php56w-devel.x86_64 2 yum install httpd-devel.x86_64 3 vim /etc/php.ini 4 vim /etc/httpd/conf/httpd.conf 5 vim /etc/httpd/conf.modules.d/10-php.conf 6 vim /etc/httpd/conf.modules.d/00-mpm.conf 7 vim /etc/httpd/conf.modules.d/00-base.conf 8 quit 9 exit 10 yum update 11 yum upgrade 12 php -v 13 httpd -v 14 yum list|grep httpd 15 yum install httpd 16 cd /etc/yum.repos.d 17 rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm 18 yum install php56w php56w-opcache php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 19 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 20 ls 21 vi epel.repo 22 vi epel.repo.rpmnew 23 yum install php56w php56w-opcache php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 24 rpm -qa|grep webstatic 25 vi epel.repo.rpmnew rm epel.repo 26 rm epel.repo 27 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 28 ls 29 yum install php56w php56w-opcache php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 30 yum install php 31 yum install php56w.x86_64 php56w-opcache.x86_64 php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 32 ls 33 vi webtatic.repo 34 rm webtatic.repo 35 rm webtatic-archive.repo 36 vi webtatic-archive.repo 37 rm webtatic-archive.repo 38 rm webtatic-testing.repo 39 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 40 ls 41 vi CentOS-Base.repo 42 vi epel.repo.rpmnew 43 mv epel.repo.rpmnew epel.repo 44 yum install php56w php56w-opcache php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 45 ls 46 rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 47 ls 48 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 49 ls 50 yum install php56w php56w-opcache php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 51 mv epel.repo epel.repo.rpmnew 52 yum install php56w php56w-opcache php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 53 yum remove php 54 yum install php56w php56w-opcache php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-pear.noarch php56w-xml.x86_64 php56w-xmlrpc.x86_64 55 yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64 56 yum install php56w php56w-opcache php56w-devel php56w-gd php56w-ldap php56w-mbstring php56w-mysql php56w-pdo php56w-pear.noarch php56w-xml php56w-xmlrpc 57 rpm -qa | grep webstatic 58 ls 59 rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm 60 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm 61 yum list --enablerepo=remi --enablerepo=remi-php56 | grep php 62 yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common 63 yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-pdo php-pear php-fpm php-cli php-xml php-process php-gd php-common 64 yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mysql php-pdo php-pear php-fpm php-cli php-xml php-process php-gd php-common 65 php -v 66 df -h 67 fdisk -l 68 fdisk -S 56 /dev/xvdb 69 fdisk -l 70 mkfs.ext3 /dev/xvdb1 71 vim /etc/fstab 72 mkdir /mnt/web/asae 73 mkdir /mnt/web 74 mkdir /mnt/web/asae 75 echo '/dev/xvdb1 /mnt ext3 defaults 0 0' >> /etc/fstab 76 mount -a 77 df -h 78 cd /mnt 79 ls 80 mkdir web 81 mkdir web/asae 82 ls 83 cd web 84 cd asae/ 85 vim /etc/httpd/conf/httpd.conf 86 vim /etc/httpd/conf.d/welcome.conf 87 vim /etc/httpd/conf.d/vhost.conf 88 service httpd status 89 service httpd start 90 yum install epel-release 91 useradd asaweb; 92 ll 93 cd ../ 94 ll 95 cd usr 96 ll 97 cd ../ 98 ll 99 passwd asaweb 100 logout 101 ll 102 cd /mnt 103 ll 104 cd web 105 ll 106 cd ../ 107 ll 108 chown -R asaweb ./web 109 ll 110 cd web 111 ll 112 cd ../ 113 exit 114 l 115 ll 116 cd /mnt/web 117 ll 118 cd /etc/httpd 119 ll 120 cd conf.d 121 ll 122 vi vhost.conf 123 cd ../conf 124 ll 125 vi httpd.conf 126 cd ../conf.d 127 ll 128 vi vhost.conf 129 httpd restart 130 apachectl restart 131 ll 132 vi vhost.conf 133 apachectl restart 134 exit; 135 vim /etc/ssh/sshd_config 136 service sshd restart
原文地址:https://www.cnblogs.com/shher/p/4884311.html