LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-15-2023, 07:26 AM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
new website opens using ip4 numbers but not using name


I rented a new cloud server with IONOS, cheap.

I have set it up, and used Filezilla to upload the webpages.

I have tested all the little webpages on my laptop first. Everything works as I want, all very very simple stuff!

I have not set up ssl yet.

Let's say my public ip4 number is 123.456.789.123

If I enter http://123.456.789.123 then my webpage opens, no problem.

Let's say my webpage name is mywebpage.com

If I enter http://mywebpage.com I end up at IONOS, not my webpage. I don't understand this.

I have set up a virtual host like this:

Code:
<VirtualHost *:80>
    ServerName mywebpage.com
    ServerAlias www.mywebpage.com
    ServerAdmin webmaster@mywebpage.com
    DocumentRoot /var/www/mywebpage.com/public_html

    <Directory /var/www/mywebpage.com/public_html>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/mywebpage.com-error.log
    CustomLog ${APACHE_LOG_DIR}/mywebpage.com-access.log combined
#RewriteEngine on
#RewriteCond %{SERVER_NAME} =mywebpage.com [OR]
#RewriteCond %{SERVER_NAME} =www.mywebpage.com
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
I disabled the default virtual host

Code:
# disable the default
sudo a2dissite 000-default.conf
I enabled my virtual host

Code:
# enable the new virtual host
sudo a2ensite mywebpage.com.conf
I reloaded apache2

Code:
# reload apache2
sudo systemctl reload apache2

Any tips about why the webpage name won't work, but the ip4 number works please??
 
Old 10-15-2023, 07:28 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Can you verify that the DNS entry for your web host is correct?
 
Old 10-15-2023, 10:44 AM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Yes. The resolution of a domain name to an IP address is done in the domain name system (DNS). The configuration of the web server has nothing to do with it.
 
Old 10-15-2023, 11:45 AM   #4
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks for the replies!

Maybe they don't work weekends?

I don't know how to verify the DNS entry.

It is not urgent, maybe it will work tomorrow!
 
Old 10-15-2023, 11:47 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Try host or dig:

Code:
host www.example.com
dig www.example.com
The number shown should match the IPv4 address you have. If not you'll have to edit the DNS entry to use the correct address.
 
1 members found this post helpful.
Old 10-16-2023, 01:05 AM   #6
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks for the replies!

Tried the below, using my real webpage name, of course, but nothing shows.

Quote:
pedro@pedro-HP:~$ host www.mywebpage.com
Host www.mywebpage.com not found: 3(NXDOMAIN)

Also this:

Quote:
dig www.mywebpage.com

pedro@pedro-HP:~$ dig www.mywebpage.com

; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> www.mywebpage.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48688
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.mywebpage.com. IN A

;; Query time: 8 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Mon Oct 16 06:59:20 BST 2023
;; MSG SIZE rcvd: 50

pedro@pedro-HP:~$
IONOS know my webpage name and details. I am not sure why they didn't register the name with the public ipv4 address I have.

Also, I am not sure why there are 2 ipv4 addresses, one beginning with 217. and another beginning with 195. (the public and login ipv4 number)

I will go through IONOS dns information, see if I can figure this out without calling them!

Last edited by Pedroski; 10-16-2023 at 01:15 AM.
 
Old 10-16-2023, 01:14 AM   #7
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
SOLVED!

I went to https://my.ionos.co.uk/domain-dns-se.../mywebpage.com

TYPE was set A, HOST NAME was set wwww VALUE was set to 123.456.789.123 SERVICE was empty ACTIONS was empty

I clicked the button Add record I think it was and now I can access www.mywebpage.com!

Now I just need to set up LetsEncrypt for https

Thanks for your help and advice!
 
1 members found this post helpful.
Old 10-16-2023, 01:24 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Quote:
Originally Posted by Pedroski View Post
SOLVED!
Now I just need to set up LetsEncrypt for https
No problem. LetsEncrypt has a rather complex but easy to configure client for GNU/Linux systems. It will be able to make certificated for several host names, say example.com and www.example.com, so that you can both with www in front of the name and without it.

Last edited by Turbocapitalist; 10-16-2023 at 01:51 AM. Reason: typo
 
Old 10-16-2023, 02:24 AM   #9
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
@Turbocapitalist: I remember you helped me with my previous cloud server, and I managed to use LetsEncrypt on that webpage.

I hope I can repeat that for this new cloud server!
 
Old 10-16-2023, 02:26 AM   #10
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
But somehow, I have set the DNS wrong: www.mywebpage.com works, but mywebpage.com does not!

I will try again tomorrow!

Last edited by Pedroski; 10-16-2023 at 09:30 AM.
 
Old 10-16-2023, 02:47 AM   #11
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Be sure to double check the spelling of each domain.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble getting IP4 connectivity on CentOS 7 - wrong route? Bufflehead Linux - Networking 1 11-18-2021 08:21 PM
nmcli dev list iface <interfacename> | grep IP4 does not work anymore project722 Linux - Networking 4 06-05-2014 06:59 PM
Errors in /var/log/messages "error: Missing or invalid IP4 prefix '0'" kimurayuki Linux - Networking 5 12-06-2012 01:17 PM
Command to know the stub domain ip address in ip4 format cola Slackware 7 04-10-2010 08:19 AM
Ip4 in IP6 encapsulator/decapsulator and raw socket the_ionic Programming 0 10-14-2009 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration