我想知道如何更改Jenkins的默认端口8080。使用linux或Windows,只需通过配置文件即可完成。但是Jenkins的Mac配置文件看起来与其他文件完全不同。
当然,启动服务器时可以传递–httpPort参数,但是我想在配置文件中执行此操作。
有没有选择的余地?
PS:通过Apache传递Jenkins实例可以解决问题,但是我想更改Jenkins端口。
谢谢!
我将带您逐步了解:
cd /Applications/Jenkins sudo vi winstone.properties 添加httpPort=9999到文件。要查看您可以在其中输入的所有选项,请键入java -jar jenkins.war --help
cd /Applications/Jenkins
sudo vi winstone.properties
httpPort=9999
java -jar jenkins.war --help
运行java -jar jenkins.war的/Applications/Jenkins。您的端口将被更改。默认情况下会jenkins.war选择配置选项./winstone.properties。
java -jar jenkins.war
/Applications/Jenkins
jenkins.war
./winstone.properties
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