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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南