View previous topic :: View next topic |
Author |
Message |
nirvdrum n00b
Joined: 10 Aug 2004 Posts: 1
|
Posted: Tue Aug 10, 2004 5:08 pm Post subject: Webapp-config Config File Variables? |
|
|
Hi,
I don't use the default gentoo means of laying out directories for virtual hosts. Aside from using /home/www rather than /var/www, I lay my sites out as:
/home/www/domain.tld/subdomain
I find this makes list output easier to sort through (since not everything will start with "www") and in general make maintaining subdomains much easier.
The problem is, I can't figure out how to get webapp-config set up to work with this. I see its config file has a variable called "VHOST_ROOT", which looks like what I want to change, but the examples reference a "${G_HOSTNAME}" without explaining what it is or where it came from. I am left to assume it will expand to "subdomain.domain.tld", which isn't what I'm looking for.
Does anyone have any knowledge about what that referenced variable actually does, and if there are others similar that are composite components of it?
Thanks,
Kevin |
|
Back to top |
|
|
Wilhelm Tux's lil' helper
Joined: 27 May 2003 Posts: 149
|
Posted: Mon Dec 06, 2004 11:36 pm Post subject: |
|
|
I myself set it up as follows.
VHOST_ROOT="/home/vhosts/${G_HOSTNAME}"
I understand your problem since ${G_HOSTNAME} will contain subdomain.domain.ext which you want splitted.
I myself would supply every subdomain as a different site with it's own task which it should be.
My advice would be to modify your directory structure. Or try and pursuade the people behing webapp-config to allow more resolution on the settings. |
|
Back to top |
|
|
Chris W l33t
Joined: 25 Jun 2002 Posts: 972 Location: Brisbane, Australia
|
Posted: Tue Dec 07, 2004 3:26 am Post subject: |
|
|
How does this fly? Code: | VHOST_ROOT="/home/www/${G_HOSTNAME#*.}/${G_HOSTNAME%%.*}" | This uses Bash parameter expansion like the original, but with fancier footwork. It should give the following results:
which may not be exactly the behaviour you wanted for four-component domain FQDNs.
Caveat: I don't have a bash shell handy to test the syntax with, but you can find it in the bash man page. _________________ Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein |
|
Back to top |
|
|
sPOiDar n00b
Joined: 05 May 2005 Posts: 3 Location: Melbourne, Oz
|
Posted: Mon Nov 07, 2005 11:39 pm Post subject: |
|
|
Well, that's a little more elegant than my hack on webapp-config to allow this - too much perl coding for me I think
Anyway, here's the patch I applied, I might ditch it in favour of your syntax to remove the BASH 3.0+ dependency I created, especially since it has the same caveat as your version....
Code: |
--- webapp-config 2005-07-26 12:27:44.000000000 +1000
+++ webapp-config.new 2005-11-01 00:01:26.000000000 +1100
@@ -2208,6 +2212,12 @@
;;
-h|--host)
G_HOSTNAME="$2"
+ if [[ $G_HOSTNAME =~ '^(.[^.]+)\.(.+)$' ]]; then
+ G_HOSTNAME=${BASH_REMATCH[2]}
+ G_SUBHOSTNAME=${BASH_REMATCH[1]}
+ else
+ libsh_edie "'$G_HOSTNAME' is not a valid hostname"
+ fi
G_F_HOST=1
shift
;;
|
|
|
Back to top |
|
|
rl03 Retired Dev
Joined: 27 Apr 2004 Posts: 27
|
Posted: Sat Jan 28, 2006 2:51 pm Post subject: |
|
|
If this is still an issue, please file a bug on bugs.gentoo.org and we'll see if it's something that should be incorporated into the python version. |
|
Back to top |
|
|
|