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 03:44] – [First, Install OpenSSH on Linux Ubuntu Server to Provide Yourself Remote Access] 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 295: Line 295:
 After this PPA is enable, then PHP 8 can be installed.  In addition, PHP 8 can be installed and configured as an Apache module.  Php-FPM is a FastCGI process manager for PHP and requires the installation of some extra packages.  By default, Php-FPM is not enabled in Apache.    After this PPA is enable, then PHP 8 can be installed.  In addition, PHP 8 can be installed and configured as an Apache module.  Php-FPM is a FastCGI process manager for PHP and requires the installation of some extra packages.  By default, Php-FPM is not enabled in Apache.   
  
-**Install PHP 8 and then some required libraries for Nextcloud**+**Install PHP 8 as well as some required libraries for Nextcloud**
  
 <code> <code>
Line 326: Line 326:
 </code> </code>
  
-===== Install PHP as Apache Module ===== +===== Configure PHP as Apache Module ===== 
-Installing PHP as an Apache module is a straightforward task. The case may be that php8.0 libapache2-mod-php8.0 is already installed, but you may try and be the newest version is already installed.+It may be that php8.0 libapache2-mod-php8.0 is already installed at this point.  If or when you may try to do so, you may find that the newest version is already installed.  Give it a try.
  
 <code> <code>
Line 351: Line 351:
 </code> </code>
  
-By default, PHP-FPM is not enabled in Apache.  Toi enable PHP-FPM run:+By default, PHP-FPM is not enabled in Apache.  To try to enable PHP-FPMrun the following:
  
 <code> <code>
Line 358: Line 358:
 </code> </code>
  
-This may already be enabled, and you will see the follow echo in terminal:+Again, this may already be enabled, and you will see the follow echo in terminal:
  
 <code> <code>
Line 899: Line 899:
 </code> </code>
  
 +====== Installing NextCloud 21.0.1 on Linux Ubuntu 20.04 LTS with Apache2 Webserver ======
  
 +Open PhpMyAdmin and Create a Database:
  
 +Example:
 +
 +database name:  yourusername_nextcloud
 +
 +Select the Database from the left panel
 +
 +Create Username - yourusername - and Grant All Privileges for the username on the database.
 +
 +db username:  yourusername
 +
 +on:  localhost
 +
 +db Password:  $Pwd#4646116  (Something that meets complexity requirements)
 +
 +===== Download the NextCloud 21.0.1 Zip File to the Server =====
 +
 +SSH to login to the server and obtain a command line prompt.  Make a directory names downloads. 
 +
 +<code>sudo mkdir /downloads/</code>
 +
 +Change directory to the downloads directory:
 +
 +<code>cd /downloads/ </code>
 +
 +Download the nextcloud-21.0.1.zip file using the option to change the target filename to nextcloud.zip in the /downloads/ directory.
 +
 +<code> 
 +sudo wget -O nextcloud.zip https://download.nextcloud.com/server/releases/nextcloud-21.0.1.zip
 +</code>
 +
 +
 +===== Extract the Downloaded nextcloud.zip file to the root directory of the Website virtual directory =====
 +
 +Example Extract Folder to the path of the root directory of the website:
 +
 +/var/www/exampledomain/public_html/examledomain_com/nextcloud/
 +
 +**First, Install the Unzip utility**
 +
 +<code>sudo apt install unzip </code>
 +
 +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>
 +cd /downloads/
 +
 +sudo unzip nextcloud.zip -d /var/www/domain_org/public_html/domain_org/
 +</code>
 +
 +Make the Apache web-user the owner of the nextcloud directory so that the Apache server has access to the website root and all subdirectories.
 +
 +<code>
 +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>
configure_ubuntu_server_20_04_host_nextcloud_hub_21.1619581494.txt.gz · Last modified: 2021/04/28 03:44 by wikiadmin