How do I change the splunk web server's port 8000 to port 8081?
Using port 8080 I can not access the web server, which is on a Amazon EC2 machine. Our EC2 Security Groups lists port 8081 as open.
These are the ports that Ive had to change (Search Head in my case)
Can be done in conf files
httpport = 18443
mgmtHostPort = 18089
appServerPorts = 18065
port = 18191
Or you can do it form the CLI
splunk set web-port set the port that Splunk Web listens on
splunk set splunkd-port new port that splunkd should listen on
splunk set kvstore-port sets the port that the KV Store uses
splunk set appserver-ports new port that Splunk application server should listen on
When on linux based OS, you actually can also leave everything default to avoid confusions by doing a port translation on the OS level:
sudo ipfw add 100 fwd 127.0.0.1,8000 tcp from any to any 12300 in
sudo ipfw add 101 fwd 127.0.0.1,8089 tcp from any to any 12398 in
and make it permanent in /etc/ipfw.conf
I looked everywhere and couldn't find this, so please upvote if this helped:
If you want to set Splunk to start up with a non-default port, non-interactively, before starting up for first time:
Copy the default web.conf from $SPLUNKHOME/etc/system/default/web.conf to $SPLUNK_HOME/etc/system/local/web.conf. (it will not exist in /local until created)
$ cp $SPLUNKHOME/etc/system/default/web.conf $SPLUNKHOME/etc/system/local/web.conf
More on file precedence here:
Remove lines unchanged. Just use the example below if you have no other changes.
To change the splunk web server port from the default value of 8000 to 12300, and the default splunk management port from 8089 to 12389, see example below.
httpport = 12300
mgmtHostPort = 127.0.0.1:12389
Save the file. Start splunk.
$ SPLUNK_HOME/bin/splunk start
Voila! It should confirm ports opened during the start up process:
> Checking prerequisites... > Checking http port : open > Checking mgmt port : open