業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

Slackware15.0 : WEB server (Apache) Install , SSL implementation

WEB server (Apache)

Apache Installation

①system update

➁httpd installation

➂Apache version check

④Enabling and Starting Apache

⑤Open ports for web server use

Connect to "http://server IP/" with any browser, and if it looks like the following, it's OK

Editing the Apache Configuration File

①The configuration file is /etc/httpd/httpd.conf 
Edit this file

➁Restart Apache

Confirmation of CGI Script Usage

①Confirmation of CGI availability

The above is displayed and available under "/srv/httpd/cgi-bin/".

➁Edit httpd.conf

➂Create test scripts and check operation

PHP Installation

①Install

OK click

➁Editing httpd.conf

➂Edit /etc/httpd/mod_php.conf

④Edit /etc/php.ini file

⑤Restart Apache

⑥Create the following file to confirm PHP startup

If you access http://server IP/info.php with any browser and see the following screen, PHP is working properly.

Virtual Host Settings

Assign and configure the domain name [slack.korodes.com] to the document root [/srv/httpd/htdocs/slack.korodes.com] directory for the virtual host to operate under
Create a new slack-vhosts.conf

Edit httpd.conf file

Create document root directory

Restart Apache

Web Server SSL Implementation

Let's obtain an SSL certificate from Let's Encrypt and enable SSL for the web server.
This time, we'll create a Python virtual environment and obtain a Let's Encrypt certificate.
In Python virtual environments, each project has its own isolated environment, offering benefits in dependency management, compatibility, and security.

Obtaining an SSL Certificate

1. Create a Python virtual environment

2. Upgrade pip to the latest version within the virtual environment

3.Install Certbot within the virtual environment

4.Creating links
You no longer need to specify absolute paths when executing.

5.Stop Apache

6.Certificate Acquisition--Set the target domain to slack.korodes.com

Editing Apache Configuration Files

Copy the default httpd-ssl.conf file, rename it to slack-ssl.conf, and edit it.

Editing Apache's main configuration file httpd.conf

Restart Apache

Redirect from HTTP to HTTPS

Editing the Virtual Host Configuration File

Editing Apache's main configuration file httpd.conf

Restart Apache

Open the HTTPS port in UFW

Copied title and URL