Installation for dummies, nay idiots

Folks, I confess to being as dumb as it gets and in every attempt at trying new programming languages, new applications the biggest problem for people like me is versions and explanations. Here’s an example. On this page https://docs.nextcloud.com/server/19/admin_manual/installation/source_installation.html

It talks about installing php. So I download and extract the zip file to my Ubuntu 16 system and then it is not clear what to do. So I look further and check to see that php is installed. It is not, so I install it from this link https://www.liquidweb.com/kb/install-php-7-2-ubuntu-16-04/

Ok so next the pre-requisites make me wonder if I have all of the modules installed. So I check them one by one (surely a script could help here but I’m not at that level to do so yet). I find some are missing. So I try to install them with the usual apt-get install php2.7-modulename. Sometimes I get a response like “selecting ‘php7.2-common’ instead of 'php7.2-iconv”… So I look for php7.2-common and can’t find anything about it. Ok so I ignore that thinking I will get back to it and maybe the iconv module is resident inside of common.

In my wanderings in trying to figure this out I find “apt-cache search php” and this delight provides me with and output that lists php7.4 modules. Really ? Where did that come from because sure as anything I can’t find them. I purge php7.2 thinking php7.4 is installed and then try php -v which tells me that there is no php installed. Jeez. Sometimes it pays to add all of the details to the destructions for people like me who need handholding. I also looked at installing nextcloud from Ubuntu’s Software Install list. And lo and behold there it is Nextcloud ! So I install it and – can’t find it anywhere … But searching provides a snap install folder. So I go back to the Ubuntu SW installation and select nextcloud and lo and behold “Launch” appears. Why I needed to go back there I don’t know, but I did and thought I had found my solution. But alas no- trying to launch it I get Failed to execute child process “/snap/bin/nextcloud.apache” (No such file or directory). Hmm so in /snap/bin indeed there is no nextcloud.apache file… But those instructions have left me stranded with (a) An inability to add modules that tell me common is available and used, but I cannot find what common does, (b) The Ubuntu Software seems to have installed everything except the nextcloud.apache file which sounds suspiciously like the nextcloud.conf file. So lets take the nextcloud.apache file and put it into /snap/bin/nextcloud.apache file. Alas we get “Failed to execute child process “/snap/bin/nextcloud.apache” (Permission denied)”. But all of the other files in that folder belong to root… OK so let’s forget the Ubuntu SW installed nextcloud and given that the installation instructions from nextcloud tell me to create a nextcloud.conf file lets create that. OK, so it seems I need sudo to edit / create the /etc/apache2/sites-available/nextcloud.conf file. So I sudiously do so (attempt at humour). The desctructions then say " On Debian, Ubuntu, and their derivatives, Apache installs with a useful configuration so all you have to do is create a /etc/apache2/sites-available/nextcloud.conf file with these lines in it, replacing the Directory and other filepaths with your own filepaths:"

Here’s where idiots like me get tripped up. Which filepaths are the instructions talking about ? Do you mean the file path for where my zip file was extracted from ? This is where prescription helps a lot for people like myself who are trying to figure this stuff out. OK so i use that folder where I unzipped the file as the directory entered into the nextcloud.conf file , I then enable the new site with a2ensite nextcloud.conf and lo and behold “Enabling site nextcloud.
Could not create /etc/apache2/sites-enabled/nextcloud.conf: Permission denied”

So i use sudo and it tells me that “Enabling site nextcloud.To activate the new configuration, you need to run:
service apache2 reload”

So I do that without elevated permissions and "Site nextcloud already enabled "is the retort. OK I’m thinking… Making some progress finally. I tell apache2 to restart with “sudo service apache2 restart” and it does. OK I think let me look at apache running on my ip address and it does. I dutifully follow the next instruction " For Nextcloud to work correctly, we need the module mod_rewrite . Enable it by running: “a2enmod rewrite” and it tells me it is enabled.

OK so I enable the other modules of which only headers is not running all the other enablements say the module is running.

Next instructions say
“After restarting Apache you must complete your installation by running either the graphical Installation Wizard, or on the command line with the occ command. To enable this, change the ownership on your Nextcloud directories to your HTTP user:” OK I do that and go to https://docs.nextcloud.com/server/19/admin_manual/installation/installation_wizard.html
I am told to go to localhost/nextcloud but the server’s retort is
"Forbidden

You don’t have permission to access this resource.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80"

