Changing port in Apache Traffic Server: Default is 80 - port

How can one change the default port in Apache Traffic Server? Default is 80.
I have changed it to one of unreserved port through proxy.config.socks.http_port.
It does not seem to be working.
I am sure it must be a very small thing which is missing.
Could anyone please help me?

Well, the default is actually 8080 if you built from the source tree. You are not modifying the correct configuration though, the one you are modifying is for SOCKS support (which is not HTTP). What you are looking for is proxy.config.http.server_ports.
For more details, see https://docs.trafficserver.apache.org/en/latest/reference/configuration/records.config.en.html?#proxy-config-http-server-ports
E.g.
CONFIG proxy.config.http.server_ports STRING 8888

Well, to open ports with numbers under 1024, you must run with sudo.

Related

Cant connect to External IP

I'm trying to connect to my public IP http://34.125.119.106:8080/, where I have a Jenkins service running but I can't and don't know why.
I've create firewall rule to allow tcp traffic on port 8080, which is the port exposed to Jenkins, but I still cannot connect. I looked into the /etc/default/jenkins file, to see if everything inside was configured correctly. I tried to line in this file like 'HTTP_HOST=127.0.0.1', like some people advise to do ,but it doesn't work for my case. Does anyone know how to solve this?
Sorry for my bad English.
enter image description here
i made a test and it successfully connected,but i still cant connect to my external Ip
Use the default settings, because HTTP_HOST=127.0.0.1 locks you out:
HTTP_HOST=0.0.0.0
HTTP_PORT=8080
HTTPS_HOST=0.0.0.0
HTTPS_PORT=443
Listing to all interfaces with 0.0.0.0 is fine, but HTTP_PORT should be -1.
As a first step my recommendation is to check if your service is exposed and through what port number. For this you can use command sudo netstat -plntu. You should be looking for an output similar to:
tcp6 0 0 :::8080 :::* LISTEN 17917/java
If its not, change your /etc/default/jenkins file to port 8080
After that from inside your GCP project, you can run a connectivity test having as source one of the IP addresses you are using to reach your Server and as destination your Servers VM instance IP address. This test will simulate traffic and tell you where it's getting stuck whether if it's stuck on the way to your Server or if your server is not correctly configured. You can get a good reference in this document.
If you have already configured your ingress firewall rule, just make sure its applied to your VM, it sometimes happens that you have a network tag on your VM instance and another tag on your firewall rule.

How can I make Apache Zeppelin/Shiro work on a different port (not 8080)?

Apache Zeppelin 0.9.0 preview1 including basic Shiro auth works fine as long zeppelin.server.port specified in conf/zeppelin-site.xml is 8080. However, I would like to use another port (e.g. 9000) for my zeppelin site (experimental localhost setup). When I change the port in zeppelin-site.xml, Shiro auth is no longer possible: the small indicator to the left of the "Login" button on the Zeppelin welcome/login screen is no longer green, but red and login is not executed no matter what credentials I enter.
I did not find any hint on the Shiro website; could anybody kindly give me an idea what could be wrong? Any help is much appreciated.
Problem: Port 9000
In a project, I encountered the same problem. We used the environment variable ZEPPELIN_PORT to set the Zeppelin port to 9000. According to the Apache Zeppelin documentation, this is the same setting as your zeppelin.server.port in zeppelin-site.xml. Using port 9000, for me the login did not work anymore and the login indicator became red instead of green.
Fix
Setting the port to some other value than 9000, for example 9090, fixed this problem.
The Zeppelin documentation of ZEPPELIN_PORT mentions:
Zeppelin server port
Note: Please make sure you're not using the same port with Zeppelin web application development port (default: 9000).
I could not find anything about changing this Zeppelin web application development port. But apparently some check of the Zeppelin login routine renders the login unusable if one tries to set port 9000 as ZEPPELIN_PORT. So just pick another port number and it should work.

Open Google Compute Engine Port 8000

I'm trying to set up a VM instance in Google Compute Engine. So far so good.
Now I've installed ajenti, which requires port 8000 for its web interface.
I created a firewall rule for TCP 8000. It doesn't work. I also set up iptables on the server to try to fix the problem. It ![still doesn't work]. I'm kind of desperate right now. I just want to access the web interface.
Thanks for help!
Firewall Rule
By default SSL is enabled in Ajenti. Try accessing your web page using https://YOURSERVERIP:8000
The target tag you have set restricts which instances the firewall rule applies to. Ensure that your instance has the http-server tag.

etc/hosts with port number (fix for foreman)

I am using Foreman specifing port 3000. How can I access my application by writting myapp.local in the browser instead of typing 0.0.0.0:3000?
I have added:
0.0.0.0 myapp.local
But when doing myapp.local it defaults to the default localhost for Apache, not the Rails app.
Short answer: You can't.
The host table is meant to map hostnames to IP addresses (Wiki). Ports come in at a different point.
However, you can specify the port Foreman should run on:
-p, --port
Specify which port to use as the base for this application. Should be a multiple of 1000.
I don't know the Foreman but as you connect to it with your browser than I assume it talks via HTTP. If so you can use proxy settings to point to that host:port. Try FoxyProxy. It's more like a workaround rather than a real solution but it should work (as far as it's not HTTPS)
If you're using Linux than another way is to use LD_PRELOAD to overwrite connect glibc function. It's quite low level hack but it's not so complicated.
Another way in Linux would be to make netfilter rule (iptables) to NAT the connection. It's not nice either as you'll need root level change to achieve simple thing.

How to find Port number of IP address?

We can find out IP address of a domain name or URL. But how to find out Port number on which a domain name is hosted?
Unfortunately the standard DNS A-record (domain name to IP address)
used by web-browsers to locate web-servers does not include a port
number. Web-browsers use the URL protocol prefix (http://) to
determine the port number (http = 80, https = 443, ftp = 21, etc.)
unless the port number is specifically typed in the URL (for example
"http://www.simpledns.com:5000" = port 5000).
Can I specify a TCP/IP port number for my web-server in DNS? (Other than the standard port 80)
Quite an old question, but might be helpful to somebody in need.
If you know the url,
open the chrome browser,
open developer tools in chrome ,
Put the url in search bar and hit enter
look in network tab, you will see the ip and port both
DNS server usually have a standard of ports used. But if it's different, you could try nmap and do a port scan like so:
> nmap 127.0.0.1
The port is usually fixed, for DNS it's 53.
If it is a normal
then the port number is always 80
and may be written as http://www.somewhere.com:80
Though you don't need to specify it as :80 is the default of every web browser.
If the site chose to use something else then they are intending to hide from anything not sent by a "friendly" or linked to.
Those ones usually show with https
and their port number is unknown and decided by their admin.
If you choose to runn a port scanner trying every number nn from say 10000 to 30000 in https://something.somewhere.com:nn
Then your isp or their antivirus will probably notice and disconnect you.
Use of the netstat -a command will give you a list of connections to your system/server where you are executing the command.
For example it will display as below, where 35070 is the port number
TCP 10.144.0.159:**52121** sd-s-fgh:35070 ESTABLISHED
Port numbers are defined by convention. HTTP servers generally listen on port 80, ssh servers listen on 22. But there are no requirements that they do.
domain = self.env['ir.config_parameter'].get_param('web.base.url')
I got the hostname and port number using this.

Resources