Any documentation on how to configure multiple/2 domain for one amazon lightsail instance - multiple-domains

I need to set up two domain from godaddy to one instance of lightsail.
I already configure two hotzones, one for the example.com domain and the other for the example2.com domain.
The example.com is loading well, but I get the DNS_PROBE_FINISHED_NXDOMAIN on the second one.
I already updated the DNS on godaddy.
I modify the vhost with the two domains.
I have try to have one hotzone and a domain and subdomain and I havent been able to load the example2.com domain.

Move your DNS Management to Lightsail DNS Zone
Create static IP for your instance
Update your A Record pointing to your static IP
Follow this for all two Domains
Now your two domains point same Static IP which has a one instance

Related

Google Cloud VPS Compute Engine without a Domain

I have a VPS with Google Cloud Compute Engine which I can reach through an external IP. Next to my external IP I can reach my VPS through: 122.xx.xx.34.bc.googleusercontent.com
Is Google also offering an option to reach your website through NAME.bc.googleusercontent.com or something different than an IP.
I don't want use cheap domain name or free domain name as .tk
You can use any domain name to reach your VM instance that you run on Google Compute Engine. To do it follow steps below:
register domain name at any domain name registrar
set up DNS servers for your domain name (usually DNS hosting service provided by domain name registrar)
reserve external static IP for your VM (optional, but could be helpful)
create A record that point to external IP of your VM
wait 24-72 hours for propagating domain names
reach you service via domain name like https://domain.name
In addition, you can register your domain name at Google Domains and use Google Cloud DNS as DNS service for your domain.
You're not able to use NAME.bc.googleusercontent.com because 122.xx.xx.34.bc.googleusercontent.com is a PTR record.

How to set a name for Apache server?

I created successfully a apache server but I dont want to connect to it by typing 192.168.0.102, I want a normal url like www.google.com. How can I do that? I went to httpd.conf and found the ServerName line but setting it to something like www.mysite.com doesnt seem to work. I also tried to use my external ip(https://www.whatismyip.com) as server name but it doesnt connect. It only works if I try to connect to 192.168.0.102 or localhost. How do i solve this? Thanks
There are three basic things you need to know.
Virtual name hosting
HTTP allows multiple websites to be hosted on the same IP address and port. The client uses the Host request header to tell the server which site it wants to get data for.
ServerName is used as part of this.
… but the client needs to know how to send a request to the server first.
DNS
When a client makes a request to a server, it uses the IP address of the server in order to allow it to be passed over the network (or networks) to it. It is the address.
IP addresses are sequence so of numbers, which aren't very friendly for humans to work with.
DNS translates friendly names (like www.example.com) into IP addresses.
The client has to look up the name to find the IP address. It normally does this through the main DNS system, and in order to get your name linked to your IP address you will need to find a domain name registrar and pay them.
It is also possible to set up DNS at a local level on a private network, and on a computer-by-computer level using a hosts file.
Routing
The IP address of the server has to be routable from the computer the client is running on.
192.168.0.102 is a private address, accessibly only on the same LAN. To make it accessible to clients on the Internet you need to either:
Set up your router to use port forwarding and then use the Internet facing IP address of the router (which https://www.whatismyip.com tells you) or
Give your computer a public IP address and configure your router to route traffic to it (this generally isn't possible on consumer grade routers).
In short, you can't. 192.168.0.102 is not accessible from the Internet it is internal IP.
But you have some alternatives, like if you like to access your computer from a hostname you can use dynamic DNS servers.
Or you want to test your code on a spectacular domain, you can add 192.168.0.102 with a domain to your hosts file, then only you can use this domain with your local computer.
But, If you really want to serve some content to the Internet from your local computer you have to find a DNS server service (like cloudflare) to point your domain to your public Internet ip not to 192.168.0.102.
You configure the virtual host and set the server name to the domain name you want. After that, Apache will check the requests and will use that virtual host if a request was made for that domain name. In order for that to work, that domain should point to your IP address where the server is running.
If you want to test if the configuration works, edit your /etc/hosts file and add that domain name to 127.0.0.1. After that you will be able to access to that virtual host if you try to access to that domain name from your browser.
More info here : https://httpd.apache.org/docs/current/vhosts/name-based.html

Hosting multiple websites in Google Compute Engine

We have 8 websites and 5 of them are small. I would like to host those 5 website in same instance but their ip must be same and static. I couldn't find a way how to allocate a static ip for each of them and how to host them in a single instance. They are PHP. Their db's are hosted in Google SQL.
Per the Google Compute Engine docs on static IP addresses:
An instance can have only one external IP address. If it already has an external IP address, you must first remove that address by deleting the old access configuration, then adding a new access configuration with the new external IP address.
That said, you don't need to have a separate static IP address per website—you can serve an arbitrary number of sites from a single VM by using a feature such as Apache virtual hosts which let you serve a different site depending on the hostname that is requested by the user.
This can be possible using Protocol Forwarding.
You can have different IP addresses for each website while using single Virtual Machine.
I had successfully hosted my 3 sites using method in past. If you need, I can write up a detail explanation on some blog.

Subdomain to html

First of all I want to say that I'm new to the workings of DNS and server behavior.
Now I recently purchased a domain name, which redirect to my VPS IP adress.
on my linux VPS I have 2 folders with html files:
/var/www/html/home (containing):
home.html
/var/www/html/admin (containing):
admin.html
Since on the dns you can only type in an IP adress i don't know how to redirect the following:
admin.domain.nl -> html/admin/admin.html
domain.nl -> html/home/home.html
I want to have this working before launching a Java EE application.
You don't do that type of routing using DNS.
DNS maps a hostname to an IP addresses, so your DNS configuration would look like this (using made-up IP addresses):
domain.nl A 123.45.67.89
admin.domain.nl CNAME domain.nl.
Then you configure your web server (Apache?) to serve different content based on the hostname included in the HTTP request. This is called "virtual hosts" in apache.
How to set this up is off-topic for StackOverflow

External IP address appears instead of Domain Name

I am running a website in Google Compute Engine and configured a DNS zone and an A record to point to the IP address where my web-server runs. In my domain registrar (GoDaddy), I changed name-servers to point to Google name servers.
I can browse to the website without issues, but it show the IP address of the server instead of domain name. How can I change that to show domain name such as www.example.com instead?
I have a website hosted in GCE running under a Linux machine Apache Server. I created an A record in my DNS pointing to the external IP address of the server. When I access the link the subdomain name is not replaced by the IP. I do not believe your issue is particularly related to Compute Engine.
Particularly if you are using WordPress you will need to change some configuration files as stated in
http://codex.wordpress.org/Changing_The_Site_URL
https://wordpress.org/support/topic/browser-displaying-ip-instead-of-domain-name
The below solution worked for me,
GCP set IP Address as site URL when you deploy WordPress on google cloud.
Please change it to your domain name,
WordPress Admin Panel >> Settings >> Site URL (& WordPress URL as
well) >> add your domain name into textbox
Attached is the image for your reference.