By Anonskii
Hi guys,
I want to know to create subdomains for my lighttpd web server, please guide me through the easiest possible way. I’ve seen few tutorials about this but half of them are outdated and other half are really hard to understand.
Ubuntu 14.x Lighttpd latest version
Adz
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
There are a number of ways to do this, but the easiest is probably to use the “Simple Vhost” module. On Ubuntu, you can enable it by running:
sudo lighty-enable-mod simple-vhost
sudo service lighttpd force-reload
Next edit the file: /etc/lighttpd/conf-enabled/10-simple-vhost.conf Here you can set the base “server root” and the “document root.”
simple-vhost.server-root = "/var/www"
simple-vhost.document-root = "/htdocs/"
In this example, domains found in the /var/www directory will serve content found in the /htdocs/ directory. For example, if your sub-domains are blog.example.com and www.example.com you would put the files you want to serve in the coorisponding directories:
/var/www/blog.example.com/htdocs/
/var/www/www.example.com/htdocs/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.