nypahe
Intern
Intern
  • UID2617
  • Fans0
  • Follows0
  • Posts4
Reads:3313Replies:7

[AliCloud Startup Program]Run 2 website on same ECS

Created#
More Posted time:May 6, 2017 10:53 AM
Can I run 2 websites (www.abc.com and www.xyz.com) on the same ECS package?
If it is possible, please send me the documentation to do so
Thanks

shhanshan
Forum Moderator
Forum Moderator
  • UID105
  • Fans5
  • Follows0
  • Posts343
1st Reply#
Posted time:May 9, 2017 14:28 PM
You can deploy two website in one ECS with following step:
1. www.abc.com point ECS IP
2.  www.xyz.com pint   ECS IP
3. Deploy website 1 in port 80
4.  Deploy website 1 in port 8080
5.  www.xyz.com:8080 or  www.abc.com:8080 can access the second website
AlibabaCloud.com

mao
mao
Intern
Intern
  • UID1374
  • Fans2
  • Follows0
  • Posts8
2nd Reply#
Posted time:May 11, 2017 8:32 AM
You can run as many websites as your ECS instance's performance can support, with proper apache/nginx/etc configuration, you can run multiple sites with one ECS and one IP. You can find some nice webserver tutorial just by googling it.

nypahe
Intern
Intern
  • UID2617
  • Fans0
  • Follows0
  • Posts4
3rd Reply#
Posted time:Jul 13, 2017 4:32 AM
shhanshan:You can deploy two website in one ECS with following step:
1. www.abc.com point ECS IP
2.  www.xyz.com pint   ECS IP
3. ...
回到原帖
Not sure because, for each ECS you can just have one public IP address. Is it possible to create the sub address base on my public address? For example: my original IP address is 45.160.230.10. Can I generate the following IPs address and use them 45.160.230.11 and 45.160.230.12

hanneng
Assistant Engineer
Assistant Engineer
  • UID3277
  • Fans3
  • Follows0
  • Posts59
4Floor#
Posted time:Jan 19, 2018 17:25 PM
Hi nypahe

You can run one apache web server on a single ECS instance (a single IP address)  to serve many websites, for example, www.abc.com ,  www.xyz.com , www.def.com , www.ghi.com , etc

You need configure a few thing
1) configure VirtualHost on Apache
2) set the A record (in DNS) to point your domain to the IP

terzioglufaruk
Intern
Intern
  • UID5365
  • Fans0
  • Follows0
  • Posts2
5Floor#
Posted time:Mar 21, 2018 0:02 AM
Of course you can.  Not only 2 also - you can run many other web site. It's not related ECS it's all about web server configuration.

If you have windows server you need to configure IIS binding settings with describe hostname
If you have apache you need to congiure virtual host on apache like said by above post

roura
Intern
Intern
  • UID5629
  • Fans3
  • Follows2
  • Posts24
6Floor#
Posted time:May 15, 2018 18:18 PM
The way Hanneng showed is the classic one to serve multiple websites with one single Apache server. Another way would be with docker-compose, running multiple containers and using a reverse proxy.

Docker Compose, if not specified, assigns random ports that are free in the host for the containers.

BrianBae
Assistant Engineer
Assistant Engineer
  • UID5909
  • Fans0
  • Follows0
  • Posts58
7Floor#
Posted time:Jul 10, 2018 1:33 AM
You can set virtual host apache web server.


Please check below.

https://httpd.apache.org/docs/2.4/vhosts/examples.html
Guest