Installing Magento in a subfolder i.e., example.co…


Prerequisites were effectively mounted. I mounted Elastic Pile on Ubuntu 20.04 LTS. I adhered to all actions on this link ( approximately # 2. Mount as well as Set Up Kibana on Ubuntu which I did not require). Not a problem whatsoever.

After installment is full, I went to: example.com/magento as well as I obtained 403 Forbidden. I recognize this is an approval concern, however prior to I mounted Magento, I followed this overview as well as I established the permissions correctly as highlighted listed below:

 cd/ var/www/html/<< magento mount directory site>>.
discover var produced supplier pub/static pub/media app/etc -kind f -director chmod g+ w {} +.
discover var produced supplier pub/static pub/media app/etc -kind d -director chmod g+ ws {} +.
chown -R: www-data. # Ubuntu.
chmod u+ x bin/magento

When I initially mounted Magento 2, I had the ability to see it on the major domain name without https as well as in the example/Magento directory site. I assume the issue remains in my Nginx arrangement data as well as even more especially in the SSL/ports which are as complies with:

 ## Configure nginx for Magento 2.
upstream fastcgi_backend {

web server unix:/ var/run/php/ php7.4-fpm. sock;
}


web server {

origin/ var/www/example. com/html/directory;.

# Include index.php to the checklist if you are utilizing PHP.
index index.php index.html index.htm index.nginx-debian. html;.

server_name example.com www.example.com;.

area/ {
# First effort to offer demand as data, after that.
# as directory site, after that drop back to showing a 404.
try_files $uri $uri// index.php?$ args;.
}

# pass PHP manuscripts to FastCGI web server.
area ~. php$ {
consist of snippets/fastcgi-php. conf;.
fastcgi_pass unix:/ var/run/php/ php7.4-fpm. sock;.
}

# reject gain access to to.htaccess data, if Apache's paper origin.
# accepts nginx's one.
#.
area ~/. ht {
reject all;.
}

pay attention [::]:443 ssl ipv6only= on; # taken care of by Certbot.
pay attention 443 ssl; # taken care of by Certbot.
ssl_certificate/ etc/letsencrypt/live/ example.com/fullchain.pem; # taken care of by Certbot.
ssl_certificate_key/ etc/letsencrypt/live/ example.com/privkey.pem; # taken care of by Certbot.
consist of/ etc/letsencrypt/options-ssl-nginx. conf; # taken care of by Certbot.
ssl_dhparam/ etc/letsencrypt/ssl-dhparams. pem; # taken care of by Certbot.

} #closing web server tag.

## New block for magento.
web server {
pay attention 8080;.
server_name example.com www.example.com;.

established $MAGE_ROOT/ var/www/example. com/html/directory/ magento;.

# established $MAGE_MODE default;.
established $MAGE_MODE manufacturing;.

consist of/ var/www/example. com/html/directory/ magento/nginx. conf.sample;.
}

# Establish a proxy.
# resource: https://devdocs.magento.com/guides/v2.4/install-gde/prereq/es-config-nginx.html.
consist of/ etc/nginx/conf. d/ *. conf;.


web server {
if ($ host = www.example.com) {
return 301 https://$host$request_uri;.
} # taken care of by Certbot.


if ($ host = example.com) {
return 301 https://$host$request_uri;.
} # taken care of by Certbot.


pay attention 80;.
pay attention [::]:80;.

server_name example.com www.example.com;.
return 404; # taken care of by Certbot.




} 

consist of/ etc/nginx/conf. d/ *. conf; is connected to a brand-new data / etc/nginx/conf. d/magento _ es_auth. conf with the complying with materials:

 web server {
pay attention 8080;.
area/ _ cluster/health {
proxy_pass http://localhost:9200/_cluster/health;.
}
} 

sudo nginx -t

Returns:

 nginx: [warn] contrasting web server name "" on 0.0.0.0:8080, overlooked.
nginx: the arrangement data/ etc/nginx/nginx. conf phrase structure is ok.
nginx: arrangement data/ etc/nginx/nginx. conf examination succeeds

SSL certification revival sudo certbot restore– dry-run passed!

Nginx.confi.sample includes this material: nginx.conf.sample 

Exactly how can I repair this as well as what failed?

Leave a Comment