如何在CentOS 6上通过YUM安装Nginx和PHP-FPM

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在CentOS 6上通过YUM安装Nginx和PHP-FPM相关的知识,希望对你有一定的参考价值。

开始安装nginxphp-FPM之前,你必须卸载系统中以前安装的Apache和PHP。用root登录输入下面的命令:
[plain] view plain copy
# yum remove httpd* php*

增加额外资源库

默认情况下,CentOS的官方资源是没有php-fpm的, 但我们可以从Remi的RPM资源中获得,它依赖于EPEL资源。我们可以这样增加两个资源库:

[plain] view plain copy
# yum install yum-priorities -y
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

输出样例

[plain] view plain copy
Retrieving http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
warning: /var/tmp/rpm-tmp.00kiDx: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...########################################### [100%]
1:epel-release ########################################### [100%]

安装Nginx

输入下列命令

[plain] view plain copy
# yum install nginx
参考技术A 必须卸载系统中以前安装的Apache

# yum remove httpd* php*
# yum install yum-priorities -y
# rpm -Uvh

# rpm -Uvh

安装Nginx# yum install nginx
安装PHP-FPM
# yum --enablerepo=remi install php php-fpm本回答被提问者和网友采纳

如何在CentOS 7中安装Subversion

Apache Subversion(简称SVN,svn),一个开放源代码的版本控制系统,相较于RCS、CVS,它采用了分支管理系统,它的设计目标就是取代CVS。互联网上很多版本控制服务已从CVS转移到Subversion。

下面讲解下如何在CentOS 7中安装Subversion的详细过程。

1、开始在CentOS 7中安装Subversion

yum install mod_dav_svn subversion

示例输出:

=====================================================
Package Arch Version Repository Size
=====================================================
Installing:
mod_dav_svn x86_64 1.7.14-6.el7 base 101 k
subversion x86_64 1.7.14-6.el7 base 1.0 M
Installing for dependencies:
apr x86_64 1.4.8-3.el7 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k
httpd x86_64 2.4.6-18.el7.centos updates 2.7 M
httpd-tools x86_64 2.4.6-18.el7.centos updates 77 k
mailcap noarch 2.1.41-2.el7 base 31 k
neon x86_64 0.30.0-3.el7 base 165 k
pakchois x86_64 0.4-10.el7 base 14 k
subversion-libs x86_64 1.7.14-6.el7 base 921 k

Transaction Summary
=====================================================

2、加配置文件到Apache

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<Location /svn>
DAV svn
SVNParentPath /var/www/linuxidcsvn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user
</Location>

3、创建SVN用户

[root@linuxidc-centos7 ~]# htpasswd -cm /etc/svn-auth-users testuser1
New password:
Re-type new password:
Adding password for user testuser1
[root@linuxidc-centos7 ~]#

4、创建和配置SVN仓库

mkdir /var/www/linuxidcsvn
cd /var/www/linuxidcsvn
svnadmin create repo
chown -R apache.apache repo

# If you still have issues with SELinux Security please apply this:
chcon -R -t httpd_sys_content_t /var/www/linuxidcsvn/repo
chcon -R -t httpd_sys_rw_content_t /var/www/linuxidcsvn/repo

5、你可以用这种方式–HTTP和HTTPS

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

6、启用并启动HTTP服务

systemctl enable httpd.service
systemctl restart httpd.service

启动时候失败,

#journalctl -xn

Jun 01 10:41:57 iZ9 httpd[26217]: httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib64/httpd/modules/mod_dav_svn.so into server: /usr/lib64/httpd/modules/mod_dav_svn.so: undefined symbol: dav_do_find_liveprop
Jun 01 10:41:57 iZ9 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 01 10:41:57 iZ9 kill[26218]: kill: cannot find process ""
Jun 01 10:41:57 iZ9 systemd[1]: httpd.service: control process exited, code=exited status=1
Jun 01 10:41:57 iZ9 systemd[1]: Failed to start The Apache HTTP Server.

是由于缺少apache的 mod_dav.so

添加:LoadModule dav_module modules/mod_dav.so

重启后,http://****/svn/repo/为svn根目录地址

如何在CentOS 7中安装Subversion

7、加入下面这个到conf/svnserve.conf

anon-access = none
auth-access = authz

8、branches&tags&trunk模式下建svn库

mkdir -p /tmp/svn-structure-template/trunk,branches,tags

svn import -m "Initial repository" /tmp/svn-structure-template file:///var/www/linuxidcsvn/repo/
Adding /tmp/svn-structure-template/branches
Adding /tmp/svn-structure-template/tags
Adding /tmp/svn-structure-template/trunk

Committed revision 1.

如何在CentOS 7中安装Subversion

OK。

CentOS 6 编译安装Subversion-1.8.10+Apache2.4 http://www.linuxidc.com/Linux/2015-02/113177.htm

Linux中Subversion配置实例 http://www.linuxidc.com/Linux/2012-02/53109.htm

CentOS 6.2 SVN搭建 (YUM安装) http://www.linuxidc.com/Linux/2013-10/91903.htm

Apache+SVN搭建SVN服务器 http://www.linuxidc.com/Linux/2013-03/81379.htm

Windows下SVN服务器搭建和使用 + 客户端重新设置密码 http://www.linuxidc.com/Linux/2013-05/85189p5.htm

Ubuntu Server 12.04 安装 SVN 并迁移 Virtual SVN数据 http://www.linuxidc.com/Linux/2013-05/84695.htm

Ubuntu Server搭建svn服务以及迁移方法 http://www.linuxidc.com/Linux/2013-05/84693.htm
参考技术A 1、开始在CentOS 7中安装Subversion
2、加配置文件到Apache
3、创建SVN用户

[root@linuxidc-centos7 ~]# htpasswd -cm /etc/svn-auth-users testuser1
New password:
Re-type new password:
Adding password for user testuser1
[root@linuxidc-centos7 ~]#
4、创建和配置SVN仓库
5、你可以用这种方式–HTTP和HTTPS

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
6、启用并启动HTTP服务
systemctl enable httpd.service
systemctl restart httpd.service
7、加入下面这个到conf/svnserve.conf

anon-access = none
auth-access = authz
8、branches&tags&trunk模式下建svn库本回答被提问者采纳

以上是关于如何在CentOS 6上通过YUM安装Nginx和PHP-FPM的主要内容,如果未能解决你的问题,请参考以下文章

如何在CentOS 6上通过YUM安装Nginx和PHP-FPM

如何在CentOS 6上通过YUM安装Nginx和PHP-FPM

如何在CentOS 6上通过YUM安装Nginx和PHP-FPM

如何在CentOS 6上通过YUM安装Nginx和PHP-FPM

如何在CentOS 6上通过YUM安装Nginx和PHP-FPM

如何在CentOS 6上通过YUM安装Nginx和PHP-FPM