I’ve installed laravel locally, then uploaded my code to the server. My domain example.com has LE SSL and it works fine, but when I access the homepage I get error 500. I followed [1], same error.
If I open a simple index.html it works. Please help, many thanks
php 8.2
hCP 1.8.11
Apache example.com SSL: works fine // @sahsanu it’s the same domain we discussed yesterday
cd /home/bob32/conf/web/example.com/
echo 'add_header Access-Control-Allow-Origin "*";' >> nginx.conf_headers
ln -s nginx.conf_headers nginx.ssl.conf_headers
systemctl reload nginx
apache2ctl -M 2>/dev/null | grep headers || echo "You must enable module headers"
** I get the message above **
a2enmod headers
systemctl restart apache2
cd /home/bob32/web/example.com/public_html/
echo '<IfModule mod_headers.c>' >> .htaccess
echo ' Header set Access-Control-Allow-Origin "*"' >> .htaccess
echo '</IfModule>' >> .htaccess
I’ve no problems to access your site but keep in mind that you are using Cloudflare as Proxy and I know nothing about Laravel so I’ve no idea how it tries to connect to your site…
Thanks for your feedback
I tried clearing the cache but the website always return a 500.
Cloudflare DNS seems fine (see SSL scr-shot )
When you say “I’ve no problems to access your site” are you not getting 500?
When I access the code below I get a text on the page (not the output).
It looks php is not working while the LE certificate seems fine despite the warning below? [1]
Thanks
According to the log, the SSL certificate doesn’t include an ID could it be the issue?
No idea why this is happening, I’ve another VPS with 5 (SSL) websites (same OS, hCP) and everything work fine.
Perhaps is something related to Apache and hCP [2] ?
Thanks
/var/log/nginx/domains/cxxxi.com/error.log
2024/05/29 12:12:02 [notice] 199899#199899: using inherited sockets from "9;10;11;"
/var/log/apache2/domains/cxxxi.com/error.log
[Thu May 30 01:24:02.055462 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00493: SIGUSR1 received. Doing graceful restart
[Thu May 30 01:24:02.161739 2024] [ssl:warn] [pid 209627:tid 140319393417088] AH01909: 162.xxx.xxx.xxx:443:0 server certificate does NOT include an ID which matches the server name
[Thu May 30 01:24:02.162819 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00489: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Thu May 30 01:24:02.162849 2024] [core:notice] [pid 209627:tid 140319393417088] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 30 10:15:41.248470 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00493: SIGUSR1 received. Doing graceful restart
[Thu May 30 10:15:41.336445 2024] [ssl:warn] [pid 209627:tid 140319393417088] AH01909: 162.xxx.xxx.xxx:443:0 server certificate does NOT include an ID which matches the server name
[Thu May 30 10:15:41.337508 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00489: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Thu May 30 10:15:41.337542 2024] [core:notice] [pid 209627:tid 140319393417088] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 30 10:15:41.848761 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00493: SIGUSR1 received. Doing graceful restart
[Thu May 30 10:15:41.926719 2024] [ssl:warn] [pid 209627:tid 140319393417088] AH01909: 162.xxx.xxx.xxx:443:0 server certificate does NOT include an ID which matches the server name
[Thu May 30 10:15:41.927920 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00489: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Thu May 30 10:15:41.927947 2024] [core:notice] [pid 209627:tid 140319393417088] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 30 10:16:38.269746 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00493: SIGUSR1 received. Doing graceful restart
[Thu May 30 10:16:38.357608 2024] [ssl:warn] [pid 209627:tid 140319393417088] AH01909: 162.xxx.xxx.xxx:443:0 server certificate does NOT include an ID which matches the server name
[Thu May 30 10:16:38.358915 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00489: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Thu May 30 10:16:38.358949 2024] [core:notice] [pid 209627:tid 140319393417088] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 30 10:16:38.796390 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00493: SIGUSR1 received. Doing graceful restart
[Thu May 30 10:16:38.873344 2024] [ssl:warn] [pid 209627:tid 140319393417088] AH01909: 162.xxx.xxx.xxx:443:0 server certificate does NOT include an ID which matches the server name
[Thu May 30 10:16:38.874272 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00489: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Thu May 30 10:16:38.874295 2024] [core:notice] [pid 209627:tid 140319393417088] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 30 12:23:39.511807 2024] [mpm_event:notice] [pid 209627:tid 140319393417088] AH00492: caught SIGWINCH, shutting down gracefully
[Thu May 30 12:23:39.650342 2024] [ssl:warn] [pid 379732:tid 139777361393536] AH01909: 162.xxx.xxx.xxx:443:0 server certificate does NOT include an ID which matches the server name
[Thu May 30 12:23:39.651617 2024] [suexec:notice] [pid 379732:tid 139777361393536] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Thu May 30 12:23:39.685802 2024] [ssl:warn] [pid 379733:tid 139777361393536] AH01909: 162.xxx.xxx.xxx:443:0 server certificate does NOT include an ID which matches the server name
[Thu May 30 12:23:39.690432 2024] [mpm_event:notice] [pid 379733:tid 139777361393536] AH00489: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Thu May 30 12:23:39.690493 2024] [core:notice] [pid 379733:tid 139777361393536] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 30 13:17:01.127667 2024] [proxy_fcgi:error] [pid 379735:tid 139776246130240] [client 165.227.92.219:0] AH01071: Got error 'Primary script unknown'
[Thu May 30 13:17:04.690833 2024] [proxy_fcgi:error] [pid 379736:tid 139776984327744] [client 165.227.92.219:0] AH01071: Got error 'Primary script unknown'
[Thu May 30 13:17:06.284347 2024] [proxy_fcgi:error] [pid 379736:tid 139776975935040] [client 165.227.92.219:0] AH01071: Got error 'Primary script unknown'
public_html/.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
I’ve never used Laravel so I’ve no idea what are the requirements or the conf needed.
Anyways, did you try yor site without using Cloudflare as proxy?
Is mod_headers enabled?
apache2ctl -M | grep -E 'headers'
If you don’t see this ouput headers_module (shared) then you must enable the headers module and restart apache.
a2enmod headers
systemctl restart apache2
Regarding the certificate it is a warning, anyway, did you enable Let’s Encrypt certificates for your domains, you used Cloudflare Origin Certificates, Self-Signed Certificates…?
mod_headers enabled? Yes
No Cloudflare proxy: tried, same error
Cloudflare Origin Certificates: I don’t use CFlare for certificates, only LE
There must be something that laravel doesn’t like about hCP configuration.
Previously I hosted my laravel app , same folder structure , SSL and DNS, under Cyberpanel with Nginx and it worked.
I’m tempted to reinstall hCP without Apache… (just Nginx) maybe Nginx proxy is incompatible with laravel. Thanks
Well, indeed you use their certificates. You are using Cloudflare as Proxy so you are using the certificate provided by Cloudflare and in this case, has been issued by Google Trust Services LLC.
As I’ve never used Laravel, I can’t help here, maybe someone using it in Hestia can take a look. Anyway, Hestia provides a quick app install for Laravel 10.x, did you try it?
I didn’t know hCP provided a quick app for laravel 10.
I found Quick App under hCP > Website and tomorrow I’ll give it a try.
Given few more laravel’s users are having the same problem [2] perhaps Apache+Nginx could be a real pain for laravel, as suggested here:
I’ve installed laravel 10 as a Quick-App but there are few problems.
Your script seems to use the default command line which always install the latest version (not version 10), and , despite the message Successfully Installed, it doesn’t connect to the database.
I’m now going to install it manually keeping the original folder structure.