How to run an express App in Digitial ocean/AWS/GC

2019-08-18 10:52发布

问题:

My scenario is am running my server in cloud platform which doesn't have cpanel, what I have is another normal shared hosting service with cpanel support . is there any way to run the site in cloud and use the webmail service provided by shared hosting provider for my domain name? if there is anyway can anyone please explain how to do this as I don't want to shell out money to setup gsuite kind of service. Thanks in advance

回答1:

finally, I figured it out on my own with some research in google.

  • 1) Add new A record ( if possible/allowed add with name @ ) in your shared/hosting/cpanel service, and point it to your cloud providers IP(the IP on which your app is running).
  • 2) Add another A record with name www and point it to the IP of your service running in the cloud.
  • 3) Delete the CNAME record called mail.
  • 4)Add new A record with name mail and point it to your cpanel / webmail service providers IP.
  • 5)Add MX record and point it to destination mail.yoursitename.tld and set the priority as 0

By this point, you will be able to send mail.

  • 6) Add SPF record ( TXT record ) or go to Authentication settings in the Email section in your cpanel and enable SPF.

  • 7)Go to Email Routing in the Email section in your cpanel and select your domain then choose Local Mail Exchanger under Configure Email Routing. That's it now you will be able to receive emails also.

These were the steps I followed to make it work, my app is hosted in GCP and I am using the mail service provided by cpanel-webmail(Hostgator).

This link helped me a lot to figure out the initial steps ,( Answer by the user jtittle1 ) https://www.digitalocean.com/community/questions/how-to-solve-emails-problems-after-site-is-migrated-to-digital-ocean