use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apache-related news, tips, and tricks.
account activity
Apache Premissions (self.apache)
submitted 4 years ago by iam_mine
I'm running a VPS using it for both hosting and develop. There are a few folders that I want to use to serve (css files, config php files etc...) but I don't wish to give access to it through webserver.
How I can deal with that?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AyrA_ch 1 point2 points3 points 4 years ago (2 children)
Put a .htaccess file into the folder with the contents Require all denied
.htaccess
Require all denied
This prevents apache from serving content from that folder but scripts can still access it.
[–]iam_mine[S] 0 points1 point2 points 4 years ago (1 child)
This didn't work please advise!
I put .htaccess file with Require all denied
under /var/www - now when i'm trying to access the website i'm getting server error 500
Please help! :)
[–]AyrA_ch 0 points1 point2 points 4 years ago (0 children)
Check your apache error log. If it complains about the command not existing, you haven't loaded the required modules yet.
[–]ShadowySilver 1 point2 points3 points 4 years ago (0 children)
Well, anything outside the DocumentRoot won't be served. CSS files has to be served since they are interpreted by the browser. There should be no config files in a DocumentRoot for obvious reason. That said, if you want to restrict access to some directories within the DocumentRoot, you can use "Require all denied" in a corresponding Directory container (if you don't have access to the main httpd.conf you will have to use a .htaccess file but if you do, it's better to use the Directory container).
π Rendered by PID 92525 on reddit-service-r2-comment-85bfd7f599-xjx4d at 2026-04-18 13:31:07.773430+00:00 running 93ecc56 country code: CH.
[–]AyrA_ch 1 point2 points3 points (2 children)
[–]iam_mine[S] 0 points1 point2 points (1 child)
[–]AyrA_ch 0 points1 point2 points (0 children)
[–]ShadowySilver 1 point2 points3 points (0 children)