nixCraft Linux 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 existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


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

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2009, 08:44 PM
Junior Member
User
 
Join Date: Jun 2009
OS: Debian
Posts: 11
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 06-27-2009, 11:07 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,672
Thanks: 11
Thanked 240 Times in 180 Posts
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

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
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 06-28-2009, 12:03 AM
Junior Member
User
 
Join Date: Jun 2009
OS: Debian
Posts: 11
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 06-28-2009, 02:44 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,672
Thanks: 11
Thanked 240 Times in 180 Posts
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

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
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 06-28-2009, 03:14 AM
Junior Member
User
 
Join Date: Jun 2009
OS: Debian
Posts: 11
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 05-01-2009 01:39 AM
MX record for a subdomain h@foorsa.biz Domain Name Server 1 09-17-2008 04:22 AM
Lighttpd Subdomain Problem Mental Lexicon Web servers 2 07-24-2008 07:13 PM
Php lighttpd mysql setup and configuration for RHEL 5 raj Web servers 1 07-30-2007 01:50 AM
lighttpd domain and subdomain settings muks Web servers 4 03-08-2007 07:39 PM


All times are GMT +5.5. The time now is 12:59 PM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 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