Author Topic: Installation over an Ec2 instance AWS  (Read 22212 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Installation over an Ec2 instance AWS
« on: May 27, 2016, 01:08:56 PM »
Hi!
I finally decided to try AWS Ec2 instances.. and now Im ready to install CWP on it.. but as I made my first fresh install over a CentOs 6.7 y found out two issues..

1st AWS gave 2 ips.. a public and a private..
2nd all my domain pages are showing the default  CentOs page..
(i realized that because I´ve created two users with two domains  Ex. (domain1.com and domain2.com) in each I´ve created an a.php file which only has on the first domain an echo "hello world"; the 2nd a.php (which is located at domain2.com) has only a phpinfo();) of course the 1st thing I thought.. was..ok, both domain has the same index.html but if try www.domain1.com/a.php should show me the echo, or the phpinfo if it was www.domain2.com/a.php...
unfortunatelly in my case showed a 404 error..

so, searching over here someone said that in those cases that:

"In some cases this issue is caused by the private or NAT-ed network and then you will need to use a private IP address which is configured on your server.
Amazon S3 and Microsoft Azure are know to have this kind of setup.

Fast Fix
– You need to enable NAT-ed network and enter your private IP by going to:
Left-Menu –> CWP-Settings –> Edit Settings
– You need to rebuild Virtual Hosts from CWP.

You can check the IP’s configured on your server by using a shell command."

So I did that.. went to Left menu, ->CWP settings-> edit settings..
i left the shared IP (public ip) where it says Shared ip:
and in nat local ip I put the private ip that AWS gave me which is the same that CWP shows as Server IP.
y also selected the Activate NAT-ed Mod:
Saved it..
then I rebuild Apache Vhosts..
and then I was able to access the domains or so I thought..

now if I try www.domain1.com/a.php it shows me the echo..
but if I try www.domain2.com/a.php instead of showing me the phpinfo();..it also shows me the echo !!! who could that be possible? is this a bug? or am I doing something wrong?

Anyway.. I´ve tried to fix it my self.. but I´ve made a mess.. so I decided to start all over again..I terminated the instance and now Im ready to start all over, but before doing that, could anybody help me to figure out if I did something wrong?

Many thanks!!

Freddo




Offline
*****
Re: Installation over an Ec2 instance AWS
« Reply #1 on: May 27, 2016, 03:32:54 PM »
hello !!! if you do wrong you'll get errors and you need to post the log here.

Offline
*
Re: Installation over an Ec2 instance AWS
« Reply #2 on: May 27, 2016, 05:09:28 PM »
Hi Sandeep!
Thanks for answering.. we'll as I've mentioned before I've made a fresh install and yet again installed CWP..

All seemed to be fine during installation.. so, I logged into CWP, created a package, then created an user account.. I uploaded a file "info.php" within /public_html folder..

When I access through web server..I could only see CentOs webpage.. if put www.domain.com/info.php it shows error 404..
so I did what I did last time, went to CWP settings, edited settings..

Once more I left the shared IP (public ip) where it says Shared ip:
and in nat local ip I put the private ip that AWS gave me which is the same that CWP shows as Server IP.
y also selected the Activate NAT-ed Mod:
Saved it..
Then I rebuild Apache Vhosts..

And, as before.. I was able to see www.domain.com/info.php Great..

so.. I´ve created an another user account.. eg. domaintwo.com
and uploaded another file "foot.php"

When I go to www.domaintwo.com my browser shows CentOs web page.. (ok, I never erased the index.html)
but.. www.domaintwo.com/foot.php shows error 404 not found..  :-(

Logged again to that account using ftp.. erased de index.html, uploaded another index..
nothing changed :-(

I don´t get what´s wrong..
Checked httpd error log nothing is shown..
could you help me out? what do you need to ease you help?

Many thank again for your answer!!
I Love CWP.. and i´ve installed many times..but never on AWS

Regards

freddo


Offline
*****
Re: Installation over an Ec2 instance AWS
« Reply #3 on: May 27, 2016, 07:19:51 PM »
Pm me the vps details

Offline
*
Re: Installation over an Ec2 instance AWS
« Reply #4 on: May 27, 2016, 09:25:10 PM »
Sure!
Thnks a lot!

EC2 server.. 2 cores 4 gb ram, 40 GB
O.S: CentOs 6.7 x64
CWP: 9.8.14

Private ip: 172.31.xx.xx
Elastic Ip: 52.40.XX.XXX

In CWP private ip mentioned above is set as Server IP.
And as a default (CWP set this automatically during install)
Elastic Ip, is set as shared ip in CWP.

I´ve set two accounts.. each one with only one domain..

domainone.com and 2nd account with domaintwo.com
 
if I browse www.domainone.com/info.php it goes ok!

if I browse www.domaintwo.com/foot.php it shows..error 404, also if I browse www.domaintwo.com/index.html error 404..
if I browse www.domaintwo.com it shows CentOs default page.. but Im sure this index.html is not from the domaintwo.com account..

but..strangest thing is.. if you go to www.domaintwo.com/info.php it shows its content!!! (but this file only exist on www.domainone.com) so how is this possible?..is this a bug?   

I guess that this is a problem with  server ip and the public ip or hsa to do with virtualHost.. but honestly I'm not shure how to fix it..

When i Created the accounts..this was shown..

# vhost_start domaintwo.com
<VirtualHost 172.31.xx.xx:80>
ServerName domaintwo.com
ServerAlias www.domaintwo.com
ServerAdmin mail@domaintwo.com
DocumentRoot "/home/usr2016/public_html"
ScriptAlias /cgi-bin/ "/home/usr2016/public_html/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/usr2016/domaintwo.com/*.conf

<IfModule mod_suexec.c>
        SuexecUserGroup usr2016 usr2016
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup usr2016 usr2016
        suPHP_ConfigPath /home/usr2016
</IfModule>

<Directory "/home/usr016/public_html">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end domaintwo.com

this are my cwp settings

Shared IP:   52.40.xx.xxx  (default: 172.31.xx.xxx)
Apache Port: 80 (default: 80)
Root Email:   xxxx@xxx.com
Forward root emails:
NAT Local IP: 172.31.xx.xx  Activate NAT-ed Mod: (checked)

Thank you very much for your help!!!

regards

fredo
« Last Edit: May 28, 2016, 12:08:09 AM by fredo »

Offline
*****
Re: Installation over an Ec2 instance AWS
« Reply #5 on: May 28, 2016, 05:29:51 AM »
i need to check your VPS, Pm me the ip and the password

Offline
*
Re: Installation over an Ec2 instance AWS
« Reply #6 on: May 28, 2016, 02:05:32 PM »
Hi Sandeep.

I've sent you de data you requested!
many thanks.

fredo

Offline
*****
Re: Installation over an Ec2 instance AWS
« Reply #7 on: May 28, 2016, 02:44:25 PM »
Solved

DNS issue pointing to wrong IP

Offline
*
Re: Installation over an Ec2 instance AWS
« Reply #8 on: May 28, 2016, 07:01:15 PM »
I wish to thank Sandeep,
for help me out with this issue!!

Regards and keep up the good work!!

Offline
*
Re: Installation over an Ec2 instance AWS
« Reply #9 on: September 07, 2018, 12:18:29 AM »
How was this issue solved? Can someone help me please. I have the same problem

Offline
*****
Re: Installation over an Ec2 instance AWS
« Reply #10 on: September 07, 2018, 05:55:49 AM »
check the DNS and A record

Offline
*
Re: Installation over an Ec2 instance AWS
« Reply #11 on: June 11, 2020, 08:55:32 AM »
Solved

DNS issue pointing to wrong IP


Hi Sandeep,

Could you please explain how can it be fixed, Iam facing this problem after many efforts reached here,
my issue is also same EC2 and same error.

Thank you.

Offline
*****
Re: Installation over an Ec2 instance AWS
« Reply #12 on: June 12, 2020, 07:07:53 AM »
already replied to your pm. A record DNS need to be added and for RDNS contact amazon support.