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!
6 posts tagged with "devops"
View All TagsSetup Ci For Firebase Hosting Deployment
Automating your deployment process is essential for a smooth workflow, especially when working with Firebase Hosting. This guide will walk you through setting up Continuous Integration (CI) to ensure your changes are tested and deployed automatically.
Configure Domain To Port Using Apache
Install Apache and Node.js: Ensure Apache and Node.js are installed. If not, refer to the previous steps to install them.
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
Install apache on ubuntu
To install Apache on Ubuntu 24.04, follow these steps:
Update the package index:
sudo apt update
Install Apache:
sudo apt install apache2
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).
Install Nodejs on ubuntu
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:
Update your package index:
sudo apt update
Install the required dependencies:
sudo apt install curl software-properties-common
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 -
- To install a specific version, such as Node.js 16, use:
Install Node.js:
sudo apt install nodejs
Kill Port On Ubuntu
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:
Identify the process using the port: Use the
lsof
ornetstat
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
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
).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.