我在谷歌上搜索了很长一段时间的解决方案,但找不到答案。
我在 Ubuntu Linux 上,想在端口 80 上运行服务器,但由于 Ubuntu 的安全机制,我收到以下错误:
java.net.BindException:权限被拒绝:80
我认为禁用此安全机制以便所有用户都可以使用端口 80 或为当前用户分配访问端口 80 所需的权限应该足够简单。
我希望 syslog 在我的 linux 机器上以非 root 用户身份运行。这使得它不可能绑定到端口 514 - 因为这是一个特权端口。有什么办法可以授予非管理员用户“foo”侦听端口 514 的能力?
在 Linux(CentOS,如果重要的话)上有没有办法让普通用户使用 1024 以下的端口?(在该端口上打开侦听 TCP 套接字)
目前我知道只有 root 有权使用这些端口。
嗨,抱歉,这里的 Apache 和 Macs 的总菜鸟......感觉答案非常明显,但我一直在寻找多年没有成功
我在 /private/etc/apache2/extra/httpd-vhosts.conf 中有以下几行
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/Library/WebServer/Documents/mfoe/"
ServerName mfoe.cycle
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
httpd.conf 文件包含 vhosts
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
Run Code Online (Sandbox Code Playgroud)
那么为什么当我在终端中运行命令时: $ httpd -S 我得到:
httpd: Could not reliably determine the server's fully qualified domain name, using Alexs- MacBook-Air.local for ServerName
VirtualHost configuration:
Syntax OK
Run Code Online (Sandbox Code Playgroud)
看起来它没有在 vhosts 中读取任何内容。重新启动时出现此错误可能与此有关吗?
Alexs-MacBook-Air:/ alex$ httpd -k restart
httpd: Could not reliably determine the server's fully qualified domain name, using Alexs-MacBook-Air.local for ServerName
httpd not running, trying to …
Run Code Online (Sandbox Code Playgroud) linux ×2
port ×2
apache-2.2 ×1
mac ×1
mac-osx ×1
networking ×1
permissions ×1
root ×1
syslog ×1
virtualhost ×1