nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

lighttpd domain and subdomain settings

This is a discussion on lighttpd domain and subdomain settings within the Web servers forums, part of the Mastering Servers category; kindly help me shorten my domain and subdomain setting. I want the www.domain.com and domain.com work same with www.subdomain.domain.com and ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-06-2007, 11:20 AM
Junior Member
User
 
Join Date: Mar 2007
Posts: 13
Rep Power: 0
muks
Default lighttpd domain and subdomain settings

kindly help me shorten my domain and subdomain setting. I want the www.domain.com and domain.com work same with www.subdomain.domain.com and subdomain.domain.com

I currently have the following

Code:
$HTTP["host"] =~ "www.mydomain.info" {
server.document-root = "/home/mydomain/www"
server.errorlog = "/var/log/lighttpd/mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/mydomain.info/access.log"
}

$HTTP["host"] =~ "mydomain.info" {
server.document-root = "/home/mydomain/www"
server.errorlog = "/var/log/lighttpd/mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/mydomain.info/access.log"
}

$HTTP["host"] =~ "forums.mydomain.info" {
server.document-root = "/home/mydomain/subdomains/forums"
server.errorlog = "/var/log/lighttpd/forums.mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/forums.mydomain.info/access.log"
}

$HTTP["host"] =~ "www.forums.mydomain.info" {
server.document-root = "/home/mydomain/subdomains/forums"
server.errorlog = "/var/log/lighttpd/forums.mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/forums.mydomain.info/access.log"
}
Thanks in advance.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-06-2007, 12:28 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 919
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Can you explain what do mean by shorten domain names; Make sure you replace =~ with == as you are not using wild cards regex i.e.

Code:
$HTTP["host"] == "www.mydomain.info" {
server.document-root = "/home/mydomain/www"
server.errorlog = "/var/log/lighttpd/mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/mydomain.info/access.log"
}

$HTTP["host"] == "mydomain.info" {
server.document-root = "/home/mydomain/www"
server.errorlog = "/var/log/lighttpd/mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/mydomain.info/access.log"
}

$HTTP["host"] == "forums.mydomain.info" {
server.document-root = "/home/mydomain/subdomains/forums"
server.errorlog = "/var/log/lighttpd/forums.mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/forums.mydomain.info/access.log"
}

$HTTP["host"] == "www.forums.mydomain.info" {
server.document-root = "/home/mydomain/subdomains/forums"
server.errorlog = "/var/log/lighttpd/forums.mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/forums.mydomain.info/access.log"
}
Let me know if you need any further help...
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 03-06-2007, 01:49 PM
Junior Member
User
 
Join Date: Mar 2007
Posts: 13
Rep Power: 0
muks
Default

I wanna use wild cards so both www.domain.com and domain.com will go to

server.document-root = "/home/mydomain/www"


www.subdomain.domain.com and subdomain.domain.com will go to

/home/mydomain/subdomains/forums

so instead of having four "blocks" of codes, I'll only have two.

hope you could help me. I'm a big fan of your tutorials at cyberciti.biz that's why I was able to install lighttpd

thanks again
Reply With Quote
  #4 (permalink)  
Old 03-07-2007, 08:25 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 919
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You can try as follows:

Code:
$HTTP["host"] =~ "(^|\.)mydomain\.info$" {
server.document-root = "/home/mydomain/www"
server.errorlog = "/var/log/lighttpd/mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/mydomain.info/access.log"
}


$HTTP["host"] =~ "(^|\.)forums\.mydomain\.info$" {
server.document-root = "/home/mydomain/subdomains/forums"
server.errorlog = "/var/log/lighttpd/forums.mydomain.info/error.log"
accesslog.filename = "/var/log/lighttpd/forums.mydomain.info/access.log"
}
Let me know if you have any further issues...
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #5 (permalink)  
Old 03-08-2007, 06:39 PM
Junior Member
User
 
Join Date: Mar 2007
Posts: 13
Rep Power: 0
muks
Default

thank you very much

bless you heart
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
awk - Removing domain name entires nvbhole Shell scripting 0 12-18-2007 11:14 AM
wi-fi connection and Domain login on windows surmandal Computer Networking and Internet/broadband 2 08-03-2007 06:51 PM
Howto remove the iptables settings on Linux sweta Getting started tutorials 0 07-27-2007 06:52 AM
Masquerade domain sendmail how to chiku Mail Servers 2 07-10-2007 08:20 AM
Help, samba 3.0.23 join ads domain warren Linux software 1 01-09-2007 03:41 PM


All times are GMT +5.5. The time now is 04:40 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36