Release other Amazon HTTP ports

Asked

Viewed 3,672 times

0

Hello,

I am setting up a server on Amazon where I would like to have multiple sites in the same instance.

I set up on the IIS server each site on a port, but the Amazon firewall only allows me to access port 80 from outside.

  • Hello. In the case of Windows, you should search in the ISS the "bind" of each site. It is not necessary to use a different port for each site, everyone can work at port 80. Now, if you want to purposefully publish a site per port, you will need to associate a "Security Group" to your machine and in this "SG" created, release the ports you want, or release a "range" of ports in a single rule, if you feel better so.

3 answers

2

To Amazon calls her firewall Security Group.

You can reach this option through the panel by following:

EC2 Dashboard >> Network & Security >> Security Group

Note the INBOUND and OUTBOUND tabs. INBOUND is where the entry rules are, that is, the ports that will be open for access to your server. Outbound are the exit rules.

To edit the input ports, you must select the INBOUND tab and press the EDIT button. Then press the ADD RULE button and then mount your rule. TYPE receives the type of input protocol, PORT-RANGE is the designation of the number or port numbers 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.

0

Check the security group associated with the instance, in which you can authorize other ports and sources.

0

Friend, to host multiple sites in the same instance is not necessary to open doors. You can leave the standard 80. If your server is Ubuntu or linux-Amazon just create the virtual host and point to the folder of your project.

example:

Imagine you have both domains

www.site1.com.br
www.site2.com.br

for linux

open the file /etc/hosts

with the following command

nano /etc/hosts

and type this line into the file

127.0.0.1 www.site1.com.br
127.0.0.1 www.site2.com.br

save and close the file

execute the command cd /etc/apache2/sites-available afterward ls

you will notice that in this folder has a file with the name 000-default.conf

execute the command cp 00-default.conf vhost.conf, this command will copy the file to another as the name vhost.conf

then delete all information from that 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.

execute the command a2ensite vhost.conf to enable vhost

afterward service apache2 restart to restart apache and ready

The above example is for servers with Ubuntu. if it is linux-Amazon the process is the same with change in commands.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.