Linux Web server construction (Ubuntu & Apache)

I installed Linux (Ubuntu 20.04.1) in Windows using virtualbox and tried to build a file server, so next I tried to build a web server. It is a memo of.

File server construction ↓ https://qiita.com/toki_k/items/f805421f809c67d0c92b

Firewall installation

$ sudo apt install ufw

First, install it.

Firewall settings

Next, set the firewall.

$ sudo ufw allow 22
$ sudo ufw allow 80

All connections on port +22 and port +80 are allowed. 22 allows ssh 80 is for http permission. Used by apache

$ sudo ufw allow samba

Click here to check the status such as permitted items ↓ You can see it in the list.

$ sudo ufw status

Apache installation

Install Apache.

$ sudo apt install apache2

Try to access the page

If the installation is successful, you should be able to access it from your browser.

$ hostname

Check the server name.

You can open a browser and access the default page with "http: // (hostname)". Enter the value confirmed by hostname in (server name).

The page that Apache displays is like "/ var / www / html /". It seems to be called the document root

Add and access files yourself

$ cd /var/www/html
$ vim hello.html

First, cd to the document root. Open vim and create a new file.

In your browser, enter http: // (hostname) /hello.html. You can now access the page you created! !!

Reference article

https://qiita.com/sakkuntyo/items/03742bad0f57a4f46b07 https://qiita.com/moennig1997/items/65da2650583d3667342f

Recommended Posts

Linux Web server construction (Ubuntu & Apache)
Ubuntu (18.04.3) Web server construction
Linux file server construction (Ubuntu & Samba)
Web server construction commentary
Web server construction with Apache 2.4 (httpd 2.4.43) + PHP 7.4 on Linux ―― 4. Security (chown and firewalld)
Ubuntu Linux 20.04
Linux server construction link summary (CentOS7)
Environment construction procedure: Ubuntu + Apache2 + Python + Pyramid
Linux environment construction
Linux (CentOS) construction
linux (ubuntu) memo
Linux server command
Effective and simple Web server security measures "Linux"
Web server to replace Apache: uWSGI performance tuning
Source compile Apache2.4 (httpd 2.4.43) + PHP7.4 on Linux and build a Web server ―― 1. Apache introduction
Source compile Apache2.4 (httpd 2.4.43) + PHP7.4 on Linux and build a Web server --2 PHP introduction
Linux server load verification
[Part 2] Let's build a web server on EC2 Linux
Source compile Apache2.4 (httpd 2.4.43) + PHP7.4 on Linux to build a Web server --3 MySQL 8.0 introduction
Build Apache HTTP Server and Wildfly on Oracle Linux 8
One Liner Web Server
Web system construction (super basic) ③: DB server construction and basic operation
Merry Christmas web server
Web system construction (super basic) ②: AP server construction and basic operation
Easy web server construction & deployment with EB CLI + git + Django
Set up a web server with CentOS7 + Anaconda + Django + Apache
Build Docker environment (Linux 8) and start Apache HTTP Server container
[Ubuntu 18.04] Tensorflow 2.0.0-GPU environment construction
About Linux environment construction (CentOS)
First LAMP environment construction (Linux)
Ubuntu14.04 + GPU + TensorFlow environment construction
Linux environment construction (on WSL environment)
Ubuntu / Linux laptop WiFi issues
[Linux Nginx] Command collection used for initial setting of Web server
Environment construction of monitoring server Zabbix 4.4 on CentOS7 (Apache2.4 / PHP5.4 / MariaDB5.5)
Set up Ubuntu as a Linux cheat sheet and https server