Trying to host multiple websites from single Lightsail instance

0

Hi There,

I am trying to point two different domains (bought from Godaddy) to a single Lightsail instance. I have created two static IPs and connected with these two domains and also configured the nameservers on GoDaddy.

Now after this excercise, both domains are opening a same website. I have already tried to create vhosts and define document root but nothing worked for me.

Any help regarding this will be greatly appriciated.

Thanks Rahul

已提问 4 个月前321 查看次数
1 回答
1

Hello.

Is it possible for you to share the web server configuration file?
Also, could you please share the directory structure up to the document root?

Just to be safe, if you are using Apache, you can distribute document roots for each domain with the following settings.
https://httpd.apache.org/docs/2.4/en/vhosts/name-based.html

<VirtualHost *:80>
    # This first-listed virtual host is also the default for *:80
    ServerName www.example.com
    ServerAlias example.com 
    DocumentRoot "/www/domain"
</VirtualHost>

<VirtualHost *:80>
    ServerName other.example.com
    DocumentRoot "/www/otherdomain"
</VirtualHost>
profile picture
专家
已回答 4 个月前
profile pictureAWS
专家
iBehr
已审核 4 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则