Page 1 of 1

AWS AutoScaling with VestaCP fleet as web tier

Posted: Sun Jan 04, 2015 4:15 am
by RouterRat
Hi there,

I am trying to use VestaCP with AWS AutoScaling, however when my VestaCP fleet scales up, internal IP changes and newly launched instances are having issues with starting nginx and apache.

Here is what I get when I start Apache:

Code: Select all

root@ip-172-31-13-140:/home/ubuntu# service apache2 start
 * Starting web server apache2                                                                                                          AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/conf.d/172.31.3.140.conf:1
(99)Cannot assign requested address: AH00072: make_sock: could not bind to address 172.31.3.140:8080
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 * 
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Here is what I get when I start nginx:

Code: Select all

root@ip-172-31-13-140:/home/ubuntu# service nginx start
nginx: [emerg] bind() to 172.31.3.140:80 failed (99: Cannot assign requested address)
I've seen this post http://stackoverflow.com/questions/3191 ... ed-address
and added
net.ipv4.ip_nonlocal_bind = 1 in /etc/sysctl.conf then reloaded with sysctl -p /etc/sysctl.conf

Created a new config file with my internal IP /etc/apache2/conf.d/172.31.13.140.conf
Modified contents of it:

Code: Select all

NameVirtualHost 172.31.13.140:8080
Listen 172.31.13.140:8080
NameVirtualHost 172.31.13.140:8443
Listen 172.31.13.140:844
Then added my new internal IP in to

Code: Select all

/home/admin/conf/web/apache2.conf
/home/admin/conf/web/nginx.conf
/home/admin/conf/web/sapache2.conf
/home/admin/conf/web/snginx.com
However I still see old public IP under DNS settings, I am not using VestaCP as the name server so that's OK.

How do I go about dynamically changing internal IP addresses?
Now that the site is back up would this be enough effort?

Thanks.

Re: AWS AutoScaling with VestaCP fleet as web tier

Posted: Thu Dec 07, 2017 10:52 pm
by sayko360
did you solve it?

Re: AWS AutoScaling with VestaCP fleet as web tier

Posted: Fri Dec 08, 2017 12:07 pm
by mehargags
Can't you order static Elastic IPs for your dynamic stack ? Would be a lot easier that way.
Or,
may be you "update" your IP every day through Cron using this command

Code: Select all

/usr/local/vesta/bin/v-update-sys-ip
I'm not sure if this will work out of the box, may be you also need to rebuild Web or something ?

Re: AWS AutoScaling with VestaCP fleet as web tier

Posted: Mon Dec 18, 2017 5:40 am
by plutocrat
maybe a combination of these commands might help?

v-add-sys-ip
v-change-dns-domain-ip
v-change-sys-ip-name
v-change-sys-ip-nat
v-delete-sys-ip