User Tools

Site Tools


internet_server

This is an old revision of the document!


Install and Configure Internet Server

This page will show how to install and configure your very own Internet Server using the LAMP server package.

Note: LAMP stands for Linux, Apache, MySQL/MariaDB, PHP/Python


Installation of LAMP Server

Login As Root

  • Use su –login then update and upgrade Debian using command apt update && apt upgrade{{:screenshot_2025-01-16_123544.png?400|

Next, we are going to install a database. Here we going to install maria database.

  • Use sudo apt install mariadb-server mariadb-client

Next, we have to install apache2 web server

  • Use sudo apt install apache2 apache2-doc

After doing the installation, we need to enable its module

  • Use sudo a2enmod userdir

Then configure apache module in /etc/apache2/mods-enabled/userdir.conf to the following configuration:

  • Use sudo nano /etc/apache2/mods-enabled/userdir.conf

Go to /etc/apache2/mods-availabe and looking for php8.2.conf (seek for your own php version, maybe different)

  • Use cd /etc/apache2/mods-available then, in the /etc/apache2/mods-availabe directory, type ls to view all files available.
  • Type this command to check the content in php8.2.conf: sudo nano php8.2.conf

Next, Install the php-mysql

  • Use sudo apt install php php-mysql

Next create directory public_html. Use mkdir /home/(user)/public_html. Then change group and restart the web server. Use sudo chgrp www-data /home/(username)/public_html. Restart apache2 using Sudo systemctl restart apache2.service

Test the LAMP Server Installation

Install chromium browser.

  • Use sudo apt install chromium

Change network settings to Host-Only Adapter

Test apache installation

In the browser, type your ipaddress (10.0.2.15) to test the apache installation.

Test php installation

Go to /var/www/html directory

  • Use cd /var/www/html. Type sudo nano /var/www/htm/test.php to create test.php. Write <?php phpinfo(); ?>in the file test.php file

Open chromium and type ipaddress/test.php

  • 10.0.2.15/test.php

Test apache and php configuration

Change directory to /var/www/html using cd /var/www/html and create hello.html file using sudo nano hello.html

Open chromium and search for ipaddress/hello.html.

  • 10.0.2.15/hello.html

Installation of SSH Server

Install SSH server using sudo apt-get install openssh-server

Deleting old ssh keys using sudo /bin/rm -v /etc/ssh/ssh_host_*

Regenerate openssh host key using sudo dpkg-reconfigure openssh-server

Restart the ssh server using sudo sysmctl restart ssh

Remove the host fingerprint using ssh-keygen -R localhost

Then, Log in to SSH using ssh vboxuser@localhost

Test the SSH Server

Change to host only adapter and check for host ip address using hostname -I

Next, try to generate key using rsa using ssh-keygen -t rsa

Then copy the key using ssh-copy-id vboxuser@192.168.56.102

Now we are able to log in to ssh server without any password requirement.

  • Try using ssh vboxuser@192.168.56.102 and ssh vboxuser@localhost

Installation of FTP Server

Install the FTP Server

  • Use sudo apt-get install proftpd-basic

Install ftp to be able to use ftp command

  • Use sudo apt-get install ftp

Test the installation by typing ftp ipaddress

  • ftp 192.168.56.102

Next, Install GUI FTP

  • Search for FileZilla
  • Select Download FileZilla for Server
  • Then, install it using command on terminal. sudo apt-get install FileZilla
  • Try open the FileZilla

Enabling Chroot Jail

  • Use sudo nano /etc/proftpd/proftpd.conf.Uncomment #DefaultRoot~

Test the FTP Server

On windows, open file zilla and connect with host ip address, username, password

  • ipaddress:192.168.56.102,username:vboxuser,password:changeme

Check Downloads directory on Debian

Then, try transfer a file from windows Here, I transfer projec 50%.pdf to debian

Lastly, check Downloads directory on Debian The project 50% already on Downloads directory

internet_server.1737225026.txt.gz · Last modified: 2025/01/18 18:30 by 1211112300

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki