AWS AutoScaling with VestaCP fleet as web tier

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
RouterRat
Posts: 20
Joined: Sat Dec 06, 2014 12:20 am

AWS AutoScaling with VestaCP fleet as web tier

Postby RouterRat » Sun Jan 04, 2015 4:15 am

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/3191509/nginx-error-99-cannot-assign-requested-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.

sayko360
Posts: 1
Joined: Thu Dec 07, 2017 10:43 pm

Re: AWS AutoScaling with VestaCP fleet as web tier

Postby sayko360 » Thu Dec 07, 2017 10:52 pm

did you solve it?

mehargags
Moderators
Posts: 822
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: AWS AutoScaling with VestaCP fleet as web tier

Postby mehargags » Fri Dec 08, 2017 12:07 pm

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 ?


Return to “Web Server”



Who is online

Users browsing this forum: No registered users and 7 guests