I need help to install nextcloud on Debian

Hi ! Iā€™m new to nextcloud because Iā€™ve got a VPS since some months and I would like to have my personnal cloud and edit files directly online.
My VPS runs Debian 9 and I want my cloud to be accessible through ā€œcloud.mydomain.comā€

Following installation instructions, I unzipped the archive and putted it in /var/www/cloud.mydomain.com then setted the vhost as I want but it tells me ā€œinternal server errorā€ and I donā€™t know whatā€™s wrong or how to debug.

Could you help me please ? :slight_smile:

500 means Server error, that can mean a lot.
Do your provider have any log files, for the vHost, you can post?
Can you open a Textfile from your NextCloud Installation like
http://cloud.mydomain.com/robots.txt ???

Hi, thanks for your answer. I have access to every log and use Apache web server. Which one do you need ?
I donā€™t have robots.txt file.

If you have installed nextcloud, there must be a robots.txt. If you open a .php file, it will be parsed from the server and the server only give you the output. If you open a .txt file, it opens directly. So we can see, if itā€™s a php / server error or not. Maybe you have used a wrong Directory for your installation if you have a 404 error.

Is there a ā€œerror.logā€ or something from Apache?

Sorry Iā€™ve found the robots.txt file, it contains :

User-agent: *
Disallow: /

And the apache log file ends with :

[Sun Jul 08 17:10:45.968009 2018] [:error] [pid 20498] [client 92.170.211.216:60092] {ā€œreqIdā€:ā€œB6gtyYR19sXEiBQdundtā€,ā€œlevelā€:3,ā€œtimeā€:ā€œ2018-07-08T15:10:45+00:00ā€,ā€œremoteAddrā€:ā€œ92.170.211.216ā€,ā€œuserā€:ā€œā€“ā€,ā€œappā€:ā€œPHPā€,ā€œmethodā€:ā€œPOSTā€,ā€œurlā€:ā€œ/nextcloud/index.php/heartbeatā€,ā€œmessageā€:ā€œchmod(): No such file or directory at /var/www/cloud.mydomaine.com/nextcloud/lib/private/Log/File.php#137ā€,ā€œuserAgentā€:ā€œMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36ā€,ā€œversionā€:ā€œā€}

So you open the file on your browser like:
http://cloud.mydomain.com/robots.txt
If that happen, you have installed it in the correct Directory.

Is there a ā€œerror.logā€ or something from Apache?
How much log Files do you see? If itā€™s a VPS, maybe itā€™s storaged in /var/log/apache
The situation you describe may caused by a lot of errors, you must show us some logfile, that we can help you:

  • Have you selected a working php version?
  • Does the Script have the right permissions?

So you post again, here is my next answer. Please try to open
http://cloud.mydomain.com/nextcloud/index.php
Maybe you have installed it to the wrong Directory.

Yes I can open http://cloud.mydomain.com/robots.txt on my browser. And my vhost is correctly configured because I see the blue home page of nextcloud but it tells me (in french) : ā€œInternal server error, the servor cannot execute your request.ā€
Iā€™ve made some modifications to show you :wink: Here you can see : http://145.239.223.19/index.php

NOW i understood what you say. Iā€™ll think the Apache WebServer server got the 500 error Message.
Have you edit the file
/var/www/cloud.mydomain.com/config/config.php
and set up ā€œlogfileā€, ā€œloglevelā€ and ā€œlog_typeā€?
My setup is:

ā€˜log_typeā€™ => ā€˜fileā€™,
ā€˜logfileā€™ => ā€˜/var/log/apache2/nextcloud.nextcloud.logā€™,
ā€˜loglevelā€™ => 2,

Per default the file is in

/var/log/nextcloud.log

Try to open it and post the error :slight_smile:

Sorry for the bad explanation ^^ english is not my main language and I didnā€™t know which infos give soā€¦ x)
I donā€™t have

/var/www/cloud.mydomain.com/config/config.php

file, only

/var/www/cloud.mydomain.com/config/config.sample.php

and I didnā€™t made any changes on it. I checked the file and your values are the same that default ones.
I checked and saw that log file didnā€™t exists so I did copy the sample config file to config.php but it didnā€™t change anything : no log file was created on /var/log/
I also tried to put only your rules on config.php as :

<?php $CONFIG = array( 'log_type' => 'file', 'logfile' => '/var/log/apache2/nextcloud.nextcloud.log', 'loglevel' => 2); ?>

but it didnā€™t change anything. I read the log documentation and enabled ā€˜debugā€™ feature. Now I have more informations :

  • Type : OC\HintException
  • Code : 0
  • Message : Canā€™t write into config directory!
  • Fichier : /var/www/html/lib/private/Config.php
  • Ligne : 251

Trace

#0 /var/www/html/lib/private/Config.php(132): OC\Config->writeData()
#1 /var/www/html/lib/private/SystemConfig.php(100): OC\Config->setValue(ā€˜instanceidā€™, ā€˜oci33ibvwi2kā€™)
#2 /var/www/html/lib/private/legacy/util.php(1166): OC\SystemConfig->setValue(ā€˜instanceidā€™, ā€˜oci33ibvwi2kā€™)
#3 /var/www/html/lib/base.php(427): OC_Util::getInstanceId()
#4 /var/www/html/lib/base.php(664): OC::initSession()
#5 /var/www/html/lib/base.php(1081): OC::init()
#6 /var/www/html/index.php(40): require_once(ā€˜/var/www/html/lā€¦ā€™)
#7 {main}

but no log file :disappointed_relieved: Here are the actual rights of the nextcloud folder :

drwxr-xr-x 13 root root 4096 juil. 8 17:55 html

my others directories (that contains others websites) are owned by ā€˜www-dataā€™ so I tried to change owner to make nextcloud work but it didnā€™t changed anythingā€¦

the file /var/www/html/lib/private/Config.php must be writeable for the user runing your webserver.
Probably it is www-data.

So you may change the owner of the Config.php file (and the above directories to this user.

OMG youā€™re the bests :stuck_out_tongue: but why isnā€™t it automatic ?
I have a little other question : the vhost of the documentation is juste an example ? We can use our own virtualhost file ? :slight_smile:

which installation instruction did you use? but of course you can adjust the vhost config to your needs.

automatic? a zip/tar-file is just a container. you would a package file or a install script. e.g.

I was following this documentation :

https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html#installing-on-windows-virtual-machine

But itā€™s not very good, it miss many detailsā€¦ Iā€™ll try yours :wink:

You probably extracted the archive while being root and therefore the files are owned by root. You can just chown them to www-data.

Okay :slight_smile: yes I did it and it worked :slight_smile:
Iā€™m doing some tests and discovering nextcloud interface :slight_smile:

mine is a ā€œscriptā€ (ansible playbook). when you run it, it will install nextcloud completely. nevertheless it wonā€™t run on your server because you have already an existing apache installation. my script canā€™t handle this.

but you find many information here:

all the setup and configs in my scripts are from this page.

Okay, thanks for the information. I checked but itā€™s about nginx and Iā€™m using apache ^^

Hi ! My apache modules ā€œenvā€ & ā€œrewriteā€ are enabled and my ā€œconfig.phpā€ file contains :

ā€˜htaccess.RewriteBaseā€™ => ā€˜/ā€™,

but it wont rewrite ā€œindex.phpā€

Do you have AllowOverride All set? See this for reference.

Yes :slight_smile: here is my vhost :

<VirtualHost *:80>
DocumentRoot ā€œ/var/www/cloud.mydomain.comā€
ServerName cloud.mydomain.com
<Directory ā€œ/var/www/cloud.mydomain.comā€>
Options +FollowSymlinks
AllowOverride All
allow from all
Options None
Require all granted