Apache Directory Restriction
Hello,
I'm using Ubuntu 14.10, I want to restrict my specific apache directory. (Only my wan ip can access the same) For Example: /var/www/mysite/public_html/testdirectory/specificdirectory i want to restrict "specific directory" Further i have tested .htaccess but no success yet. Regards, Majid Hussain |
Hi,
You can use: Code:
Require ip x.x.x.x The above snippet can be used either in .htaccess or in apache config Regards |
thanks for your reply,
i have managed to run .htaccess file and is working fine but it has blocked docs.google.com and i'm unable to view any file. order deny,allow deny from all allow from x.x.x.x allow from x.x.x.x allow from x.x.x.x I have used the above pattern kindly let me know how to unblock docs.googel.com Regards, Majid Hussain |
have you tried adding this to your list:
Allow from docs.googel.com Allow from docs.google.com or check out this one: https://httpd.apache.org/docs/curren...ss_compat.html |
I have tried the same but no success yet.
|
Quote:
Code:
dig docs.google.com +short |
I have tried this but now the issue is that if i unblock these ips or domain name then any one can access the document online without having any restrictions.
For example www.mysite.com/test/test.doc then by default it will open through docs.google.com and the link will be open from any where. I want to access the link/file only from my isp. any idea ? Regards, Majid Hussain |
Quote:
|
Thanks for your reply, is that possible to block all files extension except for jpg alongwith this ip rules ?
|
I want my upload directory to reject all files type except for jpg (means no one can upload certian file type to that directory) and the ip rules remain same.
Is there any way to block file type in directory. |
Quote:
Code:
Order deny,allow |
Quote:
Would this greedy match work as well to filter the .jpg files: ".*[.]jpg" |
@JJJCR
Quote:
See this for more. |
doesn't work yet. seems like as suggested by bathory user authentication was the ideal solution for my scenario but still playing with apache, will get back if any solution meets my requirement.
|
what if we can directly restrict apache directory to accept desired extension i.e (doc, xls, xlsx, exe) without involving .htaccess file ?
|
All times are GMT -5. The time now is 12:34 AM. |