Magento 2.4.6 Installation successful but website not working

Hi guys,

I am a newbie here. Please be gentle :smile: )

I wish to ask if you guys could help me out with the following error, please.

I installed the Virtualmin Pro and Magento 2.4.6-p3. The other websites such as WordPress are working fine on the same server sit in different subfolders. Except the Magento website. The Magento website doesnt load when I open the website.

The Magento was installed in the folder /public_html/project. The frontend error shows as follow when accessed from the URL www.https://example.com/project:

Not Found
The requested URL was not found on this server.

There is no error in Apache_error_log though.

The Magento installation seems to be successful as I could put the Magento into different modes and run different command successful by using bin/magento.

I am guessing if the .htaccess plays an important role in my case and the installation did not generate the configuration correctly.

My .htaccess in /public_html/project

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

My server configurations are:

SYSTEM INFORMATION
OS type and version Rocky Linux 9.2
Webmin version 2.101
Virtualmin version 7.8.2 Pro
Related packages PHP 8.1.25 with extensions enabled:
  • ext-bcmath
  • ext-ctype
  • ext-curl
  • ext-dom
  • ext-fileinfo
  • ext-filter
  • ext-gd
  • ext-hash
  • ext-iconv
  • ext-intl
  • ext-json
  • ext-libxml
  • ext-mbstring
  • ext-openssl
  • ext-pcre
  • ext-pdo_mysql
  • ext-simplexml
  • ext-soap
  • ext-sockets
  • ext-sodium
  • ext-tokenizer
  • ext-xmlwriter
  • ext-xsl
  • ext-zip
  • ext-zlib
  • lib-libxml

I would much appreciate if you guys could shed some light on this.

Thank you very much.

Hen

I just did a test, install script had a error

Thanks Stefan. You’re very kind to look into this for me.

The Magento install script in Virtualmin Pro did not work for me either. So I first upgraded the PHP 8.1.25 with all the required PHP extensions loaded. Then followed the installation guide from Quick start on-premises installation | Adobe Commerce.

The installation process said it was successful. But the Magento did not work for me, unfortunately. I am now stuck with this as I do wish to use Virtualmin to partition my other Magento instances.

Thanks again.

-Hen

Did the script errored like mine?
Hopefully you just switch php versions via the docs, upgrades worries me :slight_smile:
https://www.virtualmin.com/documentation/web/multiplephp/
I had 8.1 on the test server. Did you get the error?
I just notice this when I tried reinstalling.


Did you install that?

Maybe the install scripts needs to be looked at.

do you see anything at https://example.com/project/setup

or https://example.com/project/pub

Thanks again, Stefan.

I had the same error as you did when it came to the Elasticsearch module. But I installed the opensearch beforehand and tested it was working. Then use the following installation options:

composer create-project --repository-url=h t t p s://repo.magento.com/ magento/project-community-edition /home/examplecom/public_html

cd /var/www/html/
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chmod u+x bin/magento

bin/magento setup:install
–base-url=h t t p://example .com
–db-host=localhost
–db-name=magento2
–db-user=testuser
–db-password=dbpassword
–admin-firstname=admin
–admin-lastname=admin
--admin-email=admin@example.com
–admin-user=admin
–admin-password=password
–language=en_US
–currency=USD
–timezone=America/Chicago
–use-rewrites=1
–use-rewrites=1
–search-engine=opensearch
–opensearch-host=127.0.0.1
–opensearch-port=9200
–opensearch-index-prefix=magento2
–opensearch-timeout=15

The installation completed.

I saw this at example.com/project/setup:

Thanks again.

-Hen

Saw this at /project/pub

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Sorry for seperating the links and replies. There are restrictions :smile:

what about setup, I see a page there

I did not keep other PHP versions. I am not sure if it is recommended.

Thats right. There is a page there. But only has two hyperlinks of Terms and Agreement, and Getting Started. Other than that, nothing else allows me to continue.

We have another server uses another control panel and its install script works very well. But we want to set up a dedicated ecommerce server for different Magento instances. But the Virtualmin install script seems to be troublesome. I am sorry to say that.

We would really appreciate if you guys can help, please.

Thanks,
Hen

The script seems to need updating, @staff is this a buggy script. ???

You should really follow docs to install different versions of php.
https://www.virtualmin.com/documentation/web/multiplephp/
This allow switching between different version.

Thanks for the suggestion. I will follow the docs to do it again to have a proper setup before we put any production websites on it then.

I think it would be really nice to have a working script and make it easy for us to install the Magento through the install script.

One thing to watch out for is that Virtualmin uses this configuration in Apache:

Options +SymLinksIfOwnerMatch

Magento by default will set the .htaccess files in pub and the pub/media folder to:

Options +FollowSymLinks

and you’ll get an internal server error thrown if that’s the case, so make sure the .htaccess files have the correct Options flag set.

You did install Elasticsearch?

I just did but script still fails. I think my issue is the database version on the script error.

Try editing to you directory, I think magento want root install.
image

It does do that, but I did find one setting that can be adjust if nott useing root install.

Thanks Paul.

I changed it from Options +SymLinksIfOwnerMatch to Options +FollowSymLinks and I did get an internal server error.

Maybe Magento doesnt like subfolder installation as Stefan suggested?

Thanks again.

Cheers,
Hen

I also changed the path, but the problem remained (with clearing cache etc…).

But your suggestion reminded me that Magento 2.4.6-p3 did not allow me to install in subfolder when I used another control panel. However, I did not think of this when we installed Magento from command line on our Virtualmin server.

I will set up a new Virtualmin server with multiple php versions and start from scratch and install it from root folder to see if it will make any difference.

Thanks guys for offering helps here.

Cheers,
Hen

Options +SymLinksIfOwnerMatch

is correct on a Virtualmin server. I was just making sure the installer was setting this correctly.

2 Likes