cache/Unable to load the cache configuration file in Moodle - moodle

My moodle was installed on Centos 7, disabled selinux but got error "cache/Unable to load the cache configuration file"
[
How to fix it ? Thank you very much

From the Moodle docs
https://docs.moodle.org/311/en/RedHat_Linux_installation#SELinux
Default RedHat Enterprise Linux comes with SELinux set to 'enforcing'. But this may cause user problem accessing web content placed at directory other than the default directory (/var/www/html) or other access problem. If you are not used to SELinux and setting permissions, it's (maybe less secure but) often easier to lower the SELinux level to 'permissive' or even 'disabled'.
Edit /etc/sysconfig/selinux
SELINUX=disabled

Related

three ways to let PHP and a regular user edit the same files

I am a web developer, and for some upcoming projects I would like to use a file-based CMS. This means that many of the files I create at the start must be editable by the PHP user later, but also remain editable for my user (and also the other way around). My PC runs Debian 9, which I love but am not super knowledgeable about, and I have also just set up a local network server with Debian 9 for backups and possibly file sharing. (I'm using Webmin to configure this, which reflects my level of command line skills).
On my online shared hosting server, the PHP user and the FTP user seem to be the same, and 644/755 permissions work fine, this is also recommended by the CMS I'm using. I would like to mimic this on my computer so I don't have to fiddle with permissions all the time. But how do I do this? Currently, my regular user (anna) does not have access to www-data's files and vice versa. Putting them in the same group still means changing file permissions. Making anna the PHP user is a Bad Idea (as far as I understand it) because anna has sudo permissions.
So far I have researched three possible solutions that I don't really know very much about, and I would like to know which is the best route to take.
Develop locally on my computer and use apache-mpm-itk or suPHP to let PHP edit the files (I got that idea from this question on ServerFault).
Develop locally on my computer and rsync the files to my server with grunt-rsync, and somehow get rsync to set the ownership to www-data (another ServerFault thread helping here).
Mount the project's server directory, which is owned by www-data, on my computer with SSHFS and then either edit the files on the server directly or copy them over from my local directory with grunt-copy.
What do you think: from a security and ease of use perspective, which is the best way? Or do you know an even better one?
Thank you for taking the time to read and think about this!
Anna~
I figured it out! I finally ended up reading about running PHP as CGI instead of as an Apache module, and that this would solve my permissions problem. Plus, as far as I understand it, there are no extra security precautions to take when I'm the only one working with it on my local computer.
In case someone comes across this who might find it helpful, here's what I did (basically following these instructions):
I installed php7.0-fpm
Edited /etc/apache2/sites-enabled/000-default.conf and put the following just before </VirtualHost>:
DirectoryIndex index.php
<LocationMatch "^(.*\.php)$">
ProxyPass fcgi://127.0.0.1:9000/var/www/html
</LocationMatch>
I activated the Apache module proxy_fcgi (via Webmin, which apparently does an automatic Apache restart)
In /etc/php/7.0/fpm/pool.d/www.conf I commented out a listen line and put another below like this:
; listen = /run/php/php7.0-fpm.sock
listen = 127.0.0.1:9000
I then restarted PHP-FPM with this command: /etc/init.d/php7.0-fpm restart (a little different from the instructions, I'm on Debian 9). After that, phpinfo() gave me the Server API "FPM/FastCGI".
And finally, I changed the user and group from www-data to anna in three places, twice in /etc/php/7.0/fpm/pool.d/www.conf and then once more in /usr/lib/tmpfiles.d/php7.0-fpm.conf (this last bit may be Ubuntu/Debian specific, my thanks go to Keith for a comment on StackExchange).
And that was it! :-)

sshfs -o follow_symlinks mounts with broken softlinks

Up until a day ago I was perfectly able to mount a drive via sshfs with the follow_symlinks option given.
In fact I set up an alias for this command and used it for several weeks.
Since yesterday, using the same alias the volume still mounts correctly but the all the soft symlinks within that volume are broken.
Logging in using a regular ssh session confirms the symlinks actually are functioning.
Are there any configuration files that may interfere with what I try to do?
I was modifying /etc/ssh/ssh_config and /etc/hosts because I experienced severe login delays when starting an ssh session from a friend's place. But I reverted any changes later on.
Could a wrong configuration in these files cause my issue?
Btw. I'm using Ubuntu 16.04
It turns out that the permissions on the particular machine I was trying to mount the folder from changed over the weekend.
It is now only allowing access to certain folders from within the same network. That is why my soft-links (pointing to now permission restricted content) seemed broken when mounting from my home network.

TYPO3: OPcache activation causes server error in TYPO3 backend

I have some trouble with TYPO3 and opcache activation and hope someone can help me :).
Environment details:
PHP 7.1.10
OPcache Version: 7.1.10
TYPO3 7.6.23
Alfahosting (Business XL (SSD))
Situation:
If I enable PHP7 without opcache option then everything is working fine, but if I enable PHP7 with opcache option then I got irregular 500 errors in the backend of TYPO3 and the site is down for a few seconds or minutes. After this few seconds I could reload the page and everything is working until the next server error appears. So it seems that a server process is restarting after this crash.
Actions like opening the extension configuration of the TYPO3 backend extension and press save will lead to the server error. The server logs and the error logs are empty and for this reason the Alfahosting support can't help me.
Furthermore I have mirrored the TYPO3 on two other webservers (not Alfahosting), also PHP7 and opcache option enabled and got no problems on this two webservers. After that I have installed a fresh TYPO3 7.6.23 on a Alfahosting webserver (see environment details above) and I got the annoying 500 server error again. So I think a specific Alfahosting server configuration leads to the 500 server errors if opcache is enabled, but I am not a server admin and I don't know how I could solve this problem without changing the hosting :(.
So I hope someone could help me? Maybe it's possible to track the error to find out where the problem is?
Update:
This sounds like the files have not been refreshed in opcache. This can be the case if opcache.revalidate_freq is set to > 0 or opcache.validate_timestamps=0.
In this case you should make sure you flush opcache when you make changes to PHP files, including updating TYPO3 or your extensions. For example, set this up in your deployment / update pipeline, for example by doing apache2 reload, php-fpm reload, use gordaline/cachetool or flush Opcache in the TYPO3 Backend (Maintenance).
Please read the PHP documentation for the opcache settings and check your current settings (can be found in the TYPO3 backend: Environment | PHP Info). Particularly the following come with a risk:
; make sure you flush opcache if PHP scripts change.
opcache.validate_timestamps=0
; make sure you flush opcache if PHP scripts change.
opcache.revalidate_path= .... higher value > 0
; should be set to 1 for TYPO3
opcache.save_comments = 0
Resources:
PHP documentation for opcache: https://www.php.net/manual/en/opcache.configuration.php
Check the TYPO3 system reports for any obvious errors:
Run TYPO3 system report: "TYPO3 Backend" : "System" : "Reports" : "Status report"
In the "TYPO3 Install Tool" check "System environment"
Now check the logs
check the sys_log: "TYPO3 Backend" : "System" : "Log"
check the Webserver / PHP logs
check system logs (depends on operating system, e.g. journalctl)
have a look at the output of phpinfo (in TYPO3 Backend: Environment | PHP Info). It should include some OPcache statistics. Look at "wasted memory", "Free memory" and "OOM restart"

Eclipse Luna Not Storing Proxy Authentication Username and Password

I'm trying to get Eclipse Luna (on Debian 8) to connect to the Internet via a WiFi proxy that requires authentication. I am able to set the proxy host, port, username and password after which I apply the settings and close the dialog. The next time I open it, it does not have the username and password settings, although the host and port are retained correctly. The Active Provider is set to Manual as required.
For some reason, it doesn't seem to be saving the authentication details and I'm not able to connect to the Internet.
Is this a bug or I'm I doing something wrong?
Also, in what file does Eclipse store the proxy settings? Maybe I can go in there and make the changes directly if this is a GUI problem.
Edit: A look at the Error Log gives a vital clue. It says: No secure storage modules found.
I worked around this issue by adding the proxy settings to the eclipse.ini file as specified in this SO post.
-vmargs
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4
-Dhttp.proxyHost=*myproxyhost*
-Dhttp.proxyPort=*myproxyport*
-Dhttp.proxyUser=*proxy username*
-Dhttp.proxyPassword=*proxy password*
-Dhttp.nonProxyHosts=localhost|127.0.0.1

Shared folder with vagrant cause invisible characters appending

I have a few invisible characters (�) that appear at the end of a javascript document that cause the "illegal character" error in FF or Chrome. I saw different topics about this error, but nothing works for me, and i can't see anything wrong in my document (displaying invisible characters, open it with a hexadecimal editor). This is just driving me crazy.
I use Vagrant with a nginx web server. The document looks clear in the server too (vi + :set list).
Plus, when I get back a clear document from my Git repository, everything works(normal). But each time I want to edit it (like create a new variable at the top of document), I got this error again.
If someone can helps me, thank you.
If you're using the VirtualBox provider, then VirtualBox shared folders are the default synced folder type. These synced folders use the VirtualBox shared folder system to sync file changes from the guest to the host and vice versa.
There is a VirtualBox bug related to sendfile which can result in corrupted or non-updating files. You should deactivate sendfile in any web servers you may be running.
In Nginx:
sendfile off;
In Apache:
EnableSendfile Off
See vagrant docs: http://docs.vagrantup.com/v2/synced-folders/virtualbox.html
It seems that you're using Vagrant.. please take a look at your _Vagrantfile and check the way files are written on the VM filesystem.
cat ~/.vagrant.d/boxes/[YOUR VM NAME]/include/_Vagrantfile
Maybe you are using config.vm.synced_folder try to use NFS:
config.vm.synced_folder "/home/myuser/shared", ".", :nfs => true