简体   繁体   English

Apache '-k start' 在 Debian 上失败

[英]Apache '-k start' failed on Debian

when I try to start an Apache server, this comes out:当我尝试启动 Apache 服务器时,结果如下:

/usr/sbin/apachectl -k start
/usr/sbin/apachectl: 87: ulimit: error setting limit (Operation not permitted)
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action '-k start' failed.
The Apache error log may have more information.

What's wrong?怎么了? I can't do sudo, as this is a practice server provided by school server and I don't have su privileges.我不能做sudo,因为这是学校服务器提供的练习服务器,我没有su权限。

I'm a total newbie btw., trying to learn this.顺便说一句,我是个新手,正在努力学习。

Thank you in advance.提前谢谢你。

Apache can't listen on a protected port (80 is under 1024) without root privileges. Apache 无法在没有 root 权限的情况下侦听受保护的端口(80 低于 1024)。 You should let apache listen on a port bigger than 1024 and set the path of the logfiles to something where you have write permissions.您应该让 apache 侦听大于 1024 的端口,并将日志文件的路径设置为您具有写入权限的内容。

Ask your admin to change the port to 8080:请您的管理员将端口更改为 8080:

edit /etc/apache2/ports.conf with nano or vi使用 nano 或 vi 编辑 /etc/apache2/ports.conf

Listen 8080 #instead of Listen 80

don't forget, if you use virtualhosts, to put 8080 like this :< VirtualHost *:8080 >不要忘记,如果您使用虚拟主机,请像这样放置 8080 :< VirtualHost *:8080 >

and to add ":8080" at the end of your browser URL when you would access your site: http://example.com:8080 or http://192.168.1.X:8080(if you are on the same LAN).并在您访问站点时在浏览器 URL 末尾添加“:8080”: http: //example.com :8080http://192.168.1.X:8080(如果您在同一个 LAN 上) )。 X is a number between 1 and 254 corresponding to the end of the local IP hosting your apache server. X 是 1 到 254 之间的数字,对应于托管 apache 服务器的本地 IP 的末尾。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM