Default Avatar
Intern
Intern
  • UID2617
  • Fans0
  • Follows0
  • Posts4
Reads:94977Replies:10

[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

Latest likes:

Default Avatarzinyaw...

Default Avatar
Senior Engineer
Senior Engineer
  • UID105
  • Fans5
  • Follows0
  • Posts344
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

Default Avatar
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.

Default Avatar
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

Default Avatar
Engineer
Engineer
  • UID3277
  • Fans5
  • Follows0
  • Posts89
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

Default Avatar
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

Default Avatar
Assistant Engineer
Assistant Engineer
  • UID5629
  • Fans9
  • Follows2
  • Posts48
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.
DevOps Outsourcing & APAC Cloud Consulting | https://guztia.com

Default Avatar
Assistant Engineer
Assistant Engineer
  • UID5909
  • Fans1
  • 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

Default Avatar
Intern
Intern
  • UID8961
  • Fans0
  • Follows0
  • Posts1
8Floor#
Posted time:Mar 12, 2020 21:29 PM
Its possible
Once ECS instance =  1 linux web server
If you are running apache server, the you can configure virtual hosts in apache server.
See the server path directive option. You can run multiple websites serving from same port.
https://httpd.apache.org/docs/2.4/vhosts/examples.html


For each domain name, configuration file needs to be created in sites-available folder, then run the command to enable the website from ubuntu prompt
You can then restart the apache server by command sudo systemctl reload apache2

Default Avatar
Intern
Intern
  • UID8497
  • Fans1
  • Follows0
  • Posts10
9Floor#
Posted time:Apr 28, 2020 20:41 PM
order the free version of plesk web admin from alibaba cloud market place it allows you to host upto 3 domains for free on ecs , or you can have your own control panel.

Default Avatar
Intern
Intern
  • UID12051
  • Fans1
  • Follows0
  • Posts7
10Floor#
Posted time:Dec 12, 2021 15:02 PM
Yes, you certainly can. Not only that, but you can also run a variety of other websites or news sites. It has nothing to do with ECS and everything to do with web server configuration.

You must configure IIS binding settings with described hostname if you have a Windows server.
If you're using Apache, you'll need to set up virtual hosts as described in the previous post.
Default Avatar