Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Webapp-config Config File Variables?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
nirvdrum
n00b
n00b


Joined: 10 Aug 2004
Posts: 1

PostPosted: Tue Aug 10, 2004 5:08 pm    Post subject: Webapp-config Config File Variables? Reply with quote

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
View user's profile Send private message
Wilhelm
Tux's lil' helper
Tux's lil' helper


Joined: 27 May 2003
Posts: 149

PostPosted: Mon Dec 06, 2004 11:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Tue Dec 07, 2004 3:26 am    Post subject: Reply with quote

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
View user's profile Send private message
sPOiDar
n00b
n00b


Joined: 05 May 2005
Posts: 3
Location: Melbourne, Oz

PostPosted: Mon Nov 07, 2005 11:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
rl03
Retired Dev
Retired Dev


Joined: 27 Apr 2004
Posts: 27

PostPosted: Sat Jan 28, 2006 2:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum