confluence修改默认端口
confluence默认会启用三个端口:
8090:HTTP的连接器端口,这是 Confluence 用于接收来自用户浏览器的 HTTP 或 HTTPS 请求的端口。当您在浏览器中访问 Confluence 时,您实际上是连接到这个端口;
8000:服务器自己的端口,这是 Confluence 用于内部通信的端口,例如与其他 Atlassian 产品或插件之间的通信,这通常不是用户直接访问的端口;
8091:协同编辑服务端口;
修改方案
对于8090和8000端口:
- 如果是选择的安装包(比如:atlassian-confluence-7.15.3-x64.bin)安装的话,可以在安装的时候就可以按照提示修改端口以及安装路径;
- 如果已经安装好了,需要修改配置文件;
对于8091端口:
- 需要手动编辑配置文件修改;
操作步骤
修改8090和8000端口:
# 修改配置文件
/opt/atlassian/confluence/conf/server.xml
<Server port="8000" shutdown="SHUTDOWN" debug="0"> <Service name="Tomcat-Standalone"> <!-- ============================================================================================================== DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence. If using a http/https proxy, comment out this connector. ============================================================================================================== --> <Connector port="8090" connectionTimeout="20000" redirectPort="8443" maxThreads="48" minSpareThreads="10" enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11NioProtocol" proxyName="wiki.mywebsite.cn" proxyPort="80" scheme="http"/>
修改其中的Server port 和 Connector port 即可。
修改8091端口:
# 修改环境变量文件 /opt/atlassian/confluence/bin/setenv.sh
找到以下片段,在喜欢的位置加上一段 CATALINA_OPTS="-Dsynchrony.port=8092 ${CATALINA_OPTS}"
上面省略...
# Set the JVM arguments used to start Confluence. For a description of the options, see # http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html CATALINA_OPTS="-XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution ${CATALINA_OPTS}" CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}" CATALINA_OPTS="-XX:G1ReservePercent=20 ${CATALINA_OPTS}" CATALINA_OPTS="-Djava.awt.headless=true ${CATALINA_OPTS}" CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}" CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:+UseG1GC ${CATALINA_OPTS}" CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}" CATALINA_OPTS="-Dsynchrony.port=8092 ${CATALINA_OPTS}" CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}" CATALINA_OPTS="-Djava.locale.providers=COMPAT,SPI ${CATALINA_OPTS}" CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}" CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}" CATALINA_OPTS="-XX:ReservedCodeCacheSize=256m -XX:+UseCodeCacheFlushing ${CATALINA_OPTS}" export CATALINA_OPTS
其他省略...
按照上述方式插入一条即可;
参考文档:
https://confluence.atlassian.com/conf715/configuring-system-properties-1096098504.html
记得修改后,重启confluence。