nixCraft Linux / UNIX / Shell Scripting Forum

nixCraft

Linux / UNIX Tech Support Forum

Lighttpd Subdomain Configuration

This is a discussion on Lighttpd Subdomain Configuration within the Web servers forums, part of the Mastering Servers category; Hello everybody ! I wanna add a subdomain to my website and point it in a directory example mywebsite.com files.website.com ...


Register free or login to your account to remove all advertisements.

Go Back   nixCraft Linux / UNIX / Shell Scripting Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

Thread Tools Display Modes
  #1 (permalink)  
Old 27th June 2009, 07:44 PM
Junior Member
 
Join Date: Jun 2009
OS: Debian
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
maxtox is on a distinguished road
Default Lighttpd Subdomain Configuration

Hello everybody !

I wanna add a subdomain to my website and point it in a directory example

mywebsite.com

files.website.com < how to do this in lighttpd and dns configuration ?

I have this now in my lighttpd configuration file :

Code:
$HTTP["host"] =~ "(^|\.)website\.com$"
Thanks.
Reply With Quote
  #2 (permalink)  
Old 27th June 2009, 10:07 PM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,299
Thanks: 13
Thanked 413 Times in 306 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

Do you have DNS configured properly to point to lighttpd IP? If so use it as follows:
Code:
$HTTP["host"]  == "files.website.com"{
        server.document-root = "/path/to/files.website.com/http"
        accesslog.filename         = "/var/log/lighttpd/files.website.com/access.log"
}
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote
  #3 (permalink)  
Old 27th June 2009, 11:03 PM
Junior Member
 
Join Date: Jun 2009
OS: Debian
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
maxtox is on a distinguished road
Default

Thanks for your reply nixcraft !

The DNS are OK i have configured
Code:
files.website.com    IP  A ( ADRESS )
And i have added your code into my lighttpd.conf

but when i type in my navigator the adress

files.website.com , i'm redirected into my forum !

please be aware that i use vbseo + vbulletin like you there , this my lighttpd.conf

Code:
##VHOST



$HTTP["host"] =~ "(^|\.)site\.com$" {
server.document-root = "/home/site.com/public_html"
server.errorlog = "/home/lighttpd/site.com/error.log"
accesslog.filename = "/home/lighttpd/site.com/access.log"




url.rewrite-once = (
"^/forum/(sitemap.*\.(xml|txt)(\.gz)?)$" => "/forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1",
"^(/forum/(admincp|modcp|clientscript|cpstyles|images|customavatars|styles|smiley)/.*)$" => "$1",
"^(/site\.ico|/robots\.txt|.*clear\.gif)$" => "$1",
"^/forum/(.+)\?(.*)$" => "/forum/vbseo.php?$2",
"^/forum/(.+)$" => "/forum/vbseo.php",

)

$HTTP["host"]  == "files.site.com"{
        server.document-root = "/home/site.com/public_html/files"
      
}
}
Reply With Quote
  #4 (permalink)  
Old 28th June 2009, 01:44 AM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,299
Thanks: 13
Thanked 413 Times in 306 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

For files.site.com set server.document-root outside original /home/site.com/public_html i.e. set it as follows:
Code:
   server.document-root = "/home/files.site.com/public_html"
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote
  #5 (permalink)  
Old 28th June 2009, 02:14 AM
Junior Member
 
Join Date: Jun 2009
OS: Debian
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
maxtox is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
For files.site.com set server.document-root outside original /home/site.com/public_html i.e. set it as follows:
Code:
   server.document-root = "/home/files.site.com/public_html"
i did it , but i'm always redirected into my forum

http://website.com/forum
Reply With Quote
Reply

Tags
lighttpd, lighttpd subdomin configuration, lighttpd.conf, web servers


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 Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Lighttpd Vbullenti VB SEO Configuration arbdoor Web servers 5 1st May 2009 12:39 AM
MX record for a subdomain h@foorsa.biz Domain Name Server 1 17th September 2008 03:22 AM
Lighttpd Subdomain Problem Mental Lexicon Web servers 2 24th July 2008 06:13 PM
Php lighttpd mysql setup and configuration for RHEL 5 raj Web servers 1 30th July 2007 12:50 AM
lighttpd domain and subdomain settings muks Web servers 4 8th March 2007 06:39 PM


All times are GMT +5.5. The time now is 01:05 PM.


Powered by vBulletin® Version 3.8.6 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38 39 40