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

feita há 4 meses321 visualizações
1 Resposta
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
ESPECIALISTA
respondido há 4 meses
profile pictureAWS
ESPECIALISTA
iBehr
avaliado há 4 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas