Install Config Wiki

All about installing, configuring and troubleshooting

User Tools

Site Tools


configure_ubuntu_server_20_04_host_nextcloud_hub_21

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
configure_ubuntu_server_20_04_host_nextcloud_hub_21 [2021/04/28 04:12] – [Extract the Downloaded nextcloud.zip file to the root directory of the Website virtual directory] wikiadminconfigure_ubuntu_server_20_04_host_nextcloud_hub_21 [2021/04/29 03:56] (current) – [Configure an Apache Virtual Host File for the Fully Qualified Domain and Local IP] wikiadmin
Line 945: Line 945:
  
 Unzip the freshly downloaded nextcloud.zip file into the directory one step in the path before the root 'nextcloud' sub-directory of your website virtual directory, which will extract the files into the nextcloud sub-directory.  So the target subdirectory should terminate at /exampledomain_com/ because /nextcloud/ will be the sub-directory where the nextcloud files will be extracted per the structure within the Zip file. Change 'exampledomain' to your secondary domain name where it appears in the unzip path below.  You must adjust the path based on where you set up the virtual directory in your website.conf file in the /etc/apache2/sites-available/ directory, and ultimately, as the path of your website.conf file enabled in you /sites-enabled/ directory. Unzip the freshly downloaded nextcloud.zip file into the directory one step in the path before the root 'nextcloud' sub-directory of your website virtual directory, which will extract the files into the nextcloud sub-directory.  So the target subdirectory should terminate at /exampledomain_com/ because /nextcloud/ will be the sub-directory where the nextcloud files will be extracted per the structure within the Zip file. Change 'exampledomain' to your secondary domain name where it appears in the unzip path below.  You must adjust the path based on where you set up the virtual directory in your website.conf file in the /etc/apache2/sites-available/ directory, and ultimately, as the path of your website.conf file enabled in you /sites-enabled/ directory.
 +
 +You can make the directory path first, or just properly extract the nextcloud.zip file to create the path.  For example, run the following and substitute your fully qualified secondary domain name instead of domain_org in the following new web path.
 +
 +<code>
 +cd /var/www/
 +
 +sudo mkdir /var/www/domain_org/
 +
 +cd /var/www/domain_org
 +
 +sudo mkdir /var/www/domain_org/public_html/
 +
 +cd /var/www/domain_org/public_html
 +
 +sudo mkdir /var/www/domain_org/public_html/domain_org/
 +</code>
  
 <code> <code>
 cd /downloads/ cd /downloads/
  
-sudo unzip nextcloud.zip -d /var/www/exampledomain/public_html/exampledomain_com/+sudo unzip nextcloud.zip -d /var/www/domain_org/public_html/domain_org/
 </code> </code>
  
Line 955: Line 971:
  
 <code> <code>
-sudo chown www-data:www-data /var/www/exampledomain/public_html/exampledomain_com/nextcloud/ -R+sudo chown www-data:www-data /var/www/domain_org/public_html/domain_org/nextcloud/ -R 
 +</code> 
 + 
 +===== Setup a MySQL Database for the Nextcloud Installation using PhpMyAdmin ===== 
 + 
 +Login as rootuser in PhpMyAdmin from a Web Browser on the local network and Create a Database for the Nextcloud Installation: 
 + 
 +Select the Database Tab, and where it says New Database Name, provide the following information. 
 + 
 +Example: 
 + 
 +database name: yourusername_nextcloud   
 +Create it. 
 + 
 +Select that new empty Database from the left panel. 
 + 
 +Select the Privileges tab. 
 + 
 +Create the Username - yourusername - and select 'Grant All Privileges' for the username on the new Database. 
 + 
 +db username: yourusername 
 + 
 +on: localhost 
 + 
 +db Password: $Pwd#4646116 (Something that meets the applicable complexity requirements) 
 + 
 + 
 +===== Configure Apache for Nextcloud ===== 
 +Enable a few Apache modifications for Nextcloud to properly run. I believe that this enables the URL Rewrite Module. 
 + 
 +<code> 
 +sudo a2enmod headers env dir mime rewrite 
 + 
 +sudo service apache2 restart 
 +</code> 
 +===== Configure an Apache Virtual Host File for the Fully Qualified Domain and Local IP ===== 
 + 
 +Change directories to the sites available virtual host subdirectory. 
 + 
 +<code> 
 +cd /etc/apache2/sites-available/ 
 + 
 +ls 
 + 
 +</code> 
 + 
 +<code> 
 +sudo cp 000-default.conf yourdomain-org.conf 
 +</code> 
 + 
 +<code> 
 +sudo vim yourdomain-org.conf 
 +</code> 
 + 
 +<code> 
 +<VirtualHost *:80> 
 + 
 +    ServerName yourdomain.org  www.yourdomain.org 
 +    DocumentRoot /var/www/yourdomain_org/public_html/yourdomain_org/nextcloud 
 + 
 +    <Directory /var/www/domain_org/public_html/domain_org/nextcloud/> 
 +        Require all granted 
 +        AllowOverride All 
 +        Options FollowSymLinks MultiViews 
 + 
 +        <IfModule mod_dav.c> 
 +            Dav off 
 +        </IfModule> 
 + 
 +        RewriteEngine On 
 +        RewriteRule ^/\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L] 
 +        RewriteRule ^/\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L] 
 +        RewriteRule ^/\.well-known/host-meta https://%{SERVER_NAME}/public.php?service=host-meta [QSA,L] 
 +        RewriteRule ^/\.well-known/host-meta\.json https://%{SERVER_NAME}/public.php?service=host-meta-json [QSA,L] 
 +        RewriteRule ^/\.well-known/webfinger https://%{SERVER_NAME}/public.php?service=webfinger [QSA,L] 
 + 
 +    </Directory> 
 + 
 +    ErrorLog ${APACHE_LOG_DIR}/error.log 
 +    CustomLog ${APACHE_LOG_DIR}/access.log combined 
 + 
 +</VirtualHost> 
 +</code> 
 + 
 +===== Enable the Virtual Host ===== 
 + 
 +<code> 
 +cd /etc/apache2/sites-available 
 + 
 +sudo a2ensite yourdomain-org.conf 
 + 
 +sudo systemctl reload apache2 
 </code> </code>
configure_ubuntu_server_20_04_host_nextcloud_hub_21.1619583129.txt.gz · Last modified: 2021/04/28 04:12 by wikiadmin