Apache on Win2003 cannot find the path specified - windows

A fresh installation of Apache 2.2 on Win2003.
Configuration validates with the apache tool yet when I attempt to access the site the browser displays an internal error.
Apache log shows:
[Mon Jul 16 13:36:38 2012] [error] [client 10.162.9.158] (OS 3)The
system cannot find the path specified. : couldn't spawn child
process: D:/Heatmap/Webapp/public/dispatch.cg
The file system shows:
D:\Heatmap\Webapp\public>dir dispatch* Volume in drive D is DATA
Volume Serial Number is C482-3950
Directory of D:\Heatmap\Webapp\public
05/02/2012 10:56 AM 445 dispatch.cgi 05/02/2012 10:56
AM 520 dispatch.fcgi
2 File(s) 965 bytes
0 Dir(s) 5,625,618,432 bytes free
Since I noramlly run Apache on Linux servers I'm stymied as to what the root cause is here. The system cannot find a path that is present.
Cluestick please.

The bit of the message couldn't spawn child process caught my attention.
Research showed the shebang line is actually used by Apache - unless Perl at the WinOS level which associates the file extension with the interpreter - and I needed to correct it in my .cgi.
Specifying the full path to Perl in the cgi's shebang line corrected the problem.

Related

Under Catalina MacOS 10.15 PHP under Apache has restricted access to some files via file links possibly by privacy changes

