OpenSUSE15.6 ; WEB Server (Apache) Install

1.WEB Server (Apache)

1.1 apache2 Install

1.2 Apache2 :Basic Settings

1.3 Firewalld

HTTP service permission is required. Note that HTTP uses 80/TCP; HTTPS uses 443

1.4 Apache2 : operation check

Create an HTML test page to check the operation. Start a Web browser on the client PC and check if the test page you created can be accessed as follows

Access http://<IP address> with a browser and confirm that it is displayed as shown below.

2. Apache2 : Using Perl Scripts

 Configure Perl scripts to be used as CGI

2.1 Perl

①Install

Enable CGI module

CGI execution is permitted by default under [/srv/www/cgi-bin/].
For example, by creating and placing the script [/srv/www/cgi-bin/index.cgi], you can access [http://(httpd server)/cgi-bin/index.cgi].
This configuration treats all files under [/srv/www/cgi-bin/] as CGI, so files other than CGI cannot be displayed.

Create test scripts and check operation

Authorize script files

operation check

If "Hello CGI" is displayed, it is normal.

3. Apache2 : Virtual Host Settings

Configure both domains sample1.korodes.com sample2.korodes.com to be displayed on one server

Create a directory named sample1.korodes.com under /srv/www/htdocs/

Create the idex.html file in the sample1.korodes.com directory

Create a new virtual_host.conf under /etc/apache2/vhosts.d

Edit hosts file(Example. : server IP address : 192.168.11.83)

Similarly, create a directory and index.html file for the domain "sample2.korodes.com"

Add to virtual_host.conf file

Add to hosts file

It is OK if "http://sample1.korodes.com" and "http://sample2.korodes.com" are displayed in the web browser as shown below.

4. Apache2 : Using PHP Scripts

Install and configure PHP so that PHP scripts are available

4.1 PHP Install

4.2 Create a PHP test page and check its operation

Create test page

Start a Web browser on the client PC, access "http://sample1.korodes.com/test.php", and if the test page you created is displayed as shown below, it is OK.(PHP version may be different)

Copied title and URL