Linux / UNIX Tech Support Forum
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 ...
|
|||||||
| Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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"
}
|
| Sponsored Links | ||
|
|
|
||||
|
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"
}
__________________
Vivek Gite Linux Evangelist |
|
|||
|
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 |
|
||||
|
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"
}
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk - Removing domain name entires | nvbhole | Shell scripting | 0 | 18-12-2007 11:14 AM |
| wi-fi connection and Domain login on windows | surmandal | Computer Networking and Internet/broadband | 2 | 03-08-2007 06:51 PM |
| Howto remove the iptables settings on Linux | sweta | Getting started tutorials | 0 | 27-07-2007 06:52 AM |
| Masquerade domain sendmail how to | chiku | Mail Servers | 2 | 10-07-2007 08:20 AM |
| Help, samba 3.0.23 join ads domain | warren | Linux software | 1 | 09-01-2007 03:41 PM |