# "Primary script uknown" on one server

**URL:** <https://forum.virtualmin.com/t/primary-script-uknown-on-one-server/114136>\
**Category:** Help! (Home for newbies)\
**Created:** [February 26, 2022, 4:26am UTC](https://forum.virtualmin.com/t/primary-script-uknown-on-one-server/114136 "2022-02-26T04:26:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vipul.K](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/v/8e8cbc/32.png) [@Vipul.K](https://forum.virtualmin.com/u/Vipul.K)\
**Post date:** [February 26, 2022, 4:26am UTC](https://forum.virtualmin.com/t/primary-script-uknown-on-one-server/114136/1 "2022-02-26T04:26:04Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | Ubuntu 20.04 |
| Virtualmin version | 6.17-3 |

I moved one virtualmin server to another VPS and it went haywire somehow. i used the Backup and Restore feature. Both VPS are running the same Ubuntu and Virtualmin versions. When I enter the domain, it says “File not found”.

In apache error logs, I have

> AH01071: Got error ‘Primary script unknown’

Here’s my apache host for SSL version

```auto
SuexecUserGroup "#1039" "#1007"
ServerName domain.com
ServerAlias www.domain.com
ServerAlias webmail.domain.com
ServerAlias admin.domain.com
DocumentRoot /home/domain/public_html
ErrorLog /var/log/virtualmin/domain.com_error_log
CustomLog /var/log/virtualmin/domain.com_access_log combined
ScriptAlias /cgi-bin/ /home/domain/cgi-bin/
DirectoryIndex index.php index.php4 index.php5 index.htm index.html
<Directory /home/domain/public_html>
    Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch 
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
</Directory>
<Directory /home/domain/cgi-bin>
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.domain.com
RewriteRule ^(?!/.well-known)(.*) https://domain.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.domain.com
RewriteRule ^(?!/.well-known)(.*) https://domain.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php7.3
RemoveHandler .php7.4
RemoveHandler .php8.1
<FilesMatch \.php$>
    SetHandler proxy:fcgi://localhost:8012
</FilesMatch>
SSLEngine on
SSLCertificateFile /home/domain/ssl.combined
SSLCertificateKeyFile /home/domain/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
Header set Content-Security-Policy "frame-ancestors 'none';"
Protocols h2 h2c http/1.1

```

PHP FPM config file

```auto
[157492832919133]
user = domain
group = domain
listen = localhost:8041
pm = ondemand
pm.max_children = 15
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 5
php_admin_value[upload_tmp_dir] = /home/domain/tmp
php_admin_value[session.save_path] = /home/domain/tmp
pm.process_idle_timeout = 10s
pm.max_requests = 50

```

I have read a lot on it but can’t seem to figure out a solution.

- A few people mentioned rebooting the system fixed it but it didn’t for me.
- I’ve checked file permissions as well and they’re ok.
- Changed PHP version, didn’t make a difference

How do I diagnose the problem?

---

<div class="post-metadata">

**Author:** ![unborn](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/unborn/32/23353_2.png) [@unborn](https://forum.virtualmin.com/u/unborn)\
**Post date:** [February 28, 2022, 12:24pm UTC](https://forum.virtualmin.com/t/primary-script-uknown-on-one-server/114136/2 "2022-02-28T12:24:39Z")

</div>

are you able to pass error log line from apache error log - what scripts have 404 or other errors? also once you see script name in that error log line - can you check manually that domain owner that is trying to run that script have successful permissions to run this script be it cronjob or server it self as root etc…(I mean via terminal) ?

The logs you provided right now does tell nothing…

---

<div class="post-metadata">

**Author:** ![Vipul.K](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/v/8e8cbc/32.png) [@Vipul.K](https://forum.virtualmin.com/u/Vipul.K)\
**Post date:** [February 28, 2022, 2:41pm UTC](https://forum.virtualmin.com/t/primary-script-uknown-on-one-server/114136/3 "2022-02-28T14:41:59Z")

</div>

> [@unborn](#):
>
> are you able to pass error log line from apache error log - what scripts have 404 or other errors?

Not sure what you mean? This is happening on every php page including home page. If you want to see the entire line of error, its this  
`[Mon Feb 28 20:03:02.388315 2022] [proxy_fcgi:error] [pid 155206:tid 140107059291904] [client 45.148.10.247:62441] AH01071: Got error 'Primary script unknown'`

> [@unborn](#):
>
> can you check manually that domain owner that is trying to run that script have successful permissions to run this script be it cronjob or server it self as root etc…

I can execute `php /home/domain/public_html/index.php` when logged in to SSH via root user. I get the page contents. Not sure if the domain owner can access it? How can I test that?

---

<div class="post-metadata">

**Author:** ![Vipul.K](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/v/8e8cbc/32.png) [@Vipul.K](https://forum.virtualmin.com/u/Vipul.K)\
**Post date:** [March 1, 2022, 3:18am UTC](https://forum.virtualmin.com/t/primary-script-uknown-on-one-server/114136/4 "2022-03-01T03:18:14Z")

</div>

The sites had been down for so long. I ended up taking another backup from the old location, this time did not select Apache configuration and SSL configuration (had a feeling this is the problem). Restored it again on the new location and they worked. I guess that option should only be used when backing up and restoring on the same machine.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [April 30, 2022, 3:18am UTC](https://forum.virtualmin.com/t/primary-script-uknown-on-one-server/114136/5 "2022-04-30T03:18:43Z")

</div>

Closed on April 30, 2022, 3:18am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
