centos 7 编译安装owncloud

安装owncloud所需的 NGINX、MYSQL、PHP已经在前文提到过,如果有网友想要安装owncloud,但所需的环境LNMP已经配置了部分,不妨重新跟着我前面的配置文章进行配置。

[root@iZuf6b4wamau0tcvk7hwglZ ~]# wget https://download.owncloud.org/community/owncloud-10.0.8.zip
[root@iZuf6b4wamau0tcvk7hwglZ ~]# unzip owncloud-10.0.8.zip

转到nginx目录下的html文件夹中


[root@iZuf6b4wamau0tcvk7hwglZ ~]# mv ./owncloud /usr/local/nginx/html/

我 NGINX 安装在/usr/local/nginx 下,编辑配置文件/usr/local/nginx/conf/nginx.conf

[root@iZuf6b4wamau0tcvk7hwglZ ~]# vim /usr/local/nginx/conf/nginx.conf

http 节点下新增 upstream php-handler 节点和 server 节点 , 由于之前存在server节点于是重新增加节点内容如下所示

upstream php-handler {
    server    127.0.0.1:9000; 
    #server    unix:/var/run/php5-fpm.sock; 
} 

server {
    listen    8080; 
    server_name    cloud.example.com; 
    # Path to the root of your installation 
    root    /usr/local/nginx/html/owncloud; 
    # set max upload size 
    client_max_body_size    10G; 
    fastcgi_buffers    64    4K; 
    # Disable gzip to avoid the removal of the ETag header 
    gzip    off; 
    # Uncomment if your server is build with the ngx_pagespeed module 
    # This module is currently not supported. 
    #pagespeed    off; 
    rewrite    ^/caldav(.*)$    /remote.php/caldav$1 redirect; 
    rewrite    ^/carddav(.*)$    /remote.php/carddav$1 redirect;
    rewrite    ^/webdav(.*)$    /remote.php/webdav$1 redirect;
    index    index.php;
    error_page    403    /core/templates/403.php;
    error_page    404    /core/templates/404.php;
    location = /robots.txt {
        allow all; 
        log_not_found off; 
        access_log off; 
    } 
    location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
        deny all; 
    }
    location / {
        # The following 2 rules are only needed with webfinger 
        rewrite ^/.well-known/host-meta /public.php?service=host-meta last; 
        rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; 
        rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; 
        rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; 
        rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; 
        try_files $uri $uri/ /index.php; 
    }
    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$; 
        include fastcgi_params; 
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
        fastcgi_param PATH_INFO $fastcgi_path_info; 
        fastcgi_pass php-handler; 
    }
    # Optional: set long EXPIRES header on static assets 
    location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
          expires 30d; 
          # Optional: Don't log access to assets 
            access_log off; 
    } 
}

启动服务

需要将 OwnCloud 目录给 Nginx 用户授权 :

# chown -R nginx:nginx /usr/local/nginx/html/owncloud/

重启nginx,就可以访问了 https://IP:8080/owncloud/index.php //,之前设立的是8080端口 ip为你的ip地址

问题

出现如下问题,百度了下有可能是phpadmin没有安装,于是安装phpadmin
,如果网友没有安装phpadmin,请查阅我之前的安装文章
这里写图片描述

然后去安装PHP Intl

PHP intl 是国际化扩展,是ICU 库的一个包装器。所以在安装PHP intl扩展前要先安装ICU库

[root@iZuf6b4wamau0tcvk7hwglZ ~]# mkdir /usr/local/icu
[root@iZuf6b4wamau0tcvk7hwglZ ~]# wget http://download.icu-project.org/files/icu4c/52.1/icu4c-52_1-src.tgz
[root@iZuf6b4wamau0tcvk7hwglZ ~]# tar xf icu4c-52_1-src.tgz
[root@iZuf6b4wamau0tcvk7hwglZ ~]# cd icu/source
[root@iZuf6b4wamau0tcvk7hwglZ ~]# ./configure --prefix=/usr/local/icu
make && make install

进行PHP intl安装

1)首先下载最新的 php intl 扩展源码

[root@iZuf6b4wamau0tcvk7hwglZ ~]# wget http://pecl.php.net/get/intl-3.0.0.tgz

2) 解压


[root@iZuf6b4wamau0tcvk7hwglZ ~]# tar -xzf intl-3.0.0.tgz
[root@iZuf6b4wamau0tcvk7hwglZ ~]# cd intl-3.0.0

3)进入文件夹后,首先运行 phpize 来准备编译扩展的环境

[root@iZuf6b4wamau0tcvk7hwglZ ~]# /usr/local/php/bin/phpize

此刻出现问题

显示Cannot find autoconf

# cd /usr/src
# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# tar -zvxf m4-1.4.9.tar.gz
# cd m4-1.4.9/
# ./configure && make && make install
# cd ../
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install

再次运行[root@iZuf6b4wamau0tcvk7hwglZ ~]# /usr/local/php/bin/phpize 此刻问题解决,然后进行下一步操作

4)运行后,我们运行 ./configure 脚本来进行配置 –with-php-config 这个参数是告诉配置脚本 php-config 这个程序的路径。

[root@iZuf6b4wamau0tcvk7hwglZ intl-3.0.0]# ./configure -h
[root@iZuf6b4wamau0tcvk7hwglZ intl-3.0.0]# ./configure --enable-intl --with-icu-dir=/usr/local/icu/ --with-php-config=/usr/local/php/bin/php-config

5)这时用make来编译扩展
6)安装完成后将 extension=intl.so 加入到php.ini文件中,然后执行 /etc/init.d/php-fpm restart 使php.ini配置生效。
7)用 # php -m | grep intl 或 phpinfo() 查看intl扩展是否安装成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值