Open main menu

CDOT Wiki β

Changes

OPS345 Lab 4

1,778 bytes added, 03:40, 9 January 2022
Install Nextcloud
We're going to install a handy web application in order to get some real world practice setting up our database. Nextcloud has all kinds of capabilities, the most obvious one is that you can use it to share files (of any size) with specific users or make them public for anyone to access.
  <source><* Download the latest version of Nextcloud for self-hosting from the [https:/source><source></source><source><nextcloud.com/source>Nextcloud website].* wget * Make sure you get the .tar.bz2 (file, not the .zip file. The zip)format doesn't support permissions.** Remember you want this file on your web server, not on your workstation. Use wget on '''www''' to download it straight on there.* Extract * You might as well download it straight into /var/www/html** Remember your web server doesn't have direct access to the internet: you'll need to assign it a temporary elastic IP.* Extract the file in /var/www/html so you have end up with a /var/www/html/nextcloud/index.htmlfile (among ''many'' others):[[File:AWSExtractNextcloud.png|800px|border|center]]* We'll be following [https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.htmlthis Nextcloud documentation page] to set it up.*Since you regular user doesn't have permission to edit the web server configuration: switch to root.* As root, vi Create /etc/httpd/conf.d/nextcloud.conf and paste these contents into it:<source>Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
</IfModule>
</Directory></source>
** Change the ownership of the entire nextcloud directory so it's owned by the user that runs the web server:<source>chown -R apache.apache /var/www/html/nextcloud/</source>** Get Go to the installer using your web browser to see an error: <source>This telling you that the version of Nextcloud requires at least your PHP 7is too old:[[File:AWSNextcloudNeedsNewerPHP.3png|border|center]]You are currently running 5This is a relatively common error these days.4Many long-term-support Linux distributions come with older versions of PHP.16You'll need to install a newer one on your server. Please update your * On CentOS you would look for the newer PHP in the EPEL repository. With Amazon Linux you will find the newer version.of PHP in Amazon Linux Extras:</source>** amazon-linux-extras | grep php** amazon-linux-extras enable php7.4** yum clean metadata** yum install php-cli php-pdo php-fpm php-json php-mysqlnd** systemctl restart apachehttpd</source>** Get module errors from websiteTry accessing the installer in Firefox again. Note the error looks more pretty, install thembut it's still not working because we're missing some modules: [[File:AWSNextcloudMissingModules.png|800px|border|center]]*** You can get those modules from Amazon Linux Extras as well:<source>amazon-linux-extras enable httpd_modules*** yum install php-dom php-gd php-mbstringsystemctl restart httpd</source>** Should now let Now you can continue with the setupin Firefox.** Create an admin administrator accountwith a good username and password. Remember that your web server is exposed to the entire internet, so don't be cheap with your password complexity. Use ops345admin/nextcloudadminpass** You need an SQL database, with an SQL user who can access it, and a password. Follow the steps in the previous section to set these up and input them into the Nextcloud setup. 
** Create a new database and user and password nextclouddb/nextclouduser/nextclouddbpassword
*** CREATE DATABASE nextclouddb;