LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-13-2007, 08:03 AM   #1
hank43
Member
 
Registered: Nov 2003
Distribution: centos 4.4
Posts: 94

Rep: Reputation: 15
apache httpd.conf constants?


Is there a way to decalare and use constants in a httpd.conf file? I haven't seen anything on it, but it would make migrating my file to other environments MUCH easier!
 
Old 04-14-2007, 01:18 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
what kind of thing are you actually trying to achieve? there are a lot of variables that get set in there.
 
Old 04-14-2007, 05:09 AM   #3
hank43
Member
 
Registered: Nov 2003
Distribution: centos 4.4
Posts: 94

Original Poster
Rep: Reputation: 15
i want to use the same httpd.conf file on multiple servers. Right now, when i migrate i need to change values for
NameVirtualHost
the VirtualHost tag
'Allow from' lines
ServerName
ServerAlias
Listen IP
names of my log file
...

It becomes a large 'find and replace' exercise.

what i am looking for is a way to declare these at the top of the file and use them throughout. here is the basic idea

Code:
<property name="ipaddress" value="192.168.1.123" />
<property name="server1" value="www.superball.com" />

NameVirtualHost ${ipaddress}
<VirtualHost ${ipaddress}:80>
ServerName ${server1}
...
Does apache support this type of functionality?
 
Old 04-14-2007, 05:49 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well no you can't do that, but things like virtualhost declarations don't require ip addresses if there's only one. also can't see a logic in needing to change a virtualhost server name in multiple locations either. you could certianly build a template file to replace yourself, but i'm still not sure why you'd need to do this on a properly conifigured apache instance.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache httpd.conf ilnli Linux - Software 9 01-11-2005 06:58 AM
Apache httpd.conf help BoardinBum Linux - Software 4 12-29-2004 12:59 PM
Help me fix my httpd.conf for Apache spoody_goon Red Hat 14 01-17-2004 05:55 PM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM
apache httpd.conf plisken Linux - Software 1 02-01-2003 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration