将SonarQube的端口更改为80 [英] Change port of SonarQube to 80

查看:1399
本文介绍了将SonarQube的端口更改为80的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图将SonarQube的端口从9000更改为80。
我所做的是取消注释 sonar.web.port 并将其设置为 /opt/sonar/conf/sonar.properties 文件中的80,然后:

I've been trying to change the port of SonarQube from 9000 to 80. What I did was uncomment sonar.web.port and set it to 80 in the /opt/sonar/conf/sonar.properties file, and then:

sudo update-rc.d sonar defaults
sudo /etc/init.d/sonar restart

但是当我尝试访问URL时,什么都没有显示(服务器未提供答案)。
如果我恢复所做的更改并再次执行前两个命令,SonarQube不会返回。我必须重新启动计算机。

But when I try to hit the URL, nothing shows up (no answer from the server). If I revert my changes and execute the two previous commands again, SonarQube doesn't come back. I have to reboot the machine.

我正在运行最新版本的Ubuntu和SonarQube。该数据库位于SQL Azure上。一切都可以在9000端口上运行。

I'm running the latest version of Ubuntu and of SonarQube. The database is on SQL Azure. Everything works on port 9000.

我对SonarQube的了解有限,因此很可能我在做错事,但无法弄清楚是什么。

My knowledge of SonarQube is limited so it's most likely I'm doing something wrong but can't figure out what.

推荐答案

在Linux上,低于1024的端口只能由root用户绑定。您的SonarQube必须使用普通用户帐户运行。

On Linux the port below 1024 can only be bind by root user. Your SonarQube must be runned with a normal user account.

通常的解决方案是使用nginx或apache从端口80代理到9000。

The usual solution for this is to use nginx or apache to proxy from port 80 to 9000.

这篇关于将SonarQube的端口更改为80的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