Title: How to enable port 8080 for apache to serve APIs
Tags: apache2
Question: I'm using ec2 instance to server my Go apis. When I'm building my APIs then it will simply access by ```http://Ip:8080/api```. After that I'm working on frontend part to integrate my APIs I used react for it. In local everything is fine and running. But when I deploy my frontend on the server then it will show me error of fetching result from APIs ```http://Ip:8080/api``` need to use ```https://ip:8080/api``` then I created a sub domain and apply SSL on it and I successfully bind my IP with that subdomain and I'm able to access images which are on server folder path ```/var/www/html/images/a.png``` for that I'm using Apache server. But now when I run my Go services and run it with the subdomain name like ```https://subdomain:8080/api``` then it will not accessible. I'm pasting my ```ports.conf```
```# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
Listen 8080
<IfModule ssl_module&gt;
        Listen 443
        Listen 8080
</IfModule&gt;
<IfModule mod_gnutls.c&gt;
        Listen 443
</IfModule&gt;
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
```
Please let me know if any this is needed and also if I'm skipping something.

Comment: But I want to run my apis with `https` not with the `http` @LunaLovegood

Comment: Can add log and see if the port number is set.
AFAIK, while deploying in ec2, public instance and setting a domain or sub-domain, we usually don't set any port, it takes the http default port which is 80, while requesting we need not explicitly mention the default port, since it is default.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:08/11/20', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<apache2>', 'Title': 'How to enable port 8080 for apache to serve APIs', 'ViewCount': 556, 'id': 63358438, 'user_AboutMe': None, 'user_AccountId': 19037538.0, 'user_DisplayName': 'Puneet Jindal', 'user_Reputation': 95.0, 'user_Views': 24.0, 'user_id': 13898335.0}}