Hello, I hope you are feeling good. I have a relatively quick question. My Magento 2.4 server is working well. It is configured to run on the server IP and it has no domain name yet.
I would like to know how to change the config so that everything runs on the domain name instead.
I know it is possible to go and change the base secure/unsecure URL. It does change the default URL but what I would like to know is how to configure Nginx and Magento to use the domain name. Right now, even if the default URL uses the domain, it is not configured properly.
What is the complete steps I should take?
I believe I might need to go in my Nginx sites-enables folder and change the server-name.
I believe I might need to go in magenta 2.4 config to switch the base URL.
My domain name DNS is already pointed to my web server IP.
Do I need to do anything else for the website to run properly with my domain name? Thank you
@francisrivddb4That is all needed.
Point DNS to your hosting server. This may take up to 24 - 48 hours. Depending on TTL you have.
Have domain configured in your webserver - Nginx/Apache.
Have Magento configured with the same URL.
Ok thanks, I tried but It doesn't work. Should I be able to access the website by the ip too? I believe that yes, when I do it says:
Could it be permission error? I tried
cd <your Magento install dir> find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \; find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \; chmod u+x bin/magento
php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento cache:clean php bin/magento cache:flushStill
Been trying couple of things, now when I access my domain, or web server IP I get
"An error has happened during application run. See exception log for details." Am I getting closer to get it to work? How would I proceed from there?
The key steps to switch Magento from IP to domain name are: