Invalid_hash on .htaccess file // OpCache installed but NextCloud says isn't

Hi,

I have two questions.


First.
After a change to the .htaccess (I did it to add Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains" line) I receive this error:

  - INVALID_HASH:
    - .htaccess:
      - expected: 03a32...
      - current: 8f7c...

I saw that it is a problem that happened to many people and I tried to understand what solution they had adopted. None of these worked:

occ maintenance:update:htaccess

or

occ maintenance:update:htaccess
(and)
occ maintenance:repair

Uploaded the file in binary mode (restored, integrity check ok, changed again, integrity check failed).


Second

NextCloud 15.0.5.3 says OpCache module is not loaded, but in phpinfo is active.
Server:
CentOS 7.6.1018
Plesk 17.8.11 #42
php 7.2.15 fmp/apache

additional config lines:
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=7963
opcache.memory_consumption=192
opcache.save_comments=1
opcache.revalidate_freq=0
opcache.validate_timestamps=0
opcache.fast_shutdown=1


Third (bonus) :slight_smile:

NC says «No cache configured», but it should be active. How can I make NC understood?


Thanks for any help.

for headers
nano /etc/apache2/security-inc.conf

paste

SSLEngine on

# Intermediate configuration, tweak to your needs
SSLProtocol             all -SSLv2 -SSLv3
SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-$
SSLHonorCipherOrder     on
SSLCompression          off

SSLOptions +StrictRequire


# Always ensure Cookies have "Secure" set (JAH 2012/1)
Header edit Set-Cookie (?i)^(.*)(;\s*secure)??((\s*;)?(.*)) "$1; Secure$3$4"

#HSTS
Header always set Strict-Transport-Security "max-age=15768000"

edit vh host:
nano /etc/apache2/sites-available/nextcloud-ssl.conf
add
Include /etc/apache2/security-inc.conf

apcu is the best and fastest use it whit redis to look files dont forget to read Nextcloud docuemnt about cache have to add in /config/config.php this to so dont use opcache and use apcu and redis u can use opcache for wp or somthing:)

Dont use that config thats what im using and its working great :slight_smile:

 'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
    'password' => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  ),
`apt install php7.2-dev`
`$ pecl install apcu (use that not apt install php7.x-apcu)`

`nano /etc/php/7.2/mods-available/apcu.ini`

Paste 

    extension = apcu.so
    apc.shm_size = "50M"
    apc.num_files_hint=10000
    apc.user_entries_hint=10000
    apc.max_file_size=5M

and add in config.php

'memcache.local' => '\\OC\\Memcache\\APCu', 

for basic cache 

test if apcu is working 
> cd /var/www/html/ 
> wget https://github.com/krakjoe/apcu/blob/master/apc.php
> go to your website /apc.php

I dont know if i got all info right here but this is basic cache if I forgot somthing plz add it in comment. 


Im new here still lerning how the hell this edit works looks horrible
1 Like

A stupid question (I ask forgiveness): can these files be edited via ftp?
Naturally except commands like install, cd, wget, etc.

yes download the files and edit it and upload agin

1 Like

dont have root access maby dident think about that. php7.2-fpm reads from .user.ini not .htaccess

I have root access, but I’m not comfortable when I use the command line.

“sudo”, in my language, means “sweat”. And I sudo/sweat by tension, by fear, by terror. :slight_smile:

1 Like

I dont like to write sudo so i login as root whit sudo -i hell when typing in like fb i write "sudo HI how are u today? "

1 Like