PROBLEM
After upgrading to MacOS 10.15 Catalina PHP is having problems reading some links, and not others, runing PHP (As Apache's user "www"). The problem appears to be possibly changes to the OS privacy/security configuration, which we know has changed, rather than directory execution permisson / FollowSymLink permissions.
DETAILS
$ ls -alt /Users/[MYUSER]/Sites/*info.php
lrwxr-xr-x 1 [MYUSER] staff 8 Oct 10 11:16 /Users/[MYUSER]/Sites/linfo.php -> info.php
-rwxr-xr-x 1 [MYUSER] staff 25 Oct 30 2014 /Users/[MYUSER]/Sites/info.php
In the above both pages info.php and linfo.php function correctly which I think shows the FollowSymLinks working.
$ ls -alt /Users/[MYUSER]/Sites/*index.php
lrwxr-xr-x 1 [MYUSER] staff 78 Dec 30 2014 /Users/[MYUSER]/Sites/index.php -> /Users/[MYUSER]/Documents/[ADIR]/Development/GitHub/cms/sitesIndex.php
$ ls -alt /Users/[MYUSER]/Sites/sitesIndex.php
-rwxr-xr-x 1 [MYUSER] staff 20847 Oct 8 13:11 sitesIndex.php
Of the above pages index.php, a link fails where as a copy of the linked file sitesIndex.php succeeds.
BACKGROUND
Though I don't believe it is related (Because an inability to followSymLinks has a different error message), the folling is the FollowSymLinks setting.
<Directory "/Users/*/Sites/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
$ cat $HOME/Sites/.htaccess
Options +FollowSymLinks
The web server runs as the user "www".
Apache is being initiated as root, though the worker threads run as _www as expected.
_www 65500 0.0 0.0 4317396 1288 ?? S 9:56AM 0:00.02 /usr/sbin/httpd -D FOREGROUND
_www 28574 0.0 0.0 4317440 2256 ?? S 12:16PM 0:00.03 /usr/sbin/httpd -D FOREGROUND
_www 28546 0.0 0.0 4317520 2612 ?? S 12:15PM 0:00.06 /usr/sbin/httpd -D FOREGROUND
root 28529 0.0 0.0 4317548 1284 ?? Ss 12:15PM 0:04.56 /usr/sbin/httpd -D FOREGROUND
All of these files within $HOME/Sites are under iCloud and we are told in the release notes that there are new additional privacy restrictiions introduced in 10.15 for iCloud directories, but it isn't clear to me what these restrictions are, or if the restrictions are documented.
ERRORS
In the server response page PHP produces the following errors:
Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Fatal error: Unknown: Failed opening required '/Users/owenbrunette/Sites/index.php' (include_path='.:') in Unknown on line 0
And in the error.log:
[Tue Oct 08 21:49:11.855033 2019] [php7:warn] [pid 83605] [client ::1:64968] PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0, referer: http://localhost/
[Tue Oct 08 21:49:11.855078 2019] [php7:error] [pid 83605] [client ::1:64968] PHP Fatal error: Unknown: Failed opening required '/Users/[MYUSER]/Sites/index.php' (include_path='.:') in Unknown on line 0, referer: http://localhost/
I have done a lot of file checking. The UNIX read and execute flags for other are set for all the directories leading to the files.
ATTEMPTS AT A SOLUTION
The error of "operation not permitted" is an error string associated with System Integrety Protection" under MacOS, and not Apache SymLink following, though the pharese "operation not permitted", may well not be unique. The error is coming from PHP not Apache..
I have allowed full disk access in:
System Preferences / Security & Privacy / Privacy / Full Disk Access.
I have not tried completely disabling SIP (System Integrity Protection) at the OS level, as that is far from an ideal solution.
Catalina has more restrictive permissions. The fix is easy: enable full disk access for http. To do this:
System Preferences => Security & Privacy => Full Disk Access
Navigate to the root folder of the disk and press Cmd+Shift+. (to view all the folders under root) and then go to
/usr/sbin/
select "httpd" and restart it (apachectl -k restart).
That should do the trick.

Lighttpd closes connection when system time is changed

These are some of the parameters of my lighttpd config file.
server.modules += ( "mod_wstunnel", "mod_auth")
wstunnel.debug = 4
wstunnel.server.max-read-idle = 86400
#wstunnel.ping-interval = 5
#wstunnel.timeout = 30
When I open my web application, connection is created properly using websocket and connects to my c++ server.
All functionalities work except one.
One requirement of my application is to change the system time of machine, but when system time is changed, connection is closed and in log file it shows as :
`2019-02-12 14:04:10: (gw_backend.c.308) released proc: pid: 0 socket: tcp:127.0.0.1:10002 load: 0`
I want to maintain the connection even if system time is changed.
What other parameters can be used or any modification is required in these parameters?
System OS : Fedora 26
Lighttpd version : 1.4.49
wstunnel.server.max-read-idle does not exist. Did you test the lighttpd config before running it and look at the error trace? It should have noted wstunnel.server.max-read-idle as an unrecognized directive.
The directives you seek are:
server.max-read-idle
server.max-write-idle
server.max-keep-alive-idle
However, if the time on your server (running lighttpd) is jumping more than a few seconds, then I suggest that is your primary problem.
Also, Fedora 26 reach end-of-life on May 29, 2018. Supported Fedora have newer version of lighttpd. The current version of lighttpd is lighttpd 1.4.53.

Gentoo No rule to make target 'olddefconfig'

I have been following this guide from the gentto wiki to install Gentoo. I have hit a bit of a roadblock though which looks reasonably simple but I am having trouble figuring it out.
On this page: https://wiki.gentoo.org/wiki/Sakaki%27s_EFI_Install_Guide/Configuring_Secure_Boot#test_secure_boot
In the Testing Secure Boot with a Signed Kernel section whilst executing the buildkernel command I get the following error:
* Updating old config using make olddefconfig
make: *** No rule to make target 'olddefconfig'. Stop.
* buildkernel: Error: Caught signal - exiting
I don't seem to have an olddefconfig at all and even if I did have one I am not entirely sure what rule should be added to the make file.
I have read the man page for the buildkernel command and gone over this description here but sadly I have still not managed to fix the issue.
Does anyone know how to rectify this error?
So I now have an answer for this. It sometimes happens when the kernel sources have been updated to a new version, but the symbolic link /usr/src/linux hasn't been updated to
match. Gentoo leaves a partially populated kernel source tree in
/usr/src/linux--genoo even when an old kernel source version is
unmerged, and if the symbolic link /usr/src/linux still points to this.
if you run:
eselect kernel list
and it produces something like:
Available kernel symlink targets:
[1] linux-4.14.63-gentoo-r1
and
ls -l /usr/src/
produces something along the lines of:
total 8
lrwxrwxrwx 1 root root 20 Aug 18 00:33 linux -> linux-4.14.61-gentoo
drwxr-xr-x 23 root root 4096 Aug 18 02:38 linux-4.14.61-gentoo
drwxr-xr-x 25 root root 4096 Aug 18 02:33 linux-4.14.63-gentoo-r1
Running the following command will update the symbolic link and let you get on with things.
eselect kernel set 1
I emailed the author of the guide to get this information so credit goes to her. I am leaving this here in case anyone else runs into this problem in future.

Windows using hidden file rather than directory in paths...Why?

I (and my colleague) are having this problem with 32-bit applications on a 64-bit Windows 7 OS. We have also found the same problems when we invoke a 64-bit application and pass a path as described below as a parameter in cmd.exe.
Given the path "C:\dir1\dir2\file1.txt", we have some 32-bit applications that don't appear to be able to consistently resolve that path and find the file if there is a hidden file of a particular naming structure causing it to lose it's way.
For example, given the directory/file structure:
\dir1
\dir2
\file1.txt
\.dir2Blah
Of importance is that the "hidden" file's name starts with the same characters as those which indicate a directory at that same level of the hierarchy. What comes after that in the hidden file's name is irrelevant. It could be called ".dir2Whatever".
The problem is that more often than not (but not consistently always) some 32-bit applications we use can't find the file1.txt file. We're told it can't be found or it doesn't exist, etc. in the application. Using Process Monitor, we found the reason appears to be that while the path being asked for is C:\dir1\dir2\file1.txt, the path being evaluated by the the Windows system is C:\dir1\.dir2Blah\file1.txt.
We have found that some 32-bit applications appear to be able to work fine with those (what I would call) erroneous paths and successfully find the files in question but others do not.
As I said above, we have also found we can reproduce the problem with 64-bit applications if we try to open the file through a cmd.exe prompt; for example, "textpad.exe \dir1\dir2\file1.txt".
We've "googled" this problem for 2 days because we're completely stumped and cannot believe that no one else has ever encountered this if it's so "easy" to reproduce. My colleague and I are both able to cause the failure; not consistently, but file access will fail more than half the time when we set up the structure I described.
I've included a picture of Process Monitor showing this failure in two applications but succeeding in a third...here.
Can anyone tell me what is going on? First, why is it changing the path to use that hidden file rather than the directory name provided? And, more importantly, how can we make it stop ;-)?
Cheers,
jtm
Added later:
Here's the "dir /x" output for a directory where I'm having this problem.
24/05/2017 12:17 PM <DIR> .
24/05/2017 12:17 PM <DIR> ..
24/05/2017 12:17 PM 12 BLAHTS~1 .blahtst
23/05/2017 03:06 PM 104 JSHINT~1 .jshintrc
24/05/2017 12:16 PM <DIR> blah
24/05/2017 12:16 PM 0 blank.txt
24/05/2017 12:15 PM 6,624 INDEX~1.HTM index.html
24/05/2017 10:48 AM <DIR> js
It also indicates how we stumbled on the problem. I have an html file that is trying to load a JavaScript file under the /js directory, but there is also a .jshintrc file at the same level and my old Apache server can't find the files to serve them. If I remove the .jshintrc file, I can get around this, but this project isn't one I created and I'm leery of just removing things willy nilly.

