After successfully install magento 2.3.3 in centos 7 with nginx, url getting Unable connect error.
Install magento 2.3 using following commands,
php bin/magento setup:install --base-url=http://localhost/magento2 --db-host=localhost --db-name="magento2" --db-user="root" --db-password="" --admin-firstname="abc" --admin-lastname="abc" [email protected] --admin-user="magento2" --admin-password="magento2123" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1"
Configure SELinux and Firewalld
/etc/nginx/conf.d/magento.conf
upstream fastcgi_backend {
server unix:/run/php-fpm/php-fpm.sock;
}
server {
listen 8091;
server_name 192.168.1.64;
set $MAGE_ROOT /usr/share/nginx/html/magento2;
include /usr/share/nginx/html/magento2/nginx.conf.sample;
}
If i try the url : 19.168.1.64:8091 getting error like Unable connect error
Anything else i missed?
-
502 is cause due to a php issue, check your php version compatibility and also cross check required php extensions for magento 2.3.3ASQ– ASQ2019年12月27日 12:19:36 +00:00Commented Dec 27, 2019 at 12:19
-
@ASQ Check with my updated post my php version : 7.1.33zus– zus2019年12月27日 12:28:31 +00:00Commented Dec 27, 2019 at 12:28
1 Answer 1
correct way installing to localhost is:
- add your domain to hosts file:
192.168.1.64 myshop.com change magento base url as:
php bin/magento setup:store-config:set --base-url="http://myshop.com/" php bin/magento setup:store-config:set --base-url-secure="https://myshop.com/" php bin/magento cache:flushadd domain name to nginx config:
listen 8091; server_name myshop.com;
open your browser with: http://myshop.com/
this is it.
-
I just testing with local host, intstead of "myshop.com" shall i use "localhost/magento2"?zus– zus2019年12月30日 05:03:30 +00:00Commented Dec 30, 2019 at 5:03
-
@ vim /etc/nginx/conf.d/magento.conf justpaste.it/3me3hzus– zus2019年12月30日 05:13:02 +00:00Commented Dec 30, 2019 at 5:13
-
domain name and base url must be the same, you can use your base url as:
http://192.168.1.64:8091/but better option to avoid usinglocalhostin base url and even subfolder.MagenX– MagenX2019年12月30日 09:03:22 +00:00Commented Dec 30, 2019 at 9:03
Explore related questions
See similar questions with these tags.