简体   繁体   中英

Apache '-k start' failed on Debian

when I try to start an Apache server, this comes out:

/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.

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. 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.

Ask your admin to change the port to 8080:

edit /etc/apache2/ports.conf with nano or vi

Listen 8080 #instead of Listen 80

don't forget, if you use virtualhosts, to put 8080 like this :< 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). X is a number between 1 and 254 corresponding to the end of the local IP hosting your apache server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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