Virtual hosting allows you to host many websites from one server.
-
adduser domain1 addgroup domain1 adduser www-data domain1 mkdir -p /home/domain1 chown domain1:domain1 -R /home/domain1 chmod 750 -R /home/domain1
adduser domain2 addgroup domain2 adduser www-data domain2 mkdir -p /home/domain2 chown domain2:domain2 -R /home/domain2 chmod 750 -R /home/domain2
Setup The Folders and users
- Open your lighttpd.conf
nano /etc/lighttpd.conf
- Add the following for the virtual host configuration
$HTTP["host"] == "domain1.com" { server.document-root = "/home/domain1" accesslog.filename = "/var/log/lighttpd/domain1/access.log" }$HTTP["host"] == "domain2.com" { server.document-root = "/home/domain2" accesslog.filename = "/var/log/lighttpd/domain2/access.log" } - Save your config and restart lighttpd
/etc/init.d/lighttpd restart


This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.