Skip to main content

6 posts tagged with "devops"

View All Tags

· 7 min read
Sivabharathy

Securing a Linux server is a continuous process that goes beyond just installation and basic setup. Linux servers, while powerful and flexible, are not immune to various types of cyber threats like brute-force login attempts, malware, misconfigurations, and other vulnerabilities. This comprehensive guide will walk you through essential security steps to harden your Linux server, with detailed explanations and practical examples for each step. Let’s secure your Linux server!

· 2 min read
Sivabharathy
To configure a Node.js project to run as a domain using Apache on Ubuntu, you will use Apache as a reverse proxy to forward requests to your Node.js application. Here are the steps to achieve this:
  1. Install Apache and Node.js: Ensure Apache and Node.js are installed. If not, refer to the previous steps to install them.

  2. Install mod_proxy and related modules:

    sudo apt install libapache2-mod-proxy-html libxml2-dev
    sudo a2enmod proxy
    sudo a2enmod proxy_http
    sudo systemctl restart apache2

· 2 min read
Sivabharathy

To install Apache on Ubuntu 24.04, follow these steps:

  1. Update the package index:

    sudo apt update
  2. Install Apache:

    sudo apt install apache2
  3. Verify that Apache is installed and running:

    sudo systemctl status apache2

    This command will show the status of the Apache service. You should see a message indicating that the service is active (running).

· 2 min read
Sivabharathy

To install a specific version of Node.js on Ubuntu 24.04, you can use the NodeSource binary distributions. Here are the steps to do so:

  1. Update your package index:

    sudo apt update
  2. Install the required dependencies:

    sudo apt install curl software-properties-common
  3. Add the NodeSource repository:

    • To install a specific version, such as Node.js 16, use:
      curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
  4. Install Node.js:

    sudo apt install nodejs

· 2 min read
Sivabharathy

To free up a port that is currently being used by a process on Ubuntu, you need to identify the process and then terminate it. Here's how you can do that:

  1. Identify the process using the port: Use the lsof or netstat command to find the process ID (PID) of the process using the port. For example, to check port 3000:

    sudo lsof -i :3000

    Or using netstat:

    sudo netstat -tuln | grep :3000
  2. Find the PID: The output of lsof will look something like this:

    COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    node 12345 user 22u IPv4 123456 0t0 TCP *:3000 (LISTEN)

    Note the PID of the process (in this example, 12345).

  3. Kill the process: Use the kill command to terminate the process using its PID. For example:

    sudo kill -9 12345

    Replace 12345 with the actual PID from the previous step. The -9 option sends a SIGKILL signal, which forces the process to terminate immediately.