When installing apache22, in the file httpd.conf the following line
Code:
#ServerName www.example.com:80
needs to be replaced commonly by
Code:
ServerName localhost:80
I tried using the following
Code:
sed -i 's/#ServerName www.example.com:80/ServerName localhost:80/' /usr/local/etc/apache22/httpd.conf
but the error message was:
Code:
sed: 1: "/usr/local/etc/apache22 ...": extra characters at the end of l command
and the substitution was not made. What is the correct
sed command to achieve the substitution?
EDIT: This probably has to do with the "#" at the start of the line as the man page states:
Quote:
The ``#'' and the remainder of the line are ignored (treated as a
comment), with the single exception that if the first two charac-
ters in the file are ``#n'', the default output is suppressed.
This is the same as specifying the -n option on the command line.
|
It would still be useful to know how to solve this problem.