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

gefragt vor 4 Monaten322 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 4 Monaten
profile pictureAWS
EXPERTE
iBehr
überprüft vor 4 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen