linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Inserting a line at a specific point
@ 2005-12-16  6:04 MARG
  2005-12-16 10:03 ` Adrian C.
  2005-12-16 11:07 ` Glynn Clements
  0 siblings, 2 replies; 3+ messages in thread
From: MARG @ 2005-12-16  6:04 UTC (permalink / raw)
  To: linux-admin

Hi,

I want to insert these two lines in Apache's httpd.conf:
LoadModule python_module modules/mod_python.so
AddModule mod_python.c

just right after the line
LoadModule php5_module modules/libphp5.so

and not at the end of the file (with a simple echo "AddModule
mod_python.c" >> httpd.conf).

I've searched the web, tried my best, but couldn't make it.

Can you help me please ?

Warm Regards,
MARG

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inserting a line at a specific point
  2005-12-16  6:04 Inserting a line at a specific point MARG
@ 2005-12-16 10:03 ` Adrian C.
  2005-12-16 11:07 ` Glynn Clements
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian C. @ 2005-12-16 10:03 UTC (permalink / raw)
  To: linux-admin


You'll have to use sed. See the previous mails sent to the list.
Doesn't ApacheToolbox work for you? http://www.apachetoolbox.com

--Adrian

At 08:04 AM 12/16/2005, MARG wrote:
>Hi,
>
>I want to insert these two lines in Apache's httpd.conf:
>LoadModule python_module modules/mod_python.so
>AddModule mod_python.c
>
>just right after the line
>LoadModule php5_module modules/libphp5.so
>
>and not at the end of the file (with a simple echo "AddModule
>mod_python.c" >> httpd.conf).
>
>I've searched the web, tried my best, but couldn't make it.
>
>Can you help me please ?
>
>Warm Regards,
>MARG
>-
>To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inserting a line at a specific point
  2005-12-16  6:04 Inserting a line at a specific point MARG
  2005-12-16 10:03 ` Adrian C.
@ 2005-12-16 11:07 ` Glynn Clements
  1 sibling, 0 replies; 3+ messages in thread
From: Glynn Clements @ 2005-12-16 11:07 UTC (permalink / raw)
  To: MARG; +Cc: linux-admin


MARG wrote:

> I want to insert these two lines in Apache's httpd.conf:
> LoadModule python_module modules/mod_python.so
> AddModule mod_python.c
> 
> just right after the line
> LoadModule php5_module modules/libphp5.so
> 
> and not at the end of the file (with a simple echo "AddModule
> mod_python.c" >> httpd.conf).

Use a text editor.

Unless, that is, you need to automate the process. In which case, the
correct approach depends upon exactly why and how you need to do this. 
Whatever the reason, ad-hoc sed scripts to modify config files
probably isn't the right approach.

One option is to create a patch (with "diff") which you can apply with
"patch". Use -C or -U with a suitable argument so that the patch will
apply reliably to any httpd.conf file.

-- 
Glynn Clements <glynn@gclements.plus.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-12-16 11:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-16  6:04 Inserting a line at a specific point MARG
2005-12-16 10:03 ` Adrian C.
2005-12-16 11:07 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).