0

Ok, let's move on. I am new to this and I am trying to install magento 2.4.6 on a local WSL server with Ubuntu 22.04, I have apache2, php8.1 and 8.2, composer, mysql and elasticsearch 8 installed.

I have 2 problems:

  1. I installed Magento and I don't know how to access either the home or the admin, following several guides, this is the installation command I used:
bin/magento setup:install  --disable-modules=Magento_InventoryElasticsearch,Magento_Elasticsearch8,Magento_Elasticsearch,Magento_OpenSearch \
--base-url=http://local.core.com \
--db-host=localhost \
--db-name=magento \
--db-user=admin \
--db-password=admin \
--admin-firstname=admin \
--admin-lastname=admin \
[email protected] \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1

i added this:

    ::1             localhost
    ::1             http://local.core.com

to the windows host file and it only returns the error: ERR_NAME_NOT_RESOLVED

  1. After the installation I couldn't get Magento to take elasticsearch following the guide on the official website and this other question when using this command:

curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200

the answer is this:

{
  "name" : "Aksonyn-PC",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "Vbm4-RXURbi0rk5NtKaNmQ",
  "version" : {
    "number" : "8.10.4",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "b4a62ac808e886ff032700c391f45f1408b2538c",
    "build_date" : "2023-10-11T22:04:35.506990650Z",
    "build_snapshot" : false,
    "lucene_version" : "9.7.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

but when executing the command php bin/magento setup:upgrade it gives me the following error: Could not validate a connection to Elasticsearch. No alive nodes. All the 1 nodes seem to be down.

6
  • you have created virtual host and enable that site for this domain local.core.com?
    – Pramod
    Commented Nov 6, 2023 at 1:47
  • if you could explain me better... If you could explain to me better, if you are referring to the apache .conf files in the /etc/apache2/sites-available path, I have 3 files 000-default.conf, default-ssl.conf, magento2.conf. 000-default.conf have this Listen 8080 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Commented Nov 6, 2023 at 18:16
  • and magento2.conf have this <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/magento2/ ServerName http://local.core.com <Directory /var/www/html/magento2/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Commented Nov 6, 2023 at 18:18
  • try updating DocumentRoot /var/www/html/magento2/pub as your index files resides in pub directory
    – Pramod
    Commented Nov 7, 2023 at 2:14
  • If I do that, the home loads without styles because due to the problem with elasticsearch I cannot run the compilation commands, and I don't know how to enter the admin Commented Nov 7, 2023 at 13:58

3 Answers 3

0

I am applying below both codes. after then working

sudo systemctl stop elasticsearch.service

sudo systemctl start elasticsearch.service

After that, You can try the below commands for Magento installation.

php bin/magento setup:install --base-url="http://localhost/url/pub" --db-host="localhost" --db-name="db-name" --db-user="root" --db-password="" --admin-user="admin" --admin-password="admin@123" --admin-firstname="admin12" --admin-lastname="user" --admin-email="[email protected]" --backend-frontname="admin"
0

Can you reach Elesaticsearch also by http instead of https ?

1
  • If I make the request through http the response is curl: (52) Empty reply from server Commented Nov 6, 2023 at 18:12
0

Please add the below params to your bin/magento setup:install command.

  --search-engine=SEARCH-ENGINE (Search engine. Values: elasticsearch5, elasticsearch7, elasticsearch8, opensearch)
  --elasticsearch-host=ELASTICSEARCH-HOST (Elasticsearch server host.)
  --elasticsearch-port=ELASTICSEARCH-PORT (Elasticsearch server port.)
  --elasticsearch-enable-auth=ELASTICSEARCH-ENABLE-AUTH (Set to 1 to enable authentication. (default is 0, disabled))
  --elasticsearch-username=ELASTICSEARCH-USERNAME (Elasticsearch username. Only applicable if HTTP auth is enabled)
  --elasticsearch-password=ELASTICSEARCH-PASSWORD (Elasticsearch password. Only applicable if HTTP auth is enabled)
  --elasticsearch-index-prefix=ELASTICSEARCH-INDEX-PREFIX (Elasticsearch index prefix.)

Please check below curl command

curl -X GET --user username:password "http://localhost:9200"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.