Gabriela Campedelli's picture

Hi,

I have a domain that has a site in one server, other than Amazon. I will use this domain to be my Magento site currently installed in Amazon using Turnkey Appliance.

When we install Magento Turnkey prompt ask us the domain that will serve the site. But after install, when we type Public IP or DNS ir redirects me to old site, that will be there while I backup content.

What should I write in etc/host in order to access Magento Installation in Amazon? I can't point DNS, wildcard or so on. I need to access it using IP.

Thank you,

Gabriela

Forum: 
Gabriela Campedelli's picture

I found this solution but could not make it work

Any help? Further instructions on how to run command. Terminal and mac os etc/host didn't work.

Gabriela

Jeremy Davis's picture

It is not enough to just tell your appliance that it needs to respond to that FQDN. You also need to change the DNS record to point to your new appliance.

To achieve your ends you have 2 options (although there are others...):

  • Maintain your existing DNS management (provided by your domain registrar) and purchase an elastic IP for your new appliance. An Amazon elastic IP is basically a static IP, so you will just need to configure your FQDN to point to your new elastic IP (you'll need to do this via your domain registrar - they usually have web tools that allow you to manage your DNS records yourself). You will also need to make sure that you associate your elastic IP with your appliance.
  • Move your DNS to Amazon's Route53 - This will also require some config with your domain registrar but then Amazon handles your DNS (and this can then be configured via TKL Hub / HubDNS). Reading: Migrating an Existing Domain to Amazon Route 53 and TKL HubDNS. Having an elastic IP then becomes optional (as HubDNS can change your records when your IP changes). Personally I'd still go with an elastic IP for anything important though as sometimes DNS propagation can be slow for some users (ones that use DNS supplied by their ISP - ISP DNS can be notoriously slow and can sometimes take up to 24 hours for IP changes to propagate).
Gabriela Campedelli's picture

Hi Jeremy:

I made some modification in my site and point DNS record to Elastic IP as your instruction in this forum.

But when I time my domain name in browser it writes my elastic IP instead of the domain name.

Which configuration am I missing in your appliance so when I type domain in browser it writes the domain name itself.

My Record are

A domainname.com to elastic IP

www.domainname.com to domainname.com

Do I have to run the command again?

Thank you

Gabriela

 

 

Gabriela

L. Arnold's picture

The registrar for the domain has a primary DNS server declared.  You can change servers but you need to start by looking at the domain registration and knowing which DNS server controls it now.

You then need Amazon and/or Turnkey-Hub working together with the DNS to respond properly.  If you have an Elastic IP it should be pretty easy.  Simply have your A Records point at the elastic IP. 

It is possible to have Amazon or Turnkey host your DNS also or to simply react to it. 

From Command Prompt or SSH type:  "ping www.yourdomain.com" to see which IP DNS wants to find.  If it can't find the IP you will be informed.


 

L. Arnold's picture

To get magento to Pop you first need to have your DNS for the IP and the Domain working together.  I believe the request for your domain name at startup is setting a variable within Magento also so that it responds to a host request.  Possibly you could just refer to an IP address but it is better to work with host names as IP addresses change and you may want to have multiple host names in Magento (and different stores as a result) all within the same server.

Generally you want Magento to have host names be declared.  This is done in the

.htaccess  ( especially needed for multiple domains in Magento)
 
Notes below from the file:  have to move back in  to .htaccess with nearly every upgrade of Magento
Replace domain1 with your domain name, domain2 etc.  Only have separate section for domains you have declared previously within Magento under websites also.
 
(But again, the Default install can work without this if you have set your DNS and IP (or ElasticIP) correctly before first boot of Magento.
 
 (from .htaccess below)
 
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#   Options -MultiViews

## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## I Added to my file the following
SetEnvIf Host www\.domain1\.net MAGE_RUN_CODE=domain1
SetEnvIf Host www\.domain1\.net MAGE_RUN_TYPE=website
SetEnvIf Host ^domain1\.net MAGE_RUN_CODE=domain1
SetEnvIf Host ^domain1\.net MAGE_RUN_TYPE=website

SetEnvIf Host www\.domain2\.com MAGE_RUN_CODE=domain2
SetEnvIf Host www\.domain2\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^domain2\.com MAGE_RUN_CODE=domain2
SetEnvIf Host ^domain2\.com MAGE_RUN_TYPE=website

SetEnvIf Host www\.domain3\.com MAGE_RUN_CODE=domain3
SetEnvIf Host www\.domain3\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^domain3\.com MAGE_RUN_CODE=domain3
SetEnvIf Host ^domain3\.com MAGE_RUN_TYPE=website


############################################
## this line is specific for 1and1 hosting

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

############################################
## default index file

    DirectoryIndex index.php

<IfModule mod_php5.c>
################################
L. Arnold's picture

I recall needing to set a few things with Amazon.  Also, if usng Turnkey Hub Servers, set up your host name properly in the Hub Control Panel.

Likely this is where you should work first rather than the .htaccess file which I discuss above.  That is more for "multiple host" response from one Magento server.

L. Arnold's picture

I am working through a Restore of Magento (for safety reasons).  I used an IP addres to install TKL Magento but entered the "real name" if I need it for the magento site.  The backend of TKL is working for SSH and Webmin at the actual IP address.  However, the domain entered on Install creates a functional redirect to that domain, which in my case is the running server.

This is fine for my use because all I need to do is swap the IP numbers and the new server will take over serving the domain, but I can use the "backup ip" number to restore data to as I am doing now.  (I will need to test that it comes up w/ the correct IP).

If you are getting a redirect you either misentered the name of your Server/Domain at App Build or you do not have DNS applied right.  The Host Name Entered, I recall, is entered into one of the Primary Database tables and can be edited with the MySQL server that comes with Turnkey Magento App build.

Gabriela Campedelli's picture

Many thanks for all!

I got everything working by simple adjusting Base URL at admin backend.

I have another question about Turnkey Magento appliance, since I'm suggesting the use to another client.

It is about permissions in server. How can I adjust that without having to change everything to 777 to install modules using Magento Connect downloader?

Thank you again,

Gabriela

 

 

 

Gabriela

Jeremy Davis's picture

Try just giving ownership to the webserver account (www-data). IIRC it will be something like this:

chown -R www-data:www-data /var/www/magento/

Add new comment