Ubuntu 配置NextCloud
安裝常用軟件:
1: SSH sudo apt-get install openssh-server
ssh啟用root登陸:vi /etc/ssh/sshd_config 註釋掉#PermitRootLogin prohibit-password 下面添加PermitRootLogin yes
2: 默認啟動界面更改: sudo systemctl set-difault multi-user.target / graphical.target
3:啟用root用戶 sudo passwd -u root
4: vim sudo apt-get instal vim
安裝Apache
sudo apt-get install apache2
安裝Mysql
sudo apt-get install mysql-server mysql-client
測試:mysql -uroot -p 查看狀態:service mysql status
創建nextcloud數據庫: create database nextcloud set utf8;
安裝PHP模塊
sudo apt-get install libapache2-mod-php
sudo apt-get install php-mysql
sudo apt install -y php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip
重啟服務:service apache2 restart service mysql restart
測試Apache能否解析PHP:
vim /var/www/html/phpinfo.php
文件中寫:<?php echo phpinfo();?>
瀏覽器訪問:http://ubuntu地址/phpinfo.php,出現PHP
修改權限 sudo chmod 777 /var/www
安裝phpMyAdmin sudo apt-get install phpmyadmin
創建phpmyadmin快捷:ln -s /usr/share/phpmyadmin /var/www/html
啟用Apache mo_rewrite模塊: a2enmod rewrite
重啟服務: service php7.0-fpm restart service apache2 restart
測試,瀏覽器訪問: http://ip/phpmyadmin
安裝NextCloud
cd /var/www/html
wget https://download.nextcloud.com/server/releases/nextcloud-13.0.3.zip
unzip nextcloud-13.0.3.zip
設置 nextcloud 的目錄權限:sudo chown -R www-data:www-data /var/www/html/nextcloud/
瀏覽器上輸入http://服務器IP/nextcloud後就會出現next cloud配置界面了。
Nextcloud OCC命令行工具
shijiaofa-test:/var/www/html/nextcloud #sudo -u www-data php occ -v
若出現上圖權限問題 ,設置 nextcloud 的目錄權限:sudo chown -R www-data:www-data /var/www/html/nextcloud/
Ubuntu 配置NextCloud