Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: 'Primary script unknown' into Apache logs |
|
| Author |
|
Otomatic

Joined: 01 Sep 2011 Posts: 342 Location: Paris, France, EU
|
Posted: Thu 06 Aug '26 17:00 Post subject: 'Primary script unknown' into Apache logs |
|
|
Hi,
The Apache log files are (almost) entirely filled with lines like the one below, and they fill up very quickly.
| Code: | [Thu Aug 06 14:32:56.147608 2026] [proxy_fcgi:error] [pid 7240:tid 140597490640640] [client 20.52.171.102:33522] AH01071: Got error 'Primary script unknown'
[Thu Aug 06 14:32:56.213311 2026] [proxy_fcgi:error] [pid 7240:tid 140597616531200] [client 20.52.171.102:33522] AH01071: Got error 'Primary script unknown'
[Thu Aug 06 14:32:56.253052 2026] [proxy_fcgi:error] [pid 7240:tid 140597952239360] [client 20.52.171.102:33522] AH01071: Got error 'Primary script unknown'
[Thu Aug 06 14:32:56.285877 2026] [proxy_fcgi:error] [pid 7240:tid 140597868312320] [client 20.52.171.102:33522] AH01071: Got error 'Primary script unknown'
[Thu Aug 06 14:32:56.320068 2026] [proxy_fcgi:error] [pid 7311:tid 140597767599872] [client 20.52.171.102:32134] AH01071: Got error 'Primary script unknown'
|
My web host told me that this was caused by a bot and that it would be a good idea to add the following lines to an .htaccess file:
| Code: | <IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^\s*$ [OR]
RewriteCond %{HTTP_USER_AGENT} "(?:Amazonbot|BLEXBot|Barkrowler|DataForSeoBot|MJ12bot|DotBot|AhrefsBot|SemrushBot|SeekportBot|CCBot|Baiduspider|Yandex|Sogou|PetalBot|Bytespider|OAI-SearchBot|GPTBot|ChatGPT-User|PerplexityBot|ClaudeBot)" [NC]
RewriteRule ^ - [R=429,L]
</IfModule> |
What do you think? |
|
| Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7479 Location: EU, Germany, Next to Hamburg
|
Posted: Fri 07 Aug '26 8:10 Post subject: |
|
|
It is a better solution to get a real 404 error. To do that you better check if that file exists.
| Code: |
<Files ~ "\.php$">
<If "-f %{REQUEST_FILENAME}">
SetHandler "proxy:fcgi://127.0.0.1:9000"
</If>
</Files>
|
|
|
| Back to top |
|
Otomatic

Joined: 01 Sep 2011 Posts: 342 Location: Paris, France, EU
|
Posted: Fri 07 Aug '26 9:41 Post subject: |
|
|
Thank you.
However, if I add this to the .htaccess file on my local site, when I request access to the website, a window appears with the title:
Enter the file name for saving
And a file name like: IRbiKAYR |
|
| Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7479 Location: EU, Germany, Next to Hamburg
|
Posted: Fri 07 Aug '26 12:44 Post subject: |
|
|
| Pardon me for that. How was the Handler set before? Because now the file content is sent as a download. I'm pretty sure it contains the PHP code. |
|
| Back to top |
|
Otomatic

Joined: 01 Sep 2011 Posts: 342 Location: Paris, France, EU
|
Posted: Fri 07 Aug '26 15:13 Post subject: |
|
|
Hi,
The Handler is :
| Code: | | AddHandler application/x-httpd-php .php |
And, yes the saved file contains the PHP code. |
|
| Back to top |
|
|
|
|
|
|