How to generate certificate in Perforce in Windows?

In Windows according to
docs
I set P4SSLDIR:
set P4SSLDIR=E:\Programs\perforce\P4SSLDIR\
Trying to generate certificate and private key gives error:
C:\programs>p4d -Gc
Perforce server error:
P4SSLDIR not defined or does not reference a valid directory.
How to overcome this to generate priv key and certificate?
p4d can not understand last backslash in path.
Examples in docs for *nix.
Fix of the problem:
set P4SSLDIR=E:\Programs\perforce\P4SSLDIR
Incorrect:
set P4SSLDIR=E:\Programs\perforce\P4SSLDIR\
I couldn't reproduce this with a simple experiment (I used Perforce 2013.3, which is the version I happen to have):
C:\Users\Bryan\perforce\my-test-server>mkdir P4SSLDIR
C:\Users\Bryan\perforce\my-test-server>set P4SSLDIR=C:\Users\Bryan\perforce\my-test-server\P4SSLDIR
C:\Users\Bryan\perforce\my-test-server>p4d -Gc
C:\Users\Bryan\perforce\my-test-server>dir P4SSLDIR
Volume in drive C is OS
Volume Serial Number is 6602-B38E
Directory of C:\Users\Bryan\perforce\my-test-server\P4SSLDIR
05/24/2015 09:36 AM <DIR> .
05/24/2015 09:36 AM <DIR> ..
05/24/2015 09:36 AM 1,172 certificate.txt
05/24/2015 09:36 AM 1,704 privatekey.txt
You might need to contact Perforce Technical Support for assistance, as it might be something very specific to what you're doing.

Resources