问题
CUPS implements its own web server to host CGI programs on http://localhost:631
server: https://github.com/apple/cups/blob/master/cups/http.c
CGI pages: https://github.com/apple/cups/tree/master/cgi-bin
Creating a web server just for a printing daemon seems like duplicate code and bloat that might lead to code harder to maintain and possible creation of bugs.
Why an actual httpd daemon like Apache is not used?
回答1:
CUPS uses the Internet Printing Protocol (IPP) for transferring jobs from print clients to print servers (and potentially to printers, if these support IPP).
IPP is based on HTTP.
But IPP is not the same as HTTP.
Also, the CUPS web server is not the same as the CUPS printing daemon. You can disable the web interface completely by putting WebInterface No
into your cupsd.conf.
Using Apache or any other HTTP daemon would not so much unbloat CUPS: because these daemons do not talk IPP, and they do not provide any functions as a print server. Therefore, adding them to CUPS just for the web interface would rather bloat up CUPS!
来源:https://stackoverflow.com/questions/41081105/why-cups-ships-a-web-server-instead-of-using-httpd