PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 21, 2022

[FIXED] How to create subdomain on Amazon EC2?

 September 21, 2022     amazon-ec2, linux, php, subdomain, virtualhost     No comments   

Issue

I have issue with creation subdomains on Amazon EC2 Ubuntu distribution, because I'm new in EC2 and linux administration.

I found this answer, but I don't understand third paragraph. Is it necessary? If so what is the CNAME record and where I should create this.

About fourth paragraph. I know that Apache 2.4 is not support NameVirtualHost. And I can not use it. Isn't it?

Fifth paragraph. httpd.conf don't exists in /ect/apache2/. But I have sites-available and sites-enabled directories. What should I do in this case?

And about subdomain path. I should locate subdomain directory in /var/www/sitename.com/www/ (root site directory) or in /var/www/sitename.com/. Is it fundamentally?

Thanks for your answers. Off topic: Sorry for my not good English.


Solution

  1. The CNAME record needs to be created in the DNS hosting your domain. You will need to do this with your DNS provider, typically not in the nameserver (bind) on your Ubuntu machine.

  2. NameVirtualHost is not needed anymore for Apache 2.4, yes. It was used before to instruct the server that a particular IP address and port combination was usable as a name-based virtual host. Nowadays, is sufficient.

  3. You can put the statements into any (new) file in sites-available and link that new file in sites-enabled, or create a new httpd.conf. All of that should work.

  4. Where to store the subdomain is entirely up to you and how you would like to structure your setup on your disk.

I hope this helps.



Answered By - i3i5i7
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing