0

I have hosted my wordpress multisite on my amazon instance ec2-**-**-***-*.us-west-2.compute.amazonaws.com and the main site is showing on my IP **.**.***.* or public url , the sub-sites I wanted to show in sub domain so I have created the hosted on ec2 instance like

ec2-**-**-***-*.us-west-2.compute.amazonaws.com
india.ec2-**-**-***-*.us-west-2.compute.amazonaws.com
saudi.ec2-**-**-***-*.us-west-2.compute.amazonaws.com
canada.ec2-**-**-***-*.us-west-2.compute.amazonaws.com

or on IP like below

**.**.***.*
india.**.**.***.*
saudi.**.**.***.*
canada.**.**.***.*

So how can I use sub-domains on IP or public-url, I have added sub-domains to my hosts file and also added the virtual hosts for the same.

Note: I can add DNS to the domain hosting and host like domain.com, india.domain.com,saudi.domain.com,canada.domain.com but I wanted to use on IP or public URL of AWS instance.

hosts files:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost6 localhost6.localdomain6
127.0.0.1  **.**.**.* india.**.**.**.* saudi.**.**.**.* canada.**.**.**.*
127.0.0.1 ec2-**-**-***-*.us-west-2.compute.amazonaws.com india.ec2-**-**-***-*.us-west-2.compute.amazonaws.com canada.ec2-**-**-***-*.us-west-2.compute.amazonaws.com saudi.ec2-**-**-***-*.us-west-2.compute.amazonaws.com

Virtual host added for all regional sites

<VirtualHost *:80>
  ServerName india.ec2-**-**-***-*.us-west-2.compute.amazonaws.com
  ServerAlias india.ec2-**-**-***-*.us-west-2.compute.amazonaws.com
  DocumentRoot "/var/www/html"
  <Directory "/var/www/html">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
  </Directory>
</VirtualHost>

similarly added the virtual host for other sites canada and saudi and apart from this DocumentRoot "/var/www/html" will be same for all the site as I am making wordpress multisite.

6
  • let me know If you anyone needs more details. Commented Jan 26, 2020 at 7:37
  • What is the final url you want to use for the Canada site for example? Can you post your hosts file? Commented Jan 26, 2020 at 13:01
  • @RodrigoM For canada the final URL will be canada.ec2---**-.us-west-2.compute.amazonaws.com Commented Jan 26, 2020 at 13:09
  • You cannot do that. You can't modify the DNS of the domain amazonaws.com. Why don't you use a domain like canada.example.com? Commented Jan 26, 2020 at 13:27
  • I am wondering if I can do with the aws instance public URL or with IP. Commented Jan 26, 2020 at 13:30

1 Answer 1

1

Unfortunately you cannot do that. You can't modify the DNS of the domain amazonaws.com. This is the AWS domain for all AWS services, and it does not allow for any customer DNS records.

Sign up to request clarification or add additional context in comments.

5 Comments

Can we add to IP??
What do you mean exactly? Add what to IP?
I mean ec2 instance Elastic IP address.
Yes you can assign an EIP to the instance
IMHO the proper DNS set up for wp multisite is an wild card DNS record so all subdomains point to the instance eg *.example.com IN A x.x.x.x where you point all subdomains to the EIP of the instance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.