I look in my users and groups and don’t find www-data as users or groups. I wonder if that is my problem.

My intent in this tome is to ask the folks who write instructions to assume a lot of people are like myself trying to get things working. Obviously any help you can provide in solving this particular problem of permissions related to my specific problem would be very helpful, but more specifically as these instructions are written explain when elevated levels are required, explain what paths are used and be explicit about the details. Tx for listening :wink:

I don’t use Ubuntu (I’m on FreeBSD) so I can’t help with every detail, but a few things you said jumped out at me.

Is there a reason you didn’t use apt for this like you did with other components? When at all possible, you should use you OS’s packaging system to ensure everything works together and can be maintained. Your webserver (Apache) also needs to be configured to work with PHP, which your package manager should help with.

Nextcloud is a website/platform that needs to be hosted on a webserver. You don’t run or configure Nextcloud directly where it is, you configure it through an installation interface via your webserver.

You managed to install the snap version. I have no experience with snap.

I know you said you don’t like explanations, but you should probably read up on how Nextcloud and Apache work! You won’t be able to install and configure it if you don’t understand the basics of running a webserver.

You didn’t list the contents of that file, so I can’t say for sure! I’m going to guess it’s referring to the filepath of your site, the “documentroot”. On FreeBSD, Nextcloud goes in “/usr/local/www/nextcloud/”, for you it’s probably somewhere in /var. Do a file search for “nextcloud” and see if you can find where it’s installed.

Here’s a basic example of what you’ll need in that conf:

<VirtualHost *:80>
    DocumentRoot /usr/local/www/nextcloud
    ServerName localhost
</VirtualHost>

Notice the “documentroot”? That’s the filepath that is specific to each platform or setup. The “servername” is the URL/location you’re putting into your browser to access Nextcloud. I’m using port 443 because the site’s encrypted, but you’ll probably need port 80 for now. Get that working before you start worrying about configuring TLS encryption!

That’s because Apache only reads it’s conf files on startup. You need to stop then restart Apache (or reload it) for an updated config to work.

Possibly. I know you don’t want to hear this, but you should have a better understanding of Apache before you start. Even if you just set up a basic “Hello world” website so you know Apache is working.

Modern webservers are powerful things, capable of running complex platforms (such as Nextcloud) that can host powerful apps. It’s not like the old days of setting up a consumer DVD player. These things take time to learn, you can’t go from zero to leet sysadmin in an afternoon.

While some guides are better written than others, it’s simply not possible to dumb everything down to a noob level. You have to do this component at a time.

I taught myself this stuff bit by bit. I got Apache working, and set up a basic website. There are guides for this online that you should be able to follow easily. I then got TLS working with self-signed certificates (there’s services like Let’s Encrypt nowadays that mean self signed isn’t necessary!) Then I learned how to get PHP working with Apache.

By learning each bit separately, you won’t get confused or overwhelmed.

I mean, you weren’t even installing the individual software components consistently! You need to get the first bit working before you start on the next bit. And Nextcloud requires a lot of bits! I mean, you didn’t mention any databases in your post, and Nexcloud requires a database (MySql, ProgreSQL, MariaDB, etc). Even if we had simple answers for your complex questions, you’d still be stuck when Nexcloud asks for DB details during setup.

I don’t mean to sound harsh, but seriously, it is simply not possible to provide simple instructions. I mean, you’re using Ubuntu, I’m using FreeBSD, others are using Gentoo, or OpenBSD, or Arch, or Windows. The filepath is different on each platform, and with those platforms the path is different if you install Nexcloud directly or via snap. No guide can cover every permutation. You need to have a basic understanding of how to use your OS for a start, and how to find things referenced in the guides.

I hope that helps more than it annoys you! Seriously, it was a huge red flag when you started your tome by saying people like you have a problem with explanations :stuck_out_tongue_winking_eye:

Many thanks for your patient explanatiosn DarkSteve. They are most helpful. If I may allow me to take each of your questions individually and confess where I need to confess :wink:

(1) Is there a reason you didn’t use apt for this like you did with other components? When at all possible, you should use you OS’s packaging system to ensure everything works together and can be maintained. Your webserver (Apache) also needs to be configured to work with PHP, which your package manager should help with.

(1A)There is no package for nextcloud that I could find using apt-get install nextcloud. I would love to be proven wrong…

