Solved

Setting Up Multiple Domains on Amazon Web Services

Posted on 2014-04-25
19
567 Views
Last Modified: 2014-05-06
I have an Amazon instance that I need to set up for multiple domains.  I have the Lamp stack built so now I need to know how and in what order to proceed to copy my existing sites over to the instance.

My instance has 2 16 GB SSD drives.  One is designated for swap.  I have 10 GB set up for root and I have an EBS volume of 100 GB.  But I am not sure on which disk the 10 GB is located.  Is there a way to know on which disk the swap is located?

I am having trouble understanding where the various files are located.  Meaning on which disk are they residing.  

When I run df -h from the command line, I get the following

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      9.8G  3.4G  6.4G  35% /
devtmpfs        1.9G   24K  1.9G   1% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
/dev/xvdb        16G  2.2G   13G  16% /media/ephemeral0
/dev/xvdd        99G   60M   94G   1% /data
[
When I SFTP into the instance I see /var/www/html but I am not sure what disk it is located on.  Is there a way to determine this?

I have 4 websites that will be on the instance so please step me through how to get their files and mysql DB's over on the instance.  I know I will need to setup virtual hosts but I don't know the sequence this needs to be done and how to get the respective websites in their correct locations.

I think if you talk in generalities I can do the specifics.  For instance, I have a tutorial on virtual hosts like this one http://calebogden.com/multiple-websites-amazon-ec2-linux-virtual-hosts/

Thanks,

Randal
0
Comment
Question by:sharingsunshine
  • 9
  • 6
19 Comments
 
LVL 61

Assisted Solution

by:gheist
gheist earned 480 total points
ID: 40024222
LAMP is good but which linux? Apache 2.2 or 2.4?

Generally if your default web root is /var/www/html you would make /var/www/site1 (with real name to not mess up later)
And where configs are included like /etc/httpd/confd you would
make vhosts.conf that makes NameVirtualHost:80 and Includes /etc/httpd/sites.d/*.conf

then make one *.conf per site, probably with unique access logs and web root from step 1

If you get specific i can tell exact places you can place files
General tutor is here
0
 

Author Comment

by:sharingsunshine
ID: 40025150
This is the version Server version: Apache/2.2.26 (Unix)

Thanks for your help.
0
 

Author Comment

by:sharingsunshine
ID: 40025153
3 of the 4 websites have their own ssl certs which needs to be considered too.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40025167
apache 2.2 -> you must use NameVirtualHost *:80

Which linux? I cannot guess where logs and configs and sites are by default... (leave them in default places, that makes selinux/apparmor happy and gives you system logrotate without extra configuration)
In all other places same pronciple - keep customisations to minimum, so you get no-effort benefit from vendor's upgrades.

for ssl certs all modern browsers support SNI, so NaViHo with port :443, if you want to
support very old browsers with SSL you need an IP address per hostname.
probably you want to run SSL sites via qualys ssl server test before calling whole internet in.
0
 

Author Comment

by:sharingsunshine
ID: 40025179
Since its Amazon it doesn't give the normal release details that I can find

Amazon Linux AMI release 2014.03

Linux ip-111-22-33-444 3.10.35-43.137.amzn1.x86_64 #1 SMP Wed Apr 2 09:36:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


If you can tell me a better command to use I will gladly supply what it shows.

If you could explain your comment below more I can proceed.  I am not an expert by any means so some of these terms are going to need more details for me to understand.

******
for ssl certs all modern browsers support SNI, so NaViHo with port :443, if you want to
support very old browsers with SSL you need an IP address per hostname.
probably you want to run SSL sites via qualys ssl server test before calling whole internet in.

Thanks,
0
 
LVL 61

Expert Comment

by:gheist
ID: 40025186
AMI is enough RHEL.

Are you sure you are using apache from amazon via yum? it must be 2.2.22+patches...

i.e do you have /etc/httpd/conf.d directory with conf files in it?
0
 

Author Comment

by:sharingsunshine
ID: 40025213
Yes, I used yum to update the initial load of linux

Here is what is in conf.d

[amazon_user]$ cd etc/httpd/conf.d
[amazon_user conf.d]$ ls -la
total 44
drwxr-xr-x 2 root root 4096 Apr 24 01:11 .
drwxr-xr-x 4 root root 4096 Apr 24 01:11 ..
-rw-r--r-- 1 root root  347 Dec 10 00:25 notrace.conf
-rw-r--r-- 1 root root 1795 Feb 27 00:49 perl.conf
-rw-r--r-- 1 root root  674 Mar 28 23:58 php.conf
-rw-r--r-- 1 root root  392 Dec 10 00:29 README
-rw-r--r-- 1 root root 9473 Dec 10 00:25 ssl.conf
-rw-r--r-- 1 root root  299 Dec 10 00:25 welcome.conf
-rw-r--r-- 1 root root   43 Feb 18  2013 wsgi.conf

Open in new window

0
 

Author Comment

by:sharingsunshine
ID: 40025264
I have the vhost.conf file set up and it passes syntax and apache restarted with no problems so we don't have to focus on that.
0
Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

 
LVL 32

Assisted Solution

by:shalomc
shalomc earned 20 total points
ID: 40025435
A note about SSL:
10% - 15% of todays browsers do not support SNI. Especially in dinosaur mega corps who are still stuck on XP, as well as prev gen phones and older computers.

Consider getting a SAN certificate instead, and use EC2 Elastic IP to ensure an unchanging IP addr.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40025459
XP users can use firefox for full encryption... They read in local newspaper and seen in local TV that XP is dead...

Example of "very good" ssl site:
https://www.ssllabs.com/ssltest/analyze.html?d=google.co.uk&s=74.125.239.119&hideResults=on
0
 
LVL 61

Expert Comment

by:gheist
ID: 40025464
For "passed syntax" you can use "apachectl configtest" before restart to keep site running...
0
 

Accepted Solution

by:
sharingsunshine earned 0 total points
ID: 40030001
No one has actually answered my question.  But you have helped in other ways.  

"Please step me through how to get the files and databases over on the disk that I need them on."

>>>> Here is the answer <<<<<<

I solved this be finding a term called mount point that gets assigned to the attached disks.  You can think of this like a directory off the root.  For example if you set up the mount point for the 100 GB disk to be storage.  Then when you use the public_dns/storage you will be writing and storing your data on the 100 GB disk.  This directory storage is automatically created when you assign the mount point to the external 100 GB disk.
0
 

Author Comment

by:sharingsunshine
ID: 40030665
I've requested that this question be closed as follows:

Accepted answer: 0 points for sharingsunshine's comment #a40030001
Assisted answer: 480 points for gheist's comment #a40024222
Assisted answer: 20 points for shalomc's comment #a40025435

for the following reason:

no one answered the question I asked and that was most important to me.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40030666
No way, you got general and specific instructions
0
 

Author Comment

by:sharingsunshine
ID: 40030755
I couldn't in good conscience say what you had given me was the answer so I did the best I could and gave you the same amount of points considering another person helped too.

I wanted the archives to reflect the answer because it has been hard for me to understand how you can specify where something is to be stored.  That was the main question I had that never got addressed.

This is what my response answered

I have 4 websites that will be on the instance so please step me through how to get their files and mysql DB's over on the instance.  I know I will need to setup virtual hosts but I don't know the sequence this needs to be done and how to get the respective websites in their correct locations.

Open in new window

0
 

Author Comment

by:sharingsunshine
ID: 40030772
I had no idea this would bother you.  If there is a better way to do this and still identify the correct solution please let me know.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now