Posts by NogNeetMachinaal

    Not out of the box, because for netcup webhostings the paths to the data directory in the SSH console and in a web process are different.

    So, to cope with that, you have to use a solution like e.g. this one.


    Perhaps true (and I'm overlooking something) - but if I add that config file to the config-folder, then nextcloud as whole becomes unavailable. It complains about folder rights and a missing file called ".ocdata". So I removed it.

    This morning, I tried a manual upgrade with this install:

    • Nextcloud main: /httpdocs/some.host.de/main
    • Nextcloud data: /httpdocs/some.host.de/data
    • Nextcloud tmp: /httpdocs/some.host.de/tmp

    I renamed the current ../main-folder to ../main-2022jan8

    Then uploaded nextcloud.zip containing the next new version.

    This was then extracted to the folder ../nextcloud.

    After which it was renamed to ../main.


    I then connected to some.host.de and it suggested an upgrade through the web interfaces.

    Which was granted (of course). After a suggested retry it completed succesfully.


    Once this was completed and I did a new login, the Nextcloud-server suggested another upgrade.

    Which was started and completed without any manual interference.

    Meaning nothing else was done from my end (other then a confirmation on using the webui for the upgrade).


    At this time I have a running nextcloud with semi-automatic updates and no running errors in the log.

    Meaning there is only an error when clicking on system info.


    The for me relevant settings in config.php:

    Code
    'datadirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/some.host.de/data',
    'tempdirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/some.host.de/tmp',
    
    'overwrite.cli.url' => 'https://some.host.de/',


    The underlying webhosting package is Webhosting 2000



    Thank you for the support and patience.


    Interesting - it looks like you have the data folder stored outside of the nextcloud install?


    You/helpy:

    Nextcloud main: httpdocs/domain.example/cloud/nextcloud

    Nextcloud data: httpdocs/domain.example/cloud/nextdata


    Me/NogNeetMachinaal:

    Nextcloud main: httpdocs/nc.it-visibility.net

    Nextcloud data: httpdocs/nc.it-visibility.net/data


    Will give that a try.


    Thank you


    =====


    Edit: tried that with (no improvements):

    Nextcloud main: /httpdocs/nc.it-visibility.net/main

    Nextcloud data: /httpdocs/nc.it-visibility.net/data

    Here, no changes for the data-dir in config.php.


    Also tried with:

    Nextcloud main: ../httpdocs/nc.it-visibility.net/

    Nextcloud data: ../nc/data


    The config.php had then the following data-dir:

    'datadirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/nc/data',


    Previously this was:

    'datadirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data',


    The last one made matters worse. The login screen says:

    Code
    Your data directory is invalid Ensure there is a file called ".ocdata" in the root of the data directory. Cannot create "data" directory This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/21/go.php?to=admin-dir_permissions


    So I reverted all the changes back to the previous one with main and data.


    helpy | I'm not sure how the next question will be experienced... but still... is there a way where I can have a view on your webhosting- and nextcloud settings?


    I used the wrong portnumber in the wp-config-file... :sleeping:


    This php-script is giving me "bool(false)" - nothing else?

    To double-check: I get the same result on the one of the other websites => the ones that are working as expected.


    The php-script is below => looks very much the same as yours?


    but you created the /tmp directory?
    Can you pls. post the full error message?


    Thank you for getting back on this - really appreciated!


    Yes - the tmp-folder is there - see attached screenshot from the file manager.


    As far as starting the update process goes: there is no error => it goes straight back to the dashboard.

    Perhaps there is more in debug mode. But until now, I didn't see anything - even when setting 'debug' => true in the config.php file. Hoever, to be honest - this debug-part is a grey area => I may have missed things here...


    As for the open_basedir issue: every few seconds, the same 2 messages pop-up - see the code block with "Error log 1".

    The content of each message is the same - see the code block with "Error log 2" and "Error log 3".


    Not sure if the error log under /logs/nc.it-visibility.net has anything to do with it (see code block with "Error log 4").

    Tried with debug-mode on => no extra results.


    =====


    forum.netcup.de/system/attachment/7930/nextcloud-folder content.png





    Code
    Error log 4
    
    [Fri Jan 07 21:45:18.412588 2022] [core:crit] [pid 1405] (13)Permission denied: [client 141.101.76.57:32910] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable
    [Sat Jan 08 10:46:40.077212 2022] [access_compat:error] [pid 17499] [client 141.101.76.183:35698] AH01797: client denied by server configuration: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/config
    [Sat Jan 08 11:52:28.817008 2022] [core:crit] [pid 14483] (13)Permission denied: [client 141.101.105.83:46956] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable
    [Sat Jan 08 12:12:33.013475 2022] [core:crit] [pid 24511] (13)Permission denied: [client 141.101.104.92:32924] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable
    [Sat Jan 08 12:12:54.871065 2022] [core:crit] [pid 24566] (13)Permission denied: [client 141.101.104.92:33822] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable

    I am wondering that you can even connect to your db with

    mysqli_connect('<host>:<port>', '<database-name>', '<password>');

    because the syntax for mysqli_connect is:

    mysqli_connect('<host>', '<user-name>', '<password>', '<database-name>', '<port>');


    I know for sure that the port number defaults to 3306.

    I'm not sure about the database name - perhaps it just connects to the database service?

    And doesn't access the database at all?

    Or connects to some "default" database?


    While writing... just tried with adding the database name and port number => same result.

    I don't use my webspace account that much, but your webroot is


    Code
    "/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/"

    have you set the tmp directory on your NC config?


    Code
    'tempdirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/tmp',


    Thank you for the webroot-clarrification - makes sense.


    Didn't have the temp-dir in the config => just did => still no working update process.

    Also added a few other directory directives (templates & skeleton) => no improvements

    Hi Everyone,


    Recently, I copied an existing Wordpress website; including its underlying database.

    I then created a new DNS-domein, copied the website content to this httpdocs-root, created a new database and imported the existing database.

    The next step was adjusting the Wordpress-config file to use the newly imported database.

    In addition, modified the database table where the URL is stored.


    However - when trying to access this "new" website, it returns " Error establishing a database connection".

    When I try accessing the same database via a small php-script (see below), it returns "connected succesfully".


    The source-website is working as expected.


    What am I overlooking here?


    =====


    PHP
    <?php
        $link = mysqli_connect('<ip-address>:3306', '<database-name>', '<password>');
        if (!$link) { die('Could not connect: ' . mysqli_error()); }
        echo 'Connected successfully';
        mysqli_close($link);
    ?>


    Thank your the quick response.


    I know Nextcloud on a webhosting account can be challenging - but still - it is a php application like Wordpress and all those others... should be doable...(?)


    I know about the PHP-settings in the back-end and tried a few things - no improvements.

    The docroot-variable says:

    "/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/"

    So I guess the webspaceroot-variable is "httpdocs/nc.it-visibility.net/"?


    The domain nc.it-visibility.net is a subdomain of it-visibility.net.

    Perhaps that is messing things up - at least to some extend?


    Currently the php-setting for open_basedir says:

    {WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/}lib{/}php{/}sessions


    There is a tmp-folder in httpdocs and in httpdocs/nc.it-visibility.net/.

    Also tried with a temp-folder (for no particular reason).


    But the remaining things... what (for example) is /var/lib/php/sessions for?


    Any suggestions on what these settings should/could be like for nextcloud?

    I have two issues with Nextcloud – not sure if they are related.



    One is when opening the updater it brings me back to the openingsscreen (i.e. no update).


    The other is about lots of errors in the log – all starting with “Error: is_file(): open_basedir restriction in effect.”.


    Anyone a suggestion what to do with either of these?



    Thank you – Will

    If this wasn't your Windows device who "restored" things via the Nextcloud client and you also don't know whose Windows device it is, it might be wise to start over from scratch.

    Yes - it was my Windows device and me doing a manual restore of a backup to the sync-folder of the Nextcloud client.


    It looks like I (or somebody else?) was able to fix most of the things by deleting all folders and files from the webUI and then restored them via the Nextcloud client of a Windows device.


    Regarding the phrase "somebody else?": a few changes where made to the config.php file... and it wasn't me... ;)

    To whoever made these: thank you!


    There are a few leftovers in the section called "Security & setup warnings".

    Will make an attempt fixing these using the RTFM and RTFMT approach... ;)

    What are the permissions of the file /httpdocs/nc.it-visibility.net/data/.htaccess and the data directory?

    • Default permissions for files: 0644 (rw-r--r--)
    • Default permissions for directories: 0755 (rwxr-xr-x)


    First: thank you for your prompt response, time and patience - really appreciated.


    It is 0755 for both - all files and folders in /httpdocs - including /httpdocs itself.

    However, the data directory keeps returning to "rwx rwx ---"


    To summarize: I checked and made some changes as suggested. But no noticable improvements.

    I've already mentioned the relevant changes, see my last link. :)


    Just create a new file data.config.php in the config directory and paste this code into the file:

    PHP
    <?php
    
    $CONFIG =
    [
        'datadirectory' => realpath(__dir__ . '/../data'),
    ];

    Now the datadirectory-path will be calculated at runtime. (As long as your datadirectory is still the default data directory.)


    Whoeps... didn't read it very carefully => just added this file... :thumbup::)


    Would/should this also fix the problems with up/downloading files and updating Nextcloud?

    Just found out that my initial message wasn't correct => both, up- and downloading are not working.


    The error-log in /httpdocs/logs/nc.it-visibility.net/ is still showing the error message below:

    [Sat Sep 25 00:01:38.153310 2021] [core:crit] [pid 18175] (13)Permission denied: [client 77.169.79.145:38618] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable