Pmwiki can not acquire lock file - edit

When i want to edit a page of my pmwiki, i get a screen containing this message:
PmWiki can't process your request
Cannot acquire lockfile
We are sorry for any inconvenience.
More information
Return to http://aim-bigfoot.uzh.ch/~morpho
The message in apache's error_log is
[Tue Aug 13 12:17:51.969802 2019] [php7:warn] [pid 28521] [client xxx.xxx.xxx.xxx:34994] PHP Warning: fopen(wiki.d/.flock): failed to open stream: Permission denied in /server2/home/morpho/public_html/wiki/pmwiki.php on line 579, referer: http://server1.loc.ch/~morpho/
If i delete .flock, and try again, the same error is reported.
This happens for all pages in this particular pmwiki.
The permissions for the wiki.d directory
drwxrwxrwx. 2 morpho morpho 4096 Aug 13 12:17 /server2/home/morpho/public_html/pmwiki/wiki.d/
The security context for this directory:
drwxrwxrwx. morpho morpho unconfined_u:object_r:httpd_sys_rw_content_t:s0 /server2/home/morpho/public_html/pmwiki/wiki.d/
If i disable SELinux with sudo setenforce 0, the page can be edited.
I have a second pmwiki system with the same permissions and security contexts, differing only in the user name, where editing is not a problem.
How can i make this pmwiki editable (with enforced SELinux)?

This question is not about PmWiki engine, it is about PHP writing permission on your server. The problem is that PHP is unable to create files in /wiki.d and probably other directories.
To point the problem, you can create simple php-script like:
<?php
touch( __DIR__ . '/test.file' );
?>
When executed, it should create file /test.file , but on your server this will not work, and this is a real problem to solve.
I suggest asking your hosting provider support for help to solve this problem.

Related

Internal Server Error from perl script solved by adding "-w" to the shebang line. But Why?

I spent hours and hours trying to fix an Internal Server Error on a perl program. I distilled the program down to the very simplest, and nothing would work. In fact, here's the entire program:
#!/usr/local/bin/perl
use strict;
print "Content-type: text/html\n\n";
print <<"thepage";
<html><head><title>Test</title></head><body>
<p>help</p>
</body></html>
thepage
Couldn't get it to work. Permissions correct. Same directory where I have literally a hundred other scripts running constantly. httpd.conf fine. It runs from the command line when SSHing into the server. Error message says:
[Mon May 18 09:59:29 2020] [error] [client 98.190.183.148] (13)Permission denied: exec of '/data/www/facialsurgery/root/cgi-bin/test_print_2.pl' failed
[Mon May 18 09:59:29 2020] [error] [client 98.190.183.148] Premature end of script headers: test_print_2.pl
But I fixed it! By adding "-w" to the shebang line, so the line says:
#!/usr/local/bin/perl -w
But I have, as I mentioned, many many programs running fine without the -w.
What can I do to trace this down more, so I don't eventually run into more trouble with more important programs?? Thanks so much for any insight in this.
The error:
(13)Permission denied: exec of '/data/www/facialsurgery/root/cgi-bin/test_print_2.pl' failed
This means that the web server (Apache) wasn't able to execute the script due to a permission error. (13 is error number for Permission denied.) This has nothing to do with presence or absence of -w.[1]
First, determine as which user the web server (Apache) runs. For the remainder of this post, I'm going to assume it's the default, www-data.
Then, make sure the following file is readable (grants the r permission) and executable (x) by the www-data user (or its group):
/data/www/facialsurgery/root/cgi-bin/test_print_2.pl
This includes making sure the following directories are accessible (x) by the www-data user (or its group):
/data/www/facialsurgery/root/cgi-bin
/data/www/facialsurgery/root
/data/www/facialsurgery
/data/www
/data
If there's no problem with the permissions of those, you could also be running afoul or volume-wide limitations (e.g. noexec attribute on the value) or other security measures (e.g. SELinux restrictions)
I think that ancient systems used to treat everything after the shebang (#!) as the command to execute. On such a system, the kernel would try to execute the non-existent file /usr/local/bin/perl -w. But that would result in errno 2 (No such file or directory), and I don't believe any modern system does this.

Home page not displaying after successful installation of IBM HTTP server

I have installed IBM HTTP on a Red Hat Linux server . The installation was successful but I was not able to view the home page . Whenever I tried to view the home page , it always displayed ' Forbidden ' message like ' You don't have permission to access / on this server. ' On checking the logs , it showed an error the following error message ----
[Fri May 11 03:18:34.955151 2018] [core:error] [pid 23748:tid 140394669549312] (13)Permission denied: [client 172.16.100.25:56320] AH00035: access to / denied (filesystem path '/root/IHS') because search permissions are missing on a component of the path
Can anybody help me in this ?
Don't install to /root since it is normally not readable/executable by non-root users such as the webserver processes that handle requests. Reinstall in e.g. /opt.
Apache-based servers like IHS generally start as root then transition to a lower-privileged users to handle requests -- like "nobody" or "www-data".
Apache requires not just read access to the file being served and execute access to the document root, but read and execute access to EVERY directory between the root of the filesystem and the document root.

MAMP permissions issue on Google Drive File System

I have recently installed Google Drive File System (Google's new Backup and Sync) on my Mac. It runs on /Volumes/GoogleDrive/
Looking to move all my local /dev/ to /Volumes/GoogleDrive/My\ Drive/dev/ to keep everything in sync in the cloud. So far so good.
Apache on MAMP won't recognize /Volumes/GoogleDrive/
[Wed Dec 20 14:22:38 2017] [error] [client ::1] File does not exist: /Volumes/GoogleDrive
..so I created a symlink on the local drive hoping this would work. I get a 403 error now (Forbidden).
[Wed Dec 20 14:43:13 2017] [error] [client ::1] Symbolic link not allowed or link target not accessible: /Users/sergiupoenaru/Documents/dev
One more thing I did was noticing the permissions are 700 and can't change them to anything else. Read somewhere on the web that you can't chmod a NTFS drive.
Any tips on either how to set the proper permissions or a workaround?
Upon upgrading to the latest MAMP, I could use the following PATH successfully:
<Directory "/Volumes/GoogleDrive/My Drive/dev/">

mod mono server 4 constantly crashes with soap requests

I have a c# Soap service that I have running on my Linux Suse 12.1 VPS server. This has been working fine without problems until I made a small change to the soap service and copied it onto my VPS. I thought it must have been an issue with my change so I rolled back my changes and still not working. Even some methods that haven't been touched are failing.
However, I have tested on my Dev machine which is on windows and is working fine and have also copied the soap interface on to a linux dev machine which is set up in the exact samme way as my VPS, i.e. OpenSuse 12.1 and has all the same stuff as my VPS web server. Both work absolutely fine, not got any problems what so ever.
On the VPS host, however, mod-mono-server is constantly crashing and even though it starts up, the asmx file cannot be read, just displays server error, and I need to run rcapache2 restart to get the test page to load up.
In the apache error log file I have the following:
[Thu Aug 30 20:10:19 2012] [error] (70014)End of file found: read_data
failed [Thu Aug 30 20:10:19 2012] [error] Command stream corrupted,
last command was 1 [Thu Aug 30 20:08:47 2012] [error] Command stream
corrupted, last command was 7
I have no idea what the problem might be, I've tried rebooting the VPS but no difference.
I am using the ASP.net 4 version of mod-mono-server.
Thanks for any help you can provide.
UPDATE 1
I have just noticed something else in the apache error. The log file contains the following
[Thu Aug 30 20:46:31 2012] [notice] caught SIGTERM, shutting down
[Thu Aug 30 20:46:32 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Aug 30 20:46:32 2012] [error] Not running mod-mono-server.exe because no MonoApplications, MonoApplicationsConfigFile or MonoApplicationConfigDir specified.
UPDATE 2
Have just made a discovery, not entirely sure if it helps. The soap service is working fine on the server as long as it doesn't require accessing a mysql database. If it performs a query, it displays an an internal server error 500 within the test page. but if called from PHP it causes it to crash mono. The database is a mysql database and is a local database. There's 34% RAM Free so I don't believe this is a memory issue. I've also emptied the database table to determine if this fixes it if it its something to do with the amount of data, but this hasn't fixed it either.
Thanks to #knocte suggestion I managed to figure out the problem.
When the Soap Service accesses the database it reads a config.xml to determine what username and password to use to access the database, I'm guessing that this config file managed to get corrupted during the transfer. Although I could read it in vi, but maybe there was something that was wrong with the file that stopped the soap service reading the config.
All I did was delete the file and copy and paste the content into the file manually.
For some reason mod-mono when it couldn't access the database it crashes mono, even though all the MySQL stuff within the soap service has MySQL Exception handling. #knocte suggestion of testing the soap service proved useful as when this was used to access the database from the soap service xsp4 would stop but display the error saying that it didn't have permission to access the database, even though it had the correct username and password in the config file.
Once I had re-created the config file the soap service works correctly again.
Thanks for your help.

Newly Added Files Getting Permissions Error

I'm running a local WAMP server and have just batch-processed a bunch of images in Photoshop, automatically saving them to a directory. When I try to access these images from my browser, I get a 403 error.
This has not yet happened to me on this server, though I have not yet done any batch processing.
I'm running Windows 7 Professional, and I've tried giving full-access to all users across-the-board for these images, but I'm still getting this same Apache error. Here's what my logs look like:
[Tue Sep 27 15:02:37 2011] [error] [client 127.0.0.1] (OS 5)Access is denied. : file permissions deny server access: C:/wamp/www/site/img/4142.jpg, referer: http://site.local/index.html
What am I doing wrong?
Turns out Windows was encrypting these files for some reason. This is what helped me solve this:
I noticed that all my file-names in Explorer were written in Green.
After a bit of digging around, it turns out they were encrypted, so I
turned encryption off on them and everything's good now!
In order to disable decryption, select your files, right-click and go
to properties, and under "General" go to "Advanced" and remove the
tick that says "Encrypt File Contents". The file-names will then turn
back to black, and everything was fine
Source: http://www.wampserver.com/phorum/read.php?2,43642