I had my website running fine on my old server(websites that are not updated in years, one for ~15 years the other ~4 years. due to centos ending support, i moved to a new VPS server. I installed webmin, followed some tutorials to get things started, but i cannot seem to make my websites working, even though they are exact copies of the public_html folders.
I am getting the error 500. When i check the logs of virtualmin, i get a LOT of â[proxy_fcgi:error] [pid 15727:tid 15850] [client 18.195.242.98:41094] AH01071: Got error âPrimary script unknownââ.
And the log ends with:
[Tue Dec 05 23:02:14.424387 2023] [autoindex:error] [pid 15727:tid 15802] [client 97.90.117.111:44996] AH01276: Cannot serve directory /home/domain/public_html/: No matching DirectoryIndex (index.php,index.php4,index.php5,index.htm,index.html) found, and server-generated directory index forbidden by Options directive
[Tue Dec 05 23:42:57.635268 2023] [ssl:warn] [pid 86192:tid 86192] AH01906: domain.eu:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Dec 05 23:42:57.651701 2023] [ssl:warn] [pid 86192:tid 86192] AH01906: domain.eu:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Dec 06 10:02:58.890697 2023] [proxy_fcgi:error] [pid 86418:tid 86462] [client 82.157.245.189:58613] AH01071: Got error 'Primary script unknown', referer: http://domain.eu/lx.php
[Wed Dec 06 15:14:05.757308 2023] [proxy_fcgi:error] [pid 86196:tid 86391] [client 157.230.45.251:60087] AH01071: Got error 'Primary script unknown'
[Wed Dec 06 15:14:08.847509 2023] [negotiation:error] [pid 86205:tid 86356] [client 157.230.45.251:57695] AH00687: Negotiation: discovered file(s) matching request: /home/domain/public_html/test (None could be negotiated).
[Wed Dec 06 18:10:47.191686 2023] [proxy_fcgi:error] [pid 86196:tid 86382] [client 43.241.72.160:33534] AH01071: Got error 'Primary script unknown'
[Wed Dec 06 20:59:08.146447 2023] [negotiation:error] [pid 86196:tid 86352] [client 169.150.201.10:19103] AH00687: Negotiation: discovered file(s) matching request: /home/domain/public_html/admin (None could be negotiated).
From troubleshooting online, i find that there is no index.html or index.php file, but this is untrue. If i go to my domain/index.php, i get the http 500 error. When i enter a false path, like domain/index2.php, i get a not found error. So the public_html folder is being used and the domains are correctly pointing to the new server.
To start with you should have PHP Options set to FPM
might not solve your problems but should help as a start.
15 years (That takes me back though not quite to childhood!) does anyone really expect something that was coded that long ago still to work? It is almost pre-history Y2K)
PHP4 or PHP5 (Iâm afraid it is PHP8 (or PHP7.x at a push) check which version you have installed Server Configuration -> PHP Options next check your webserver configuration files. I assume you have SSL (Letâs Encrypt) obtained OK so your VS domain was found ok. and placing a simple test index.html file there works?
The 15 year old site is just there for nostalgia sake. Spambots already took over from exploits found etc, so i put it in read-only mode.
I still use it to share files with communityâs, for email and other small stuff.
Do i have to install a earlier php? It is not backwards compatible?
I do not have ssl yet. First i want the sites working(ignoring the ssl warning) and then i will try to get those working.
The initial index.html that webmin created when making the virtual server/domain, worked.
And how do i set php to fpm?
There is a tab called php configuration that shows two configuration files i can edit, but not enable or disable.
If its a static website, there is software to convert to html and then move to a update to date system.
Just a thought, Ive done it with old wordpress sites.
Definitely as domain.eu/index.php gives a 500 error, but a false path gives the ânot foundâ error page.
How do i check the latter questions?
And to help me understand, why does this matter? I made these two domains/virtual servers with the root account, i did not login to webmin/virtualmon with the domain users yet.
Good. that means that Virtualmin was working and that your D NS was also working. Perfect! so it is down to the code of the website. or the configuration of the webserver.
If changing the PHP execution mode to FPM does not resolve this. (switch it back) and we will go down the webserver configuration rabbit hole.
Apache, wich is probably good as the old host i have also uses that.
In php configuration, i only had the option to use FPM, or disable. So i disabled it, but i suppose this completely disables php. on my newer site, i now get the php index file displayed as text, on my old site i still get the 500 error.
This usually means an error connecting to a database at the server (though not always).
Well that would be perhaps good news because i have still to mess with the databases(they ran using mysql and i maintained them using phpmyadmin. I know that mariadb is installed on webmin, but i readed that itâs backwards compatible. I already imported my sql backup but did not mess around too much with it yet. I didnât mess around with this yet because i remember when i changed host in the past, also a long time ago, then i get a error that the database connection canât be established, or similar. Now iâm getting other errors, so were not searching the fault at the database connections yet.
EDIT: But wouldnât that make the /var/logs/virtualmin/ error logs include something about a database connection?
I had same 500 issues when I moved my sites to new install from apache 2.2 to apache 2.4 and in my case the issue turned out to been .htaccess file as rules in it were not compatible with newer version of apache. There been some small changes in 2.4. Just out of curiosity, try to rename .htaccess temporary and try to load the site without it. If the site came up even with some stuff not working properly you can rewrite your .htaccess file with new format. Perhaps its some old formatting for redirection rule or something. You newer know.
If you can still access sites on old server and they are working, export dbs via phpmyadmin, it should work normally in mariadb at least you can try it first without modification.
If you want to archive website with all existing data displayed in browser as they are, I can recommend to clone site with wget with single command, which can clone (any) website and correct links - basically make site static html - but this is probably something that you was not after.
It should (so from what you say I do not think it to be that)
I am concerned that you are not getting the option to change the execution mode to FPM and do not understand why. âDisabledâ would of course just display index.php as text at least confirming again that the DNS is not an issue.
@unborn is correct the .htaccess is likely to be the culprit or its configuration
I stopped using Apache years ago and as a result Iâm out of date so cannot be much help.
maybe you already covered this â when using a database from php (or any kind of access), you need to specify a userid and password (userid/password inside the DB) ⊠perhaps your new Virtualmin DB has a different userid or password?
for instance in wordpress as an example, I have to manually edit wp-config.php to update the DB name, userid and password used to access the tables of that specific (new) database.
@verne that is a glue but since he is accessing db as domain owner - I would guess same as Jamie, that would not be an issue⊠even they said they deployed on old server as root⊠obviously I think they figured out that root is not is no go.
@borgqueenx then I am very sorry. If you have .access to old server have look at hidden files, folders or files are marked with dot in front hence .htaccess ⊠I use FileZilla via SSH, where this is on by default - but if you use terminal⊠or anything else make sure you copy out hidden files and can see them too⊠If there is nothing like .htaccess - I am useless on this one and I am very sorry that I was not able to help you but I think that is what the problem probably is.
you think that can be it? I dont get DB errors in the log file, and i moved before(ages ago though), and then when i successfully moved i get a error when accessing the website that said that it couldnt establish a mysql connection(or something similar).