***** 億般-push 配置參考******
rpm -ivh http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel7.noarch.rpm
vi /etc/yum.repos.d/city-fan.org.repo
enabled的值0改成1,如下
[cityfan]
name=cityfan
baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/
# Centos7系統用 baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/
enabled=1
gpgcheck=0
yum upgrade libcurl
***注意:如果升級時提示Requires: libnghttp2.so.14()(64bit)錯誤時,可以使用安裝epel源來解決,安裝方法如下:
yum install epel-release -y
然后繼續執行上面命令
測試:
curl --http2 -I https://nghttp2.org/
others
=================================
參考
yum升級curl支持http2測試
https://www.cnblogs.com/lazyfang/p/8040493.html
Centos7 yum安裝LNMP
https://www.cnblogs.com/ivy-zheng/p/10987431.html
centos7下使用yum方式安裝PHP7
https://www.cnblogs.com/pandawan/p/11100311.html
[關閉防火牆]
# 臨時
systemctl stop firewalld
# 永久
systemctl disable firewalld
[nginx]
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install nginx
service nginx start
測試:
curl http://localhost
nginx位置:/etc/nginx/
www默認位置:/usr/share/nginx/html
如果有php,要先啟動php-fpm:(見下節)
systemctl start php-fpm
重啟: service nginx restart
[php]
使用以下命令將yum倉庫包升級更換成PHP7的rpm包
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
先使用yum命令安裝基本PHP組件,以后要用到啥再安裝啥
yum -y install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
再安裝PHP-fpm(進程管理器,提供PHP進程管理方式,可以有效控制內存和進程、平滑重載PHP配置)
yum -y install php70w-fpm php70w-opcache
安裝完之后啟動php-fpm
systemctl start php-fpm
查看版本以檢測是否安裝成功
php -v
檢測PHP是否能與Nginx互通
1.在Nginx的默認HTML文件夾里(/usr/local/webserver/nginx/html/)新建一個index.php,內容如下:
<?php
phpinfo();
?>
2.修改Nginx的配置文件(可使用find /|grep nginx.conf搜索配置文件位置)Nginx.conf,修改新增如下:
復制代碼
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
