I have a domain hosted at Godaddy
adn hosting at Linode
. I added attached screen shot is my DNS settings. Blue highlighted area is where I put my hosting server's IP
Now I have 3 sites to be accessed on my server
- domain.store
- admin.domain.store
- operator.domain.store My main domain has a DOT in it, like domain.store would be my main doamin.
In Apache
, I created 3 different conf files
- 000-default.conf
- myproj-admin.conf
- myproj-operator.conf
contents of each file is same, (pointed to their respective directories).
000-default.conf
<VirtualHost *:80>
ServerName www.admin.domain.store
ServerAdmin webmaster@domain.store
# Change the paths below to the project document root such as /var/www/project1.
DocumentRoot /var/www/adminProject/public
<Directory /var/www/adminProject/public>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Set Default Log Paths
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
In each configuration file, I have pointed them to their respective directories. I did a2ensite
and service apache2 restart
and when I go to my domain and sub-domains, it loads the contents from only the main folder i.e. the directory where the 000-default.conf is pointed