So this is a bit of a debugging question, but I do not have any idea what else to try.
I am new to Magento and I wanted to set up a local instance of it to fiddle around. I followed effectively this tutorial. After everything is done, trying to open the Magento site on browser merely shows the index of the directory Magento is installed on, as shown below:
On the same machine, another test pure php page works fine.
I will post the Apache configuration of the site and the configuration of Magento as shown by the magento config:show
command. Feel free to ask whatever other configuration or log is needed to find out what is happening.
Site Apache configuration:
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/magento2.4/pub
<Directory /var/www/html/magento2.4/pub>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Magento config output:
$ sudo -u www-data /var/www/magento2.4/bin/magento config:show
yotpo/module_info/yotpo_installation_date - 2021-05-08
yotpo/sync_settings/orders_sync_start_date - 2021-05-08
catalog/search/engine - elasticsearch7
catalog/search/elasticsearch7_server_hostname - localhost
catalog/search/elasticsearch7_server_port - 9200
catalog/category/root_id - 2
web/seo/use_rewrites - 1
web/unsecure/base_url - http://localhost/
general/locale/code - en_US
general/locale/timezone - America/Chicago
general/region/display_all - 1
general/region/state_required - AU,BG,BR,CA,CH,CN,CO,EE,ES,HR,IN,IT,LT,LV,MX,PL,RO,US,UY
currency/options/base - USD
currency/options/default - USD
currency/options/allow - USD
analytics/subscription/enabled - 1
crontab/default/jobs/analytics_subscribe/schedule/cron_expr - 0 * * * *
crontab/default/jobs/analytics_collect_data/schedule/cron_expr - 00 02 * * *
msp_securitysuite_recaptcha/frontend/enabled - 0
msp_securitysuite_recaptcha/backend/enabled - 0
twofactorauth/duo/application_key - FLUe5W1ndlNSCOt5ah5IUluRgIbO2ahoz8pWOVykoky06biGd0Aisvdw1slOIIfX
connector_dynamic_content/external_dynamic_content_urls/passcode - V1QrRRz31I7TUG0TZ1RDJZE7eRxFxaiR
connector_automation/review_settings/allow_non_subscribers - 1
connector_configuration/abandoned_carts/allow_non_subscribers - 1
sync_settings/addressbook/allow_non_subscribers - 1
connector_developer_settings/system_alerts/user_roles - 1
Elastic search ping command output:
$ curl -XGET localhost:9200
{
"name" : "user-pc",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "RfVO4Tj6TcCQWwyDegap3g",
"version" : {
"number" : "7.12.1",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "3186837139b9c6b6d23c3200870651f10d3343b7",
"build_date" : "2021-04-20T20:56:39.040728659Z",
"build_snapshot" : false,
"lucene_version" : "8.8.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
.htaccess file contents:
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
Apache error log has nothing generated whenever I access the site.
Below are the contents added to the Apache access logs when I access the site:
127.0.0.1 - - [09/May/2021:19:52:43 +0300] "GET / HTTP/1.1" 200 1036 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"
127.0.0.1 - - [09/May/2021:19:52:43 +0300] "GET /icons/blank.gif HTTP/1.1" 304 179 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"
127.0.0.1 - - [09/May/2021:19:52:43 +0300] "GET /icons/unknown.gif HTTP/1.1" 304 179 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"
127.0.0.1 - - [09/May/2021:19:52:43 +0300] "GET /icons/text.gif HTTP/1.1" 304 180 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"
127.0.0.1 - - [09/May/2021:19:52:43 +0300] "GET /icons/folder.gif HTTP/1.1" 304 179 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"
Apache modules loaded:
$ apache2ctl -M
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php7_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
setenvif_module (shared)
status_module (shared)
I made sure multiple times to convert the permissions of all the files in the directory to www-data user, recursively.
Any help appreciated.
EDIT: So I changed my DocumentRoot to /var/www/magento2.4/pub. Now I get a page with no css apparently:
And every link I try is a 404:
The rest of the configuration is the same. pub folder has its own default .htaccess file.
DocumentRoot /var/www/magento2.4/pub
but for the rules I have<Directory /var/www/html/magento2.4/pub>
, a wholehtml
off. The joys of copy pasting code and only changing half of it.