lnmp 实现owncloud

安装下载最新nginx

rpm -Uvh http://101.96.8.164/nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.3-1.el7.ngx.x86_64.rpm

安装支持的mysql本例为5.7

tar vxf mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar

安装

rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm mysql-community-client-5.7.17-1.el7.x86_64.rpm mysql-community-common-5.7.17-1.el7.x86_64.rpm mysql-community-libs-5.7.17-1.el7.x86_64.rpm

查看密码

cat /var/log/mysqld.log |grep "temporary pass"

mysql -u root -p

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘123.comEr‘;

flush privileges;

安装php7  支持的版本

先装依赖包

cd php-7.0.15/

yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel curl curl-devel openssl openssl-devel

./configure --prefix=/usr/local/php7 --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mysqli --with-zlib --with-curl --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-openssl --enable-mbstring --enable-xml --enable-session --enable-ftp --enable-pdo --enable-tokenizer --enable-zip

make

make install

cp php.ini-development /usr/local/php7/lib/php.ini

vi /usr/local/php7/lib/php.ini

mysql.default_socket=/var/lib/mysql/mysql.scok

date.timezone =Asia/Shanghai

查看

/usr/local/php7/bin/php -v

cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf

vim /usr/local/php7/etc/php-fpm.conf

env[HOSTNAME]=$HOSTNAME
   env[PATH]=/usr/local/bin:/usr/bin:/bin:/usr/local/php/bin
   env[TMP]=/tmp
   env[TMPDIR]=/tmp
   env[TEMP]=/tmp

cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf

vim /usr/local/php7/etc/php-fpm.d/www.conf

listen = 0.0.0.0:9000

cp sapi/fpm/php-fpm.service /usr/lib/systemd/system/

vim /usr/lib/systemd/system/php-fpm.service

[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target

[Service]
Type=simple
PIDFile=/var/local/php7/var/run/php-fpm.pid
ExecStart=/usr/local/php7/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php7/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
 systemctl enable php-fpm.service
systemctl start php-fpm.service
 systemctl status php-fpm.service

mkdir -p /www/lnmp/web

vi /etc/nginx/conf.d/lnmp.conf

systemctl reload nginx.service
setsebool -P httpd_unified 1

vi /etc/nginx/conf.d/lnmp.conf

upstream php-handler {
server 0.0.0.0:9000;
#server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name _;
# Path to the root of your installation
root /www/lnmp/web/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;
}
}

unzip owncloud-9.1.4.zip

cp -Rf owncloud /www/lnmp/web/
chown nginx:nginx /www/lnmp/web/owncloud -Rf

chmod 777 owncloud/ -Rf

chcon -R -t httpd_sys_content_t /www/lnmp/web/owncloud

mysql -u root -p123.comEr

create database owncloud;

create user ‘owncloud‘@‘LOCALHOST‘ identified by ‘123.comEr‘;
grant all on owncloud.* to ‘owncloud‘@‘LOCALHOST‘;
flush privileges;

quit

cd /etc/nginx/conf.d

mv default.conf default.conf.c

systemctl restart nginx

访问192.168.1.142

时间: 2024-10-12 21:09:19

lnmp 实现owncloud的相关文章

nginx [emerg] socket() []80 failed (97 Address family not supported by protocol)

1.nginx报错信息 早上通过LNMP部署owncloud 10.0.2的云盘环境,修改nginx配置文件后,重启报错:nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) 2.分析并解决报错 看到 socket() [::]:80 failed,第一反应就是好像与IPV6有关,Address family not supported by protocol也进一步印证了我的想

owncloud搭建过程

##1.搭建php环境,刚开始用的lnmp环境,配置文件总是出错,nginx解析过程不对,最后换成lamp apache的配置也比较奇葩,更换路径导致无法解析,换到初始的web路径就可以了 ##2.下载owncloud安装文件 wget tar jxf own... ##3.将解压的文件放到web路径,并做权限 chown apache:apache owncloud ##4.安装127.0.0.1/owncloud

Centos7下nginx+owncloud+php+mysql搭建个人私有云

Centos7.1 1053最小化安装lnmp通过yum安装,由于Centos7没有mysql的yum源,所以要自己安装mysql的yum源,但是安装上了,在我这yum安装只有几十K的速度,所以干脆去yum源里下载了mysql-server的rpm包,然后通过yum安装的rpm包,省了不少时间,lnmp的搭建这里就不再多说了,记着关闭selinux不然会提示File not found. 一.下载owncloud并解压的网站目录 [[email protected] ~]# axel https

linux运维、架构之路-Lnmp架构部署

一.Lnmp架构原理 二. Lnmp架构软件安装 1.Nginx安装脚本 #!/bin/bash useradd -s /sbin/nologin -M www mkdir -p /server/tools/ cd /server/tools/ wget http://nginx.org/download/nginx-1.10.3.tar.gz tar xf nginx-1.10.3.tar.gz yum install pcre-devel openssl-devel -y cd /home/

lnmp脚本

#!/bin/bash#Function: Install LNMP#Author: wang#Date: 20170809 nginx_install(){useradd www -u 509 -s /bin/bash -mmkdir -p /opt/server/nginx/temp #Install the make GCCyum -y install gcc gcc-c++ automake autoconf libtool make #Installing PCRE library (

LNMP编译安装遇到问题归总

LNMP编译安装遇到问题归总 1.错误:configure: error: freetype-config not found. 解决:yum install freetype-devel 2.错误:configure: error: libevent >= 1.4.11 could not be found  解决:yum -y install libevent libevent-devel 3.错误:configure: error: Please reinstall the mysql d

Python实现一键安装部署LNMP环境

最近一直在学Python,东西比较多,时间持续的也比较长,为了能够学以致用,想到了原来写过的shell一键安装部署LNMP脚本,既然shell能写,Python也一定能写,就用学到的知识写了下面这个版本,这可能并不是最优版本,等学到更多东西的时候再进行优化升级! 环境介绍: Python 2.6.6 Centos 6.5 nginx 1.10.1 mysql 5.6.34 php 5.3.3 代码如下: #!/bin/env python import os import sys def ent

lnmp平台的简单基础搭建

一.mysql的安装: 1. get mysql-boost-5.7.17.tar.gz (from 老吴) 使用mysql-boost-5.7.17.tar.gz时,查看df -h,物理空间应该大于10G tar zxf mysql-boost-5.7.17.tar.gz##解压mysql,会发现解压完后du -sh是500+M 2. 软件包依赖性: 在cmake过程中需要使用到gcc.gcc-c++编译器.ncurses-devel.cmake yum install -y gcc gcc-

Owncloud安装配置

1.更改yum源mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backupwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoyum clean allyum makecachesetenforce 0systemctl stop firewalldsystemctl disable