cat filename.txt results in error

vpicton

New Member
Joined
Jan 13, 2021
Messages
2
Reaction score
0
Credits
26
Trying to share a file in Apache fails (saved to //var/www/html/somefile.txt
I can't use the command 'cat somefile.txt', it just doesn't work in any directory and throws a cat: no such file or directory error
I can touch the file, but then I can't modify it even as root because it throws an access denied error
With Apache2 running I can't access the file from my local machine using http://127.0.0.1/somefile.txt (having changed permissions to it and edited it), I get Forbidden
 


First, I'm guessing the // you show with the filename reference is simply a typo.

Second, since typically /var is not in your default path, cat doesn't know where to find anything under /var. You can try "cat /var/www/html/somefile.txt", and that should give you output.
 


Top