[LINUX] Ubuntu (18.04.3) Web server construction

Hi, I'm a pig guy. I had a PC with Ubuntu at home, but I didn't use it at all. We will build the server.

1. Update ``` $sudo apt update ```

First, we will update.

2. Install firewall

At this point, the firewall could not be installed. ``` $apt install ufw $sudo apt install ufw $sudo apt-get install uff ```

If the above does not work, check the firewall status with the following command. ``` $sudo ufw status Status:Inactive ```

Is the firewall installed? So

Try to enable it. ``` $sudo ufw enable The firewall is active and enabled at system startup. ```

Let's check the status. ``` $sudo ufw status Status:Active ```

This completes the firewall settings.

3. Open ssh port ``` $sudo ufw allow 22 ```

In this case, open port 22.

If successful ``` Added rules Added rules(v6) ``` You will see the notation


4. Open Apache port ``` $sudo ufw allow 80 ``` The explanation is the same as


5. Install Apache

If you get the following error ``` E:Lock~ ```

Delete the target file referring to the following



This is no good ...

Possibly there was a problem with the last shutdown,

Restart Ubuntu.

This worked ``` Do you want to continue? [Y/n] $ Y ``` This completes the Apache installation.

6. Confirmation

Let's check if the server is started.

If the initial Ubuntu page is displayed, it is successful.

First, check the IP address here

$Ip a

It's hard to understand, but it is displayed in the following place.


If you enter

IP address in the address bar ... スクリーンショット 2020-04-13 0.46.18.png

You're done here.

If you leave it as it is, it may be attacked, so stop Apache once. It's just for learning purposes.

(My acquaintance also self-taught and built a server and received some kind of attack.

Some security measures may be required)

$service apache2 stop

If it is not displayed, there should be no problem.

Recommended Posts

Ubuntu (18.04.3) Web server construction
Linux Web server construction (Ubuntu & Apache)
Web server construction commentary
Linux file server construction (Ubuntu & Samba)
Merry Christmas web server
Web system construction (super basic) ③: DB server construction and basic operation
Web system construction (super basic) ②: AP server construction and basic operation
[Ubuntu 18.04] Tensorflow 2.0.0-GPU environment construction
Ubuntu14.04 + GPU + TensorFlow environment construction
Easy web server construction & deployment with EB CLI + git + Django
Server construction with CONOHA VPS (CentOS)
VPN server construction with Raspberry Pi
From Ubuntu 20.04 introduction to environment construction
Ubuntu Desktop 20.04 development environment construction memo
Fastest and strongest web server architecture
Linux server construction link summary (CentOS7)
Environment construction of "Tello_Video" on Ubuntu
OpenCV3 & Python3 environment construction on Ubuntu
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Start the web server in the current directory
WEB application development using django-Development environment construction-
Port forwarding your web server using iptables
Web server for browser testing with Mocha
Environment construction procedure: Ubuntu + Apache2 + Python + Pyramid
Python execution server construction (Python + uWSGI + Django + Nginx)
Build a web server on your Chromebook
Let's summarize the construction of NFS server
Python development server construction procedure (AWS + Anaconda)
[Python] Web application from 0! Hands-on (0) -Environmental construction-
Publish the current directory on the web server
Web server construction with Apache 2.4 (httpd 2.4.43) + PHP 7.4 on Linux ―― 4. Security (chown and firewalld)