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:

https://www.c-rieger.de/

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