Click here for "Safe Air Conditioner Repair and Proper Freon Recovery".

Ubuntu Server 22.04 : WEB Server(Apache)

Apache2 installation.

Allow http:80 port and https:443 port in UFW first.

1 Install Apache2

2 Apache2 Basic Settings

3 Apache2 : Using Perl Scripts

Enable CGI to make Perl scripts available
①Install Perl

②Enable CGI module and restart

③Confirm CGI module is enabled
Test Script Creation

Authorize script files

operation check

4 Apache2 : Using PHP Scripts

①Install PHP

②Apache2 Configuration

③Create a PHP test page and check its operation

If you access http://<FQDN>/index.php with a browser and the following screen appears, success!

5 Apache2 : Virtual Host Configuration

①Copy the default configuration file (file name is arbitrary, in this case vhost-yourdomain.conf as an example) and configure the virtual host

②Edit the configuration file you created

③Symbolic link to the configuration file to disable the default configuration file

④Edit hosts file

⑤directory creation

⑥Create test pages and check operation

⑦If you access http://<FQDN>/index.html with a browser and see the following screen, you have succeeded.

6.Digest authentication with Apache2

Since Basic Authentication, a well-known authentication authorization method for http, sends authentication information in plain text, there is a risk of ID and password leakage if the packet is intercepted.
On the other hand, Digest Authentication encrypts and transmits authentication information, so there is almost no risk of information leakage.

6.1 Create password file for Digest authentication

Specify an authenticated area called realm. This realm allows the same directory to be accessed as authenticated.
As an example, we will create a user named "secretuser" with "DigestAuth" as the realm. Execute the following command and enter the password for "secretuser" when prompted.


As above, secretuser and encrypted password are created

6.2 Edit Apache configuration file

Specify the directory to which Digest authentication will be applied. (In this case, specify the secret directory.)

Add the following at the end

Enable Digest authentication and reboot

When accessing http://<FQDN>/ with a browser, a screen appears asking for "user name" and "password".