如何更改Apache的httpd.conf文件在Mac OS X?

编程入门 行业动态 更新时间:2024-10-27 00:33:52
本文介绍了如何更改Apache的httpd.conf文件在Mac OS X?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在MacBook上运行OS X试图教我如何编写CGI脚本和我卡上的第一步,改变的httpd.conf 文件。我以下说明: www.cgi101/book/connect/ mac.html ,我尝试使用终端命令须藤的vim的/ etc /的Apache2 / httpd的改变的httpd.conf 文件.conf文件。然而,当我准备尝试和保存文件时,它说,这是只读的。我正在按照指示说,我应该去掉注释 AddHandler的CGI脚本的CGI 但是,我怎么来,如果我不能做到这一点保存文件?

I'm on a MacBook running OS X trying to teach myself how to write CGI scripts and I'm stuck on the very first step, altering the httpd.conf file. I'm following these instructions: www.cgi101/book/connect/mac.html and I'm trying to alter the httpd.conf file using the terminal command sudo vim /etc/apache2/httpd.conf. However when I get ready to try and save the file it says that it's read-only. The instructions that I'm following say that I'm supposed to uncomment the line AddHandler cgi-script .cgi however, how am I supposed to do this if I can't save the file?

我是很新的CGI脚本,Apache和终端一般。

I'm very new to CGI scripts, Apache and terminal in general.

Edit:从命令的输出: ls -l命令/etc/apache2/httpd.conf 是:

The output from the command: ls -l /etc/apache2/httpd.conf is:

-r--r--r-- 1 root wheel 24330 Jul 11 2011 /etc/apache2/httpd.conf

编辑:当我试图挽救它说补充!重写。当我这样做使用命令 :! X 退出了,但产生的误差 launch_msg(检入),IPC失败:不允许操作。

When I try to save it says add ! to override. When I do so using the command :!x it exits out but produces the error launch_msg("CheckIn") IPC failure: Operation not permitted.

推荐答案

要保存的只读文件添加! Vim命令之后,而不是之前。如果您以后添加它,然后它会尝试运行shell命令(不Vim命令)。在这种情况下,你正在运行名为 X shell命令,打印你所提到的消息。您需要:X 保存并关闭或::W 来只保存文件

To save read-only file add ! after Vim command, not before. If you add it after, then it will try to run shell command (not Vim command). In this case you are running shell command named x, that prints message that you mentioned. You need :x! to save and close or :w! to just save file.

更多推荐

如何更改Apache的httpd.conf文件在Mac OS X?

本文发布于:2023-07-16 04:03:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117652.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何更改   文件   Apache   conf   httpd

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!