Can you show the conf file for the main site?
Feb 5, 2022
4
Level 2
Trying to host laravel on subdomain on ubuntu vps, but subdomain loading website from main domain
So far, this is what I have done:
- Added
Arecords:
Type name priority content ttl
A api 0 123.456.789.000 14400
-
set up project using git on
/var/www/project -
On
etc/apache2/sites-availablehitsudo nano api.domain.link.confand paste following code on it:
<VirtualHost *:80>
ServerName api.domain.link
ServerAlias www.api.domain.link
ServerAdmin [email protected]
DocumentRoot /var/www/project/public
<Directory /var/www/project/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
-
sudo a2ensite api.domain.link -
sudo systemctl reload apache2
sudo apachectl configtest
(Syntax Ok)
-
sudo systemctl restart apache2
Now, when I hit api.domain.link its loading domain.link. I want to load var/www/project/public on here
Please or to participate in this conversation.