Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-07-09 06:58:45
Point:500 Replies:9 POST_ID:828585USER_ID:11059
Topic:
PHP Scripting Language;JavaScript;Apache Web Server
I would like to deny one IP address to visit my website to read all my directoy files
I tried to use the following .htaccess file and ftp it into my public_html root directory.
=================================.htaccess file =============
# -FrontPage-
ErrorDocument 404 /blank.html
<Limit GET POST>
order deny,allow
deny from 63.238.185.242
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
=====================================
But it doesnt work any way even I reboot my VPS server.
COuld you tell how to make it success? Please advise
I am using apache Linux CentOS-64 system
Duncan
I tried to use the following .htaccess file and ftp it into my public_html root directory.
=================================.htaccess file =============
# -FrontPage-
ErrorDocument 404 /blank.html
<Limit GET POST>
order deny,allow
deny from 63.238.185.242
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
=====================================
But it doesnt work any way even I reboot my VPS server.
COuld you tell how to make it success? Please advise
I am using apache Linux CentOS-64 system
Duncan
Author: duncanb7 replied at 2024-07-09 22:53:40
For memo only:
========================
what is different bettween httpd.conf and .htaccess
http://www.webmasterworld.com/forum92/513.htm
========================
what is different bettween httpd.conf and .htaccess
http://www.webmasterworld.com/forum92/513.htm
Author: duncanb7 replied at 2024-07-09 08:01:27
use .htaccess
Expert: gr8gonzo replied at 2024-07-09 07:54:35
So did you use htaccess or did you use iptables?
Author: duncanb7 replied at 2024-07-09 07:52:43
Expert: gr8gonzo replied at 2024-07-09 07:49:05
Here's a template for the iptables rules. Basically, you will need to modify the parts about the IP addresses to include your IP address and the IP addresses you want to block. Then you load it with iptables-restore < file_containing_the_final_rules.txt
Author: duncanb7 replied at 2024-07-09 07:47:04
Yes, it is simple logic, thanks
Expert: gr8gonzo replied at 2024-07-09 07:38:57
If you're trying to block someone who is trying to "attack" your site, you might want to consider using iptables to block the IP completely at the firewall level. That way you can easily block that IP (or more later) from everything, including FTP, mail, web, etc... It will be far more effective than .htaccess (and you can set up additional protection for yourself).
Accepted Solution
Expert: hielo replied at 2024-07-09 07:26:56
500 points EXCELLENT
>>order deny,allow
You are instructing to first process the deny rule, THEN the allow rule. So when deny is processed 63.238.185.242 is disallowed, but when allow is processed you are "undoing" what you specified earlier. You need to reverse the order.
You are instructing to first process the deny rule, THEN the allow rule. So when deny is processed 63.238.185.242 is disallowed, but when allow is processed you are "undoing" what you specified earlier. You need to reverse the order.
<Limit GET POST>order allow,denydeny from 63.238.185.242allow from all</Limit> 1:2:3:4:5:
Author: duncanb7 replied at 2024-07-09 07:25:52
it work if I change order deny,allow to order allow,deny, Why could you explain it ?