Ticket 281 ‐ Deploy and Configure ownCloud Enterprise File Sharing Platform - SupaHotBall/OE2-Group-D GitHub Wiki
Database Setup
- Create dedicated ownCloud database/user with restricted remote access
- Verify connection from app server
Application Server Setup
- Install PHP 7.x with required extensions
- Configure Apache with security headers
- Install ownCloud complete package
- Complete web-based setup wizard
Acceptance Criteria
- ownCloud accessible via HTTPS at http://.op-bit.nz/owncloud
- Successful connection to remote MySQL database
- All security measures implemented (permissions, headers)
- Admin account created with strong credentials
Log in to MySQL and create the ownCloud database:
- Code :
sudo mysql -u root -p
Create a dedicated database for ownCloud to use. We will name the database owncloud for clarity. Then, create a separate MySQL user account to manage the newly created database. Creating one-function databases and accounts is a good idea from a management and security standpoint. As with the naming of the database, choose a username owncloud. To achieve this step, execute the following MySQL commands (replace values as needed):
On the Application Server Install MySQL client (required for ownCloud setup):
Test remote database connection:
Verify connection:
Add PHP repository and update packages:
Install PHP 7.4 and required extensions:
- Code:
sudo apt install php7.4 libapache2-mod-php7.4 php7.4-common \
php7.4-mbstring php7.4-xmlrpc php7.4-soap php7.4-apcu \
php7.4-smbclient php7.4-ldap php7.4-redis php7.4-gd \
php7.4-xml php7.4-intl php7.4-json php7.4-imagick \
php7.4-zip php7.4-mysql php7.4-curl php7.4-bz2 php7.4-gmp
Set memory limit to 512M:
Verify PHP version:
If you don’t already have this, install Apache:
- Code:
sudo apt install apache2
Run this first:
sudo ufw allow OpenSSH
If you don’t allow OpenSSH before you do the configure firewall, you risk locking yourself out of the server (i.e., PuTTY can't connect anymore).
Configure firewall:
Enable required modules
Verify Apache2 is running
Add ownCloud repository for Ubuntu 22.04:
Add repository key:
Update and install ownCloud:
Create configuration file:
sudo nano /etc/apache2/sites-available/owncloud.conf
Add this secure configuration
<VirtualHost *:80>
ServerName group-f.op-bit.nz
DocumentRoot /var/www/owncloud
<Directory /var/www/owncloud>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php
FallbackResource /index.php
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Install required Apache modules:
sudo a2enmod ssl headers env rewrite dir mime setenvif
Enable site and restart Apache:
# Disable default site
sudo a2dissite 000-default.conf
# Enable owncloud config
sudo a2ensite owncloud.conf
# Restart Apache
sudo systemctl restart apache2
Access ownCloud in browser:
Complete the setup wizard:
Configure trusted domains:
N/A
N/A
https://rt.dataraster.com/Ticket/Display.html?id=281