DEV Community

alok-38
alok-38

Posted on

Embarking on the Backend Developer Journey: A First Day Dive into Networking and Web Servers

Introduction:

The journey of a backend developer is an exhilarating one, marked by constant learning and exploration of the intricate world that powers the digital realm. As a newcomer to the field, my first day was a blend of excitement and curiosity, delving into the fundamental aspects of networking, web servers and linux commands. Here's a glimpse into the initial steps of my backend developer journey.

Basic Networking:

Unraveling the Web of Connectivity

To build a strong foundation, I began by familiarizing myself with basic networking concepts. Understanding the Domain Name System (DNS) was a pivotal starting point. DNS acts as the internet's directory, translating human-readable domain names into IP addresses. Tools such as ping, traceroute, cURL, httpie, dig, nslookup and browser developer tools became my companions in unraveling the intricacies of data transfer across the web.

Ping allows us to test the recheability of a host by sending a ICMP echo request. Here I have set up my host to be www.my_domain.com.

ping www.my_domain.com
PING www.my_domain.com (192.168.56.103) 56(84) bytes of data.
64 bytes from www.my_domain.com (192.168.56.103): icmp_seq=1 ttl=64 time=0.281 ms
64 bytes from www.my_domain.com (192.168.56.103): icmp_seq=2 ttl=64 time=0.100 ms
64 bytes from www.my_domain.com (192.168.56.103): icmp_seq=3 ttl=64 time=0.077 ms
64 bytes from www.my_domain.com (192.168.56.103): icmp_seq=4 ttl=64 time=0.072 ms
64 bytes from www.my_domain.com (192.168.56.103): icmp_seq=5 ttl=64 time=0.072 ms
^C

--- www.my_domain.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4076ms
rtt min/avg/max/mdev = 0.072/0.120/0.281/0.080 ms
Enter fullscreen mode Exit fullscreen mode

Here is the output of nslookup and dig commands. Both are DNS querying tools.I will dig deep into how DNS work in the near future. The line which reads ** server can't find www.my_domain.com: NXDOMAIN has been bothering me.

 nslookup www.my_domain.com
Server:         1.1.1.1
Address:        1.1.1.1#53

** server can't find www.my_domain.com: NXDOMAIN

alok@alok-VirtualBox:~$ dig www.my_domain.com

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

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

;; AUTHORITY SECTION:
com.                    900     IN      SOA     a.gtld-servers.net. nstld.verisign-grs.com. 1700908810 1800 900 604800 86400

;; Query time: 248 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Sat Nov 25 16:10:45 IST 2023
;; MSG SIZE  rcvd: 119
Enter fullscreen mode Exit fullscreen mode

Configuring DNS Address: Editing /etc/hosts
A practical hands-on experience followed as I learned to configure DNS addresses by editing the /etc/hosts file. This essential skill allows developers to map domain names to specific IP addresses locally, enabling efficient testing and debugging during the development process.

cat /etc/hosts
127.0.0.1       localhost
196.168.56.101  alok-VirtualBox
192.168.56.103  www.my_domain.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Enter fullscreen mode Exit fullscreen mode

Tinkering with HTTP Requests: GET, POST, and the World of URLs
With a solid grasp of networking fundamentals, I delved into the realm of HTTP requests. Performing GET and POST requests using powerful tools like cURL and httpie opened up a world of possibilities. I learned the significance of URLs (Uniform Resource Locators), the web addresses that define the path to resources on the internet. This knowledge proved crucial in interacting with web services and APIs.

 http www.my_domain.com
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 227
Content-Type: text/html
Date: Sat, 25 Nov 2023 10:44:24 GMT
ETag: "12f-60af287ec4a15-gzip"
Keep-Alive: timeout=5, max=100
Last-Modified: Sat, 25 Nov 2023 04:30:39 GMT
Server: Apache/2.4.52 (Ubuntu)
Vary: Accept-Encoding

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>my_domain website</title>
</head>
<body>
    <h1>Hello World!</h1>

    <p>This is the landing page of <strong>my_domain</strong>.</p>
</body>
</html>


alok@alok-VirtualBox:~$ curl www.my_domain.com
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>my_domain website</title>
</head>
<body>
    <h1>Hello World!</h1>

    <p>This is the landing page of <strong>my_domain</strong>.</p>
</body>
Enter fullscreen mode Exit fullscreen mode

Confirmed that the server is delivering the expected content for the given domain. Note the slight variation between the first and the second output.
The HTTP/1.1 200 OK status code indicates that the request has been successful and the server (Apache in my case) has successufully responded to the request.

Setting Up Apache Web Server and Virtual Hosts:

Navigating the Server Landscape

One of the cornerstones of backend development is mastering web servers. On my first day, I successfully set up the Apache web server and virtual hosts. This involved creating isolated environments for different websites on a single server. Examining error logs provided valuable insights into troubleshooting and optimizing server performance—a skillset integral to a backend developer's toolkit.

Understanding HTTP Traffic:

UFW and Allowing Access

Securing and managing HTTP traffic is a critical aspect of backend development. I learned how to use Uncomplicated Firewall (UFW) to control and monitor incoming and outgoing traffic. Allowing HTTP traffic through UFW became second nature as I gained an understanding of the essential security measures to implement on a web server.

Conclusion:

As I wrap up my first day on this exciting backend developer journey, I am filled with a sense of accomplishment and anticipation for the challenges and discoveries that lie ahead. The foundational knowledge gained in networking, DNS, HTTP requests, web servers, and server security sets the stage for a rewarding exploration into the heart of digital infrastructure. With each lesson learned, I am one step closer to contributing meaningfully to the dynamic world of backend development. The journey has just begun, and I am eager to see where it leads.

Top comments (0)