vim /etc/selinux/config
SELINUX=enforcing → SELINUX=disabled #设置成功之后最好重启一下系统,使配置生效
rpm -qa | grep mariadb
yum -y remove mariadb-libs-5.5.52-1.el7.x86_64
tar -xvf MySQL-5.6.26-1.linux_glibc2.5.x86_64.rpm-bundle.tar
rpm -ivh MySQL-*.rpm
cp /usr/share/mysql/my-default.cnf /etc/my.cnf
vim /etc/my.cnf
#添加以下配置
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
max_allowed_packet = 100M
innodb_buffer_pool_size = 512M
max_connections = 2000
#初始化数据库
/usr/bin/mysql_install_db
#启动数据库
service mysql start
#设置数据库开机自启
chkconfig mysql on
cat /root/.mysql_secret
mysqladmin -uroot -p5Qt268OXsDyw_J3W password 12345678
#登陆数据库
mysql -u root -p12345678
#配置权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678';
#刷新配置
FLUSH PRIVILEGES;
create database owncloud;
GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'owncloud';
GRANT ALL ON owncloud.* to 'owncloud'@'%' IDENTIFIED BY 'owncloud';
flush privileges;
yum -y install httpd
service httpd start
systemctl enable httpd
yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel curl curl-devel openssl openssl-devel gcc libxslt-devel* perl* httpd-devel libicu libicu-devel
tar -xvf php-7.1.8.tar.gz
cd php-7.1.8
./configure --prefix=/usr/local/php7 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath -enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-intl --enable-zip --enable-pcntl --with-curl --with-fpm-user=nginx --enable-ftp --enable-session --enable-xml --with-apxs2=/usr/bin/apxs
make && make install
vim /etc/profile
#在末尾加入:
export PATH=$PATH:/usr/local/php7/bin
#使改动立即生效
source /etc/profile
#查看php版本
php -v
cp php-7.1.8/php.ini-production /usr/local/php7/etc/php.ini
cp php-7.1.8/sapi/fpm/php-fpm /usr/local/php7/etc/php-fpm
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
vim /etc/httpd/conf/httpd.conf
找到
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在后面添加
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php7
搜索,在 index.html后添加上index.php
DirectoryIndex index.html index.php
搜索有没有类似下面这一行:
LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so
如果没有就手动添加,否则会出现运行php文件变成下载的情况
service httpd restart
unzip owncloud-10.0.10.zip
cp -r owncloud/* /var/www/html/
chown -R apache:apache /var/www/html/
浏览器访问部署owncloud的机器IP
设置管理员账号密码,点击“存储&数据库”,设置一个数据目录,建议选择硬盘比较大的分区(最好不要使用默认的网页目录,因为别人可以不登录下载你的文件,需注意创建新的目录,需要添加apache权限,这里我们默认),配置数据库选择“MySQL/MariaDB”,填写上文中我们设置的相关数据库信息,点击“安装完成”即可
设置完毕,即代表owncloud安装配置完毕,会自动打开首页登录页