May 11, 2013 Adem Bilican No comments

Add sub-domains to your server with Apache

Add sub-domains to your server with Apache
    If you have multiple services running on your server, and want to use sub-domains instead of sub-folders, here is a quick howto 😏
    I am running different services on my server at home, for example Shaarli and Leed. Instead of using different sub-folders of the main Apache /var/www/ folder, I preferred to use sub-domains. With sub-domains you obtain something like :
links.domain.com instead of domain.com/links
    To do so, you have to edit a file in the Apache configuration. In Ubuntu, the file is located under

/etc/apache2/sites-availabe/

Open the file named “default” with your preferred text editor and add the following lines at the end of the file

<VirtualHost *:80>
DocumentRoot /var/links/
ServerName links.domain.com
</VirtualHost>

The folder /var/links/ represent the installation folder of Shaarli.
Then, restart your Apache server

sudo /etc/init.d/apache2 restart

open your browser to links.domain.com
Enjoy ✅

Source: New feed

Leave a Reply

Your email address will not be published. Required fields are marked *