Cara Instalasi dan Konfigurasi Web Server pada Debian 9
3 min read
18 days ago
Published on May 21, 2025
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
Introduction
This tutorial provides step-by-step instructions on how to install and configure a web server on Debian 9 using VirtualBox. By following these steps, you will set up a functional web server environment suitable for various applications.
Step 1: Prepare Your Environment
- Download VirtualBox
- Go to the VirtualBox website and download the latest version for your operating system.
- Download Debian 9 Image
- Obtain the Debian 9 OVA file from the provided link: Debian9.ova.
Step 2: Import Debian 9 into VirtualBox
- Open VirtualBox.
- Import OVA File
- Click on
File
in the menu. - Select
Import Appliance
. - Browse to the location of the downloaded
Debian9.ova
file and select it. - Click
Next
, review the settings, and then clickImport
.
Step 3: Configure Network Settings
- Select the Imported VM
- Click on the Debian VM you just imported.
- Go to Settings
- Click on
Settings
and navigate to theNetwork
tab. - Set Adapter
- Enable
Adapter 1
and set it toBridged Adapter
to allow your VM to access the internet.
Step 4: Start the Debian Virtual Machine
- Start the VM
- Click on
Start
to boot up the Debian 9 machine. - Login
- Use the default credentials (username:
debian
, password:debian
).
Step 5: Update the System
- Open Terminal
- Once logged in, open the terminal.
- Run Update Commands:
sudo apt update sudo apt upgrade -y
- Reboot if Necessary
- If prompted, reboot the system to apply updates.
Step 6: Install Apache Web Server
- Install Apache
- In the terminal, run the following command:
sudo apt install apache2 -y
- Start the Apache service:
sudo systemctl start apache2
- Enable it to start on boot:
sudo systemctl enable apache2
Step 7: Test the Web Server
- Open a Web Browser
- On your host machine, open a web browser.
- Access the Server
- Enter the IP address of your Debian VM in the address bar. You should see the Apache2 Debian Default Page.
Step 8: Configure Firewall (Optional)
- Allow HTTP and HTTPS Traffic
- Run the following commands to allow web traffic:
sudo ufw allow 'Apache Full'
sudo ufw enable
Conclusion
You have successfully installed and configured a web server on Debian 9 using VirtualBox. The key steps included importing the Debian OVA, setting up the network, installing Apache, and testing the server.
Consider exploring additional configurations, such as setting up virtual hosts or installing PHP for dynamic content handling. This foundational setup serves as a great starting point for further learning in web server management.