Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 8587  / 1 Year ago, sat, march 11, 2023, 5:46:47

I'm trying to add subdomains to my home server.



svn.domain.com
trac.domain.com



Due to dynamic IP I use dyndns service, on top of that I have domain.com hosted somewhere else. I created CNAME for subdomains on remote host to point to my user.dyndns.org domain.



So now when I visit either of subdomains: trac or svn, I see "It works!" message.



This done, I created two virtual host files under /etc/apache2/sites-enabled



file1: svn.domain.com and file2: trac.domain.com



contents:



<VirtualHost *:80>

ServerName trac.domain.com

DocumentRoot = /var/www/trac/repos

<Directory /var/www/trac/repos>
Order allow,deny
allow from all
</Directory>

</VirtualHost>


And



<VirtualHost *:80>

ServerName svn.domain.com

DocumentRoot = /var/svn/repos

<Directory /var/svn/repos>
Order allow,deny
allow from all
</Directory>

</VirtualHost>


But I get error: ERROR: Site trac.domain.com does not exist!



what am I doing wrong?


More From » apache2

 Answers
7

The config files need to be under /etc/apache2/sites-available. Then, when you do a2ensite, it will symlink those files to /etc/apache2/sites-enabled. You shouldn't need to touch sites-available manually.


[#38515] Sunday, March 12, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tiowift

Total Points: 119
Total Questions: 113
Total Answers: 110

Location: South Sudan
Member since Sun, Jul 11, 2021
3 Years ago
;