在MacOS上更改Jenkins端口 [英] Change Jenkins Port on MacOS
问题描述
我想知道如何更改Jenkins的默认端口8080.使用linux或windows,只需使用配置文件即可完成。但是Jenkins的Mac配置文件看起来与其他文件完全不同。
I was wondering how one could change Jenkins' default port 8080. Using linux or windows, this is simply done with the configuration file. But the Mac config file of Jenkins looks completely different from the other ones.
当然可以在启动服务器时传递--httpPort参数,但我想做在配置文件中。
Of course one could pass the --httpPort parameter when starting the server, but I want to do this within a config file.
有没有选项?
PS:传递Jenkins实例apache会解决这个问题,但我想更改Jenkins端口。
PS: Passing the Jenkins instance through apache would kinda solve the problem, but I want to change the Jenkins port.
谢谢!
推荐答案
我将引导您完成它:
cd / Applications / Jenkins
sudo vi winstone.properties
将 httpPort = 9999
添加到文件中。要查看可以放入的所有选项,请键入 java -jar jenkins.war --help
cd /Applications/Jenkins
sudo vi winstone.properties
Add httpPort=9999
to the file. To see all the options you can put in there type java -jar jenkins.war --help
运行 java -jar jenkins.war
来自 / Applications / Jenkins
。您的端口将被更改。 jenkins.war
默认情况下从 ./ winstone.properties
中选择配置选项。
run java -jar jenkins.war
from /Applications/Jenkins
. Your port will be changed. jenkins.war
picks up config options from ./winstone.properties
by default.
Andrew-Finnells-MacBook-Pro:Jenkins afinnell$ pwd
/Applications/Jenkins
Andrew-Finnells-MacBook-Pro:Jenkins afinnell$ ls -al
total 87928
drwxr-xr-x 4 root wheel 136 Aug 21 12:32 .
drwxrwxr-x+ 83 root admin 2822 Aug 21 12:05 ..
-rwxr-xr-x 1 root wheel 45014470 Aug 19 13:14 jenkins.war
-rw-r--r-- 1 root wheel 14 Aug 21 12:32 winstone.properties
Andrew-Finnells-MacBook-Pro:Jenkins afinnell$ sudo cat winstone.properties
httpPort=9494
Andrew-Finnells-MacBook-Pro:Jenkins afinnell$ java -jar jenkins.war
Running from: /Applications/Jenkins/jenkins.war
webroot: $user.home/.jenkins
[Winstone 2011/08/21 12:33:19] - Beginning extraction from war file
Jenkins home directory: /Users/afinnell/.jenkins found at: $user.home/.jenkins
[Winstone 2011/08/21 12:33:21] - HTTP Listener started: port=9494
这篇关于在MacOS上更改Jenkins端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!