Hello,
I'm setting up a server on Amazon where I would like to have multiple sites on the same instance.
I've set up each site on a single IIS port on the IIS server, but the Amazon firewall only allows me to access port 80 from outside.
Hello,
I'm setting up a server on Amazon where I would like to have multiple sites on the same instance.
I've set up each site on a single IIS port on the IIS server, but the Amazon firewall only allows me to access port 80 from outside.
Amazon calls her firewall Security Group .
You can reach this option by the panel, following:
Look at the INBOUND and OUTBOUND tabs. INBOUND is where the input rules are, ie the ports that will be open for access to your server. Outbound are the rules of exit.
To edit the input ports, you must select the INBOUND tab and press the EDIT button. Then push the ADD RULE button and then assemble your rule. TYPE receives the type of incoming protocol, PORT-RANGE is the designation of the number or numbers of the ports and SOURCE defines who can use the rule (CUSTOM IP, ANYWHERE, MY IP). The difference from MY IP to CUSTOM IP is that it fills automatically with your public IP.
Check the security group associated with the instance, where you can authorize other ports and sources.
Friend, hosting multiple sites in the same instance does not require opening ports. You can leave the default 80. If your server is ubuntu or linux-amazon you just create the virtual host and point to the folder of your project.
example:
Imagine you have the 2 domains
www.site1.com.br
www.site2.com.br
for linux
open the file /etc/hosts
with the following command
nano /etc/hosts
and enter this line in the file
127.0.0.1 www.site1.com.br
127.0.0.1 www.site2.com.br
save and close the file
run the command cd /etc/apache2/sites-available
then% w / w%
You will notice that this folder has a file named ls
run the 000-default.conf
command,
this command will copy the file to another as the name cp 00-default.conf vhost.conf
then delete all information from this file and add the code
<VirtualHost *:80>
ServerName www.site1.com.br
DocumentRoot "/var/www/site1
<Directory "/var/www/site1">
AllowOverride all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.site2.com.br
DocumentRoot "/var/www/site2"
<Directory "/var/www/site2">
AllowOverride all
</Directory>
</VirtualHost>
Save and close the file.
run the vhost.conf
command to enable vhost
then a2ensite vhost.conf
to restart apache and you're done
The above example is for servers with so ubuntu. if for linux-amazon the process is the same with change in the commands.