(2)Nextcloud is a website/platform that needs to be hosted on a webserver. You don’t run or configure Nextcloud directly where it is, you configure it through an installation interface via your webserver.
(2A) Understood, I need to learn more about web servers

(3) You managed to install the snap version. I have no experience with snap.

I know you said you don’t like explanations, but you should probably read up on how Nextcloud and Apache work! You won’t be able to install and configure it if you don’t understand the basics of running a webserver.
(3A) To be honest, I also did not get expect to have snap install anything. I just went to a Ubuntu application called Software and found nextcloud and pointed to the “install” button and off it went. I apologize if I came across as not wanting explanations, but I am far from that position, any explanation you can provide would be most helpful, Which is what you are doing. I will and have tried to read about Nextcloud and find that the only way I can really understand how something works is by installing it and running it. Alas I get stuck and don’t know where to go. For example, in the installation instructions I am told to install php modules. Well, when I try to do so even given the fact that I have added the repository to my list, it does not find them. In particular the database repository.
I have searched for answers to the “not found” problem but have been singularly unsuccessful

(4) You didn’t list the contents of that file, so I can’t say for sure! I’m going to guess it’s referring to the filepath of your site, the “documentroot”. On FreeBSD, Nextcloud goes in “/usr/local/www/nextcloud/”, for you it’s probably somewhere in /var. Do a file search for “nextcloud” and see if you can find where it’s installed.

(4A) In the instructions on this page https://docs.nextcloud.com/server/19/admin_manual/installation/source_installation.html it tells me to set up my apache config file. It points to a path that includes www, but does not explain what that path signifies. I discovered that it refers to where my nextcloud installation is located. But the installation instructions don’t tell me where to install nextcloud so I just installed in my home folder. I added that path and it seemed to work. However your answer certainly did provide a useful explanation. I understand that you are using SSL and I will probably do the same. In addition, I am going to have to put a hole through my pfsense firewall so it can be accessed by others,

(5) Possibly. I know you don’t want to hear this, but you should have a better understanding of Apache before you start. Even if you just set up a basic “Hello world” website so you know Apache is working.
(5A) I smile when I read this. I do want to know to be honest and understand that my configuration file in apache provides access to the nextcloud functionality. What I am asking for (and you are generously providing) are steps that will help me get out of my quandary of some kind of permission issue. I will complicate the problem now and say that I removed my previous installation by removing the apache config file and the entire nextcloud subdirectory tree and installed the system from the tar file not the zip file. I then tried the configuration wizard and got to the nextcloud registration panel(note that last time using the zip file vs the current tarball I got an access denied error. That is where I was confronted with the issue that I needed to access a database, which was not installed since I could not find that php module. So a small dragon was vanquished, but the castle walls stand in my path - as it were

(6) Modern webservers are powerful things, capable of running complex platforms (such as Nextcloud) that can host powerful apps. It’s not like the old days of setting up a consumer DVD player. These things take time to learn, you can’t go from zero to leet sysadmin in an afternoon.

While some guides are better written than others, it’s simply not possible to dumb everything down to a noob level. You have to do this component at a time.

(6A) I have no truck with what you say - since it is patently true. What I am trying to point out is the difficulties that people like myself have with specific areas of instructions such as the assumption that people know where to find certain resources, that they understand and know where to find answers that elude them and that if a platform is to become popular - especially with people who are not expert in dealing with SW, some basic steps could be helpful. For example - that list of modules - where are they all ? Or why all of a sudden does a user www-data and an attendant group show up ? What does the " Pretty URLs remove the index.php -part in all Nextcloud URLs" refer to ? What is the index.php ? I assume it is some equivalent of a php drive web page. But why is there no context nor explanation in this segment of the instructions

This is all not to push back on your valuable advice, Rather it is a plea for those who write manual and instructions like this to decide who their audience is. Clearly they already did implicitly through their writing,. What I am saying is that the audience could be much broader, the impact much more significant (at least IMHO) if the assumptions were more explicit.

I take your point
“By learning each bit separately, you won’t get confused or overwhelmed.”
but for me I could not really figure out what the “bits” were. Some just erupted on the page :wink:

So thank you for your studious reply, Hopefully I will be able to get this thing working as my proposed business depends on it to some degree. I just hate the fact that companies like FAG (Facebook, Amazon Google) are robbing us of our privacy and so for me nextcloud is not just a nice to have. Yes, I could go and pay for this, but then what have I learned about managing my customers’ information safely for them

@parry