- How to Find the IP Address of a Website in Linux
- Commands to find IP address of a website in Linux
- Method 1: Get website IP address with dig command
- Method 2: Use nslookup command to find IP address of website in Linux
- Method 3:Get IP address of website using host command
- Method 4: Get website’s IP address with ping command in Linux
- Creating Your Own Webserver and Hosting A Website from Your Linux Box
- Requirements:
- Install WordPress on Linux
- Install Drupal on Linux
- Install Joomla on Linux
- Setting Up Own Webserver and Hosting A Website in Linux
- What is Apache?
- What is MySQL?
- What is PHP?
- What is Kompozer?
- What is IP?
- How to Setup Virtual Server
- If You Appreciate What We Do Here On TecMint, You Should Consider:
How to Find the IP Address of a Website in Linux
How do I find the IP address of a website using Linux terminal?
Finding the public IP address of a website’s server is quite easy. In fact, there are several command line tools you can use to find the IP address of a website.
In an earlier article, I showed you how to find IP address in Linux. In this one, I am going to show you some of those commands here.
Commands to find IP address of a website in Linux
Do note that you might have to install some of these utilities mentioned here. Good news is that they are available in the default repositories of most Linux distributions. You can easily install them using the package manager of your distribution.
Method 1: Get website IP address with dig command
Dig is a DNS lookup utility. The sole purpose of this command is to perform DNS lookup and display the answers returned by the nameserver of the queried website.
The syntax is simple.
A sample output for the dig command looks like this:
You can see the IP address of the website in the ‘ANSWER SECTION’.
Facebook has tons of servers and you may see a different IP address based on your geo-location and time. You shouldn’t find it unusual.
Method 2: Use nslookup command to find IP address of website in Linux
Like Dig, nslookup command is also used for querying the DNS records. nslookup stands for ‘name server lookup’.
You might need to install nslookup. If you have sudo access, you can use your Linux distribution’s installation command to install this tool. On Debian and Ubuntu, the command below will install nslookup:
Once you have the tool, just use it in the following fashion:
For example, if I try to get the IP address of Facebook.com, this is the output I get:
Method 3:Get IP address of website using host command
Like the above two, host is also a DNS lookup utility. But unlike the above two commands, the output of the host command is neat and precise. It just displays the IPv4 and IPv6 addresses of a website.
You can use it like this:
Sample output would be like this:
Method 4: Get website’s IP address with ping command in Linux
Let’s see how to get the IP address of a website with the ping command in Linux.
Ping command is used to check whether the remote host is up or not. You can use either the server’s IP address or the URL. The syntax is pretty much the same.
A sample output for facebook.com looks like this:
You’ll have to use Ctrl+C to stop the ping command.
Conclusion
So, you just saw three networking tools that would give you the same result. I hope this quick Linux tip helped you to find the IP address of a website in Linux terminal.
In a related post, you may also read about finding the default gateway IP in Linux.
If you have any questions or suggestions, please leave a comment below. Don’t forget to subscribe to the newsletter and get all the new tutorials once each week, for free.
Источник
Creating Your Own Webserver and Hosting A Website from Your Linux Box
Many of you would be a web programmer. Some of you might be owing to a website and would certainly be editing and updating it frequently. While a few having no adequate knowledge of web technologies would still be planning to have one.
Through this article, I will make know how you could develop a working website with very little knowledge and could even host it using your Linux box. Things could be as simple as that.
Requirements:
Linux Box (However, You can use Windows but things surely won’t be as much simple and perfect as it will be on Linux Machine, Debian has been used here for example citing). If you don’t have an operating system installed, or you don’t know how to install a Linux operating system, then here are few guides that show you how to install a Linux operating system.
Apache, PHP, and MySQL (having a prompt knowledge of any other SQL, you can use it but examples in the article will be using MySQL.
Content Management Framework – Drupal with KompoZer, or you can use WordPress or Joomla.(But here I used Drupal as my Content Management System (CMS)).
Install WordPress on Linux
Install Drupal on Linux
Install Joomla on Linux
Setting Up Own Webserver and Hosting A Website in Linux
An Internet Connection with Static IP (Preferred) connected through a modem having a virtual hosting facility (In Reality it is not as much complex as it sounds here).
What is Apache?
Apache is a web server program. It comes installed and configured on most of the Systems. Check if it is installed on your system or not.
Sample Output
Sample Output
From the above output, it is clear that Apache is installed on the box, if it is not in your case you can ‘apt‘ or ‘yum‘ the required package. Once the Apache is installed start it as.
Note: You might have to type ‘httpd‘ and not ‘apache‘ on some server Viz., RHEL. Once the ‘apache2‘ or ‘http‘ aka ‘httpd‘ server is started you could check it in your browser by going to any of the following links.
This link will open into a hosted page which means Apache has been successfully installed and started.
What is MySQL?
MySQL is a database server program. It comes packed with a number of distros. Check if it installed on your system or not and where it is installed.
Sample Output
From the above output, it is clear that MySQL is installed along with the location of binary files. If in case it’s not installed, do ‘apt‘ or ‘yum‘ to install it and start it.
Note: You might have to type “mysqld” in place of mysql, obviously without quotes, in some distro viz., RHEL. Check the status of MySQL, run.
Sample Output
The above output shows that MySQL is running for 11 min 58 sec.
What is PHP?
PHP is the server-side scripting language designed for web development and is commonly used as a general-purpose programming language. You have to just deploy the php script after installing php. As I said above use ‘apt‘ or ‘yum‘ to install the required package for your box.
If you successfully installed the php in your system, you could check if it is working correctly or not by creating a file “info.php” in your ‘/var/www/html‘ or ‘/var/www‘ directory (which is your Apache directory) with the content given below.
Now navigate to your browser and type any of the following link.
Check PHP Info in Debian 10
Which means php is installed and working correctly. Now you can build your website in your Apache directory, however, it is not always a good idea to reinvent a wheel again and again.
For this, there exists the Content Management Framework (CMF), viz., Drupal, Joomla, WordPress. You could download the latest framework from the link provided below and can use any of these frameworks, however, we will be using Drupal in our examples.
Download Drupal from the above link which would be a tar archive. Move the tar archive to your Apache directory ‘/var/www/html‘ or ‘/var/www‘. Extract it to the root of the apache directory. Where ‘x.xx‘ would be version number.
If everything goes OK, again open your browser and navigate to the below links and you will be greeted with.
Drupal Installation
Choose Your language settings.
Language Selection
Checking for requirements and file permission. Provide proper permission to the required files and folders. You may need to create certain files manually, which is not a big deal.
File Permission Checking
Setup Database, the backend process.
Database Configuration
If the Database setting goes perfect profiles are installed automatically.
Database Installation
Installing Drupal
Configuring means setting ‘Site Name‘, ‘Email‘, ‘User Name‘, ‘Password‘, ‘Time Zone‘, etc.
Enter User Details
And if everything goes smoothly, you will get a screen something like this.
Installation Completed
Open Your page by referring to the address http://127.0.0.1.
Welcome to Drupal
What is Kompozer?
Kompozer is a tool that lets you work in GUI for designing a website in html and you can insert a php script anywhere you want. Kompozer made it too easy to create a web page.
well you don’t need to install it on most of the Linux system. Just download, extract, and run Kompozer.
Kompozer
If are creative, kompozer is right there for you.
What is IP?
A Few Words about Internet Protocol (IP) Addresses.
It is generally called loopback IP address or localhost, and it always points to the machine on which it is browsed. All the machines on a network referring to the above address will loop back to its own machine.
Ipconfig/ifconfig: Run this in your terminal to know your machine local address.
Sample Output
Search for the inet addr:192.168.1.2 here 192.168.1.2 is my local IP. Any computer on your LAN including you could refer to your hosted web page using this address.
However a computer outside of your LAN won’t be able to access your web page using this IP address. You will have to ask your Internet service provider to provide you with a static IP (That doesn’t change with time). Once you got your static IP address, the easiest way to find your IP is to type “My IP is” at google and note-down the result.
You won’t be able to access this IP from your own machine nor any other machine on your LAN. However, you can use a proxy server (www.kproxy.com) to access your hosted page using your static IP. But before that, you need to set up a virtual server and your service provider will surely be helpful in this regard.
How to Setup Virtual Server
Hmmm! That’s not difficult at all. First, you need to know the port apache is using, which in most of the case is 80.
the output would be something like:
Now go to your router which generally is http://192.168.1.1 and the user name/password would be admin-admin, however, it could be different in your case based on service provider and area.
Next, go to the Virtual server tab. Fill the port number, service name, and local IP address, inform, and save. Ask for assistance from your ISP.
Setup Virtual Server
Remember You will only be able to access this webserver from your machine, any other machine on your LAN, or a computer on the Internet when your machine is UP and running MySQL and Apache simultaneously.
With great power, comes a big responsibility. And now it’s your responsibility to safeguard your machine. Never give your IP address to any unknown person till you know your ways in and out.
We surely will try to cover the issues related to security and how to safeguard it. Feel free to give your valuable comments and share them with your friends. You know ‘Sharing is Caring‘. Your Positive comment encourages and motivates us.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник