Build a private cloud with Nginx + ownCloud + PHP + MySQL in CentOS7
CentOS 7.1 1053 minimize the installation of LNMP through yum installation. Because CentOS 7 does not have the yum source of MySQL, You have to install the yum source of MySQL on your own, but it is installed, the yum installation speed is only several dozen K, So I simply downloaded the mysql-server rpm package from the yum source, and then used the rpm package installed through yum, saving a lot of time, for how to set up LNMP, refer to the following connection. Remember to disable selinux. Otherwise, File not found will be prompted.
Build and install the LNMP production environment in CentOS 6.4
Practical Production Environment-LNMP architecture compilation and installation + SSL encryption implementation
LNMP full-featured compilation and installation for CentOS 6.3 notes
Install LNMP in CentOS 6.3 (PHP 5.4, MyySQL5.6)
Nginx startup failure occurs during LNMP deployment.
1. Download owncloud and decompress the website directory
[Root @ node3 ~] # Axel https://download.owncloud.org/community/owncloud-8.0.3.tar.bz2
2. Add an nginx VM
This configuration file can't be found using Baidu for half a day. I finally found it using Google ...... I couldn't find it in my documents on the official website. Google found it ...... There are two types of configurations on the official website: Enable ssl and how to change it to a configuration file without ssl. Here I post my own configuration file that does not use ssl.
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/share/nginx/html/owncloud /;
# Set max upload size
Client_max_body_size 10G;
Fastcgi_buffers 64 4 K;
# Disable gzip to avoid the removal of the ETag header
Gzip off;
# Uncomment if your server is built 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. 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 // 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;
}
}
3. Restart nginx and access
An error occurs during access. If the required php module is missing, run the following command. Restart php-fpm.
[Root @ localhost ~] # Yum install-y php-dom php-xmlwriter php-gd
Refresh again.
4. Configure the database
Mysql> grant all on *. * to 'everyoo' @ '%' identified by 'everyoo ';
Query OK, 0 rows affected (0.03 sec)
Mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
Error again, permission problem, data DIRECTORY missing
[Root @ localhost owncloud] # mkdir data
[Root @ localhost owncloud] # chown-R apache. apache.
Again, I don't know why I use localhost and 127.0.0.1.
I had to use the IP address of the local machine, but still reported an error. A database user with a prefix is not the one I entered.
You only need to modify the configuration file to the one created.
[Root @ localhost owncloud] # vim config/config. php
Configure again.
Install OwnCloud 7.0.4 on Ubuntu
Building personal private cloud storage ownCloud in CentOS 6.3
Install ownCloud 4.0.6 platform on Ubuntu 12.04 LTS
OwnCloud 6.2 installation in CentOS 4.0
Use ownCloud in Ubuntu 12.04 to build a private storage cloud
How to install OwnCloud 6 in Ubuntu/Debian/CentOS/Fedora/OpenSUSE and derivative systems