前言:
在此我先吐槽一下。用Centos系统简直是为难我自己,是看到那个系统
感到无比的绝望。
正文:
自己在虚拟机中搭建Ubuntu系统。这里就不说了
安装好之后自己换源。建议的源:
清华源:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
清华源官方站:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
换好源之后进行一系列的安装:
sudo apt-get install apache2
sudo apt-get install php5 php7-gd php-xml-parser php7-intl php7-mysql
sudo apt-get install curl libcurl3 php7-curl
sudo apt-get install mysql-server mysql_secure_installation
然后进php降级将7.0切换到5.6
安装php5.6
添加源 sudo add-apt-repository ppa:ondrej/php 安装php5.6 sudo apt-get update
sudo apt-get install php5.6
sudo apt-get install libapache2-mod-php5.6
sudo apt-get install php5.6-mysql php5.6-mbstring php5.6-mcrypt php5.6-xml
版本切换
1.从PHP 5.6 切换到 PHP 7.0 sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
update-alternatives --set php /usr/bin/php7.1
2.从PHP7.0切换到5.6 sudo a2dismod php7.0
sudo a2enmod php5.6
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php5.6
去owncloud官网下载owncloud10。
解压owncloud到web目录下 [plain] view plain copy
$ sudo tar xjf owncloud-9.0.2.tar.bz2
$ sudo cp -r -v owncloud/ /var/www/html/ 设置owncloud下的目录权限
[plain] view plain copy
$ sudo mkdir data
$ sudo chown -R www-data:www-data data
$ sudo chown -R www-data:www-data config
$ sudo chown -R www-data:www-data apps 配置web服务器
[plain] view plain copy
$ sudo nano /etc/apache2/apache2.conf
[plain] view plain copy
#修改如下内容,将AllowOverride对应的值改为All
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
[plain] view plain copy
$ sudo service apache2 restart
$ sudo a2enmod rewrite
Module rewrite already enabled
$ sudo a2enmod headers
Module headers already enable<pre name="code" class="plain">$ sudo service apache2 restart
然后进入localhost/owncloud进行安装。成功图