Posted on January 19, 2014 at 11:17 pm
We have a domain “example.com” and a subdomain “sub.example.com”.
Create a file named “example.com.conf” in /etc/lighttpd/ directory:
$HTTP["host"] =~ "(^www\.example\.com|^example\.com)" { server.document-root = "/var/www/example.com/public/htdocs" server.errorlog = "/var/www/example.com/logs/error.log" accesslog.filename = "/var/www/example.com/logs/access.log" } |
Create a file named “sub.example.com.conf” in /etc/lighttpd/ directory:
$HTTP["host"] == "sub.example.com" { server.document-root = "/var/www/sub.example.com/public/htdocs" server.errorlog = "/var/www/sub.example.com/logs/error.log" accesslog.filename = "/var/www/sub.example.com/logs/access.log" } |
Note, we use regular expressions only to configure the domain.
Append these two lines in the file /etc/lighttpd/lighttpd.conf:
include "example.com.conf" include "sub.example.com.conf" |
Restart Lighttpd:
/etc/init.d/lighttpd restart |
Updated on January 21, 2014 at 9:36 am
Other Posts
- Route OpenVPN Connections Through Floating IP
- How to Configure a Floating IP in a VPS (Hetzner)
- Set OpenVPN to Listed on a Specific IP Address
- Bash Trim Leading and Trailing Whitespace from a String
- Bash Get Name of Ethernet Network Interface
- VPN Providers with Dedicated Static IP Address
- OpenVPN Iptables Rules
- WireGuard VPN Iptables Rules
Updated Posts
- AMD Chipsets & Graphics Card Drivers for Windows 7, 8, 10
- AMD Radeon 7400 Drivers for Windows 10
- How to pass custom command-line parameters in InnoSetup
- Add Desktop shortcut for all Windows PC users
- Programmatically create desktop icon with InnoSetup
- GeneratePress - a Lightweight WordPress Theme 2021
- InnoSetup disable DesktopIcon via command-line
- Use cURL to authenticate with JWT Bearer tokens