はじめに
AIX7.3にApacheをインストールしてWebサーバーを立ててみました。
参考
使用した環境
PowerVS S1022
AIX 7.3 TL3 SP0
Apacheインストール
今回はAIX Toolbox for Open Source Softwareからdnf_aixtoolbox.shをダウンロードして実行し、dnfを利用してインストールを実施しました。
dnfの導入
まずはdnf_aixtoolbox.shをダウンロードして、実行します。
dnf_aixtoolbox.shを実行することにより、dnfおよびリポジトリーの設定ができます。
# ls -l
total 24
-rwxr-xr-x 1 root system 8226 Jun 26 21:58 dnf_aixtoolbox.sh
# ./dnf_aixtoolbox.sh -d
Attempting download of dnf_bundle_aix_73.tar ...
Saving to 'dnf_bundle_aix_73.tar'...
291 MB received in 4 minutes (1.02e+03 KB/sec)
Extracting dnf_bundle_aix_73.tar ...
x ca-certificates-2023.2.60-0.aix7.1.ppc.rpm, 991206 bytes, 1936 tape blocks
x dnf-4.2.17-64_7.aix7.1.noarch.rpm, 11496 bytes, 23 tape blocks
x dnf-automatic-4.2.17-64_7.aix7.1.noarch.rpm, 12956 bytes, 26 tape blocks
x dnf-data-4.2.17-64_7.aix7.1.noarch.rpm, 29804 bytes, 59 tape blocks
x extra_list, 384 bytes, 1 tape blocks
x gnupg2-2.2.35-0.aix7.1.ppc.rpm, 69469827 bytes, 135684 tape blocks
...省略...
dnfコマンドとリポジトリーの確認をします。
# /opt/freeware/bin/dnf repolist
repo id repo name
AIX_Toolbox AIX generic repository
AIX_Toolbox_73 AIX 7.3 specific repository
AIX_Toolbox_noarch AIX noarch repository
Apacheのインストール
dnfを使用して、Apacheをインストールします。
# /opt/freeware/bin/dnf search httpd
Last metadata expiration check: 0:00:17 ago on Thu Jun 26 22:19:33 CDT 2025.
=========================== Name Exactly Matched: httpd ===========================
httpd.ppc : Apache HTTP Server
=============================== Name Matched: httpd ===============================
httpd-devel.ppc : Development tools for the Apache HTTP server.
httpd-manual.ppc : Documentation for the Apache HTTP server.
# /opt/freeware/bin/dnf install httpd
Last metadata expiration check: 0:01:52 ago on Thu Jun 26 22:19:33 CDT 2025.
Dependencies resolved.
===================================================================================
Package Architecture Version Repository Size
===================================================================================
Installing:
httpd ppc 2.4.63-1 AIX_Toolbox 3.9 M
Upgrading:
expat ppc 2.6.3-1 AIX_Toolbox 855 k
Installing dependencies:
apr ppc 1.7.4-1 AIX_Toolbox 369 k
apr-util ppc 1.6.3-2 AIX_Toolbox 278 k
cyrus-sasl ppc 2.1.28-1 AIX_Toolbox 1.2 M
db ppc 1:5.3.28-1 AIX_Toolbox 17 M
openldap ppc 2.5.16-3 AIX_Toolbox 4.0 M
pcre ppc 8.44-2 AIX_Toolbox 723 k
Transaction Summary
===================================================================================
Install 7 Packages
Upgrade 1 Package
Total download size: 28 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): apr-util-1.6.3-2.aix7.1.ppc.rpm 103 kB/s | 278 kB 00:02
(2/8): apr-1.7.4-1.aix7.1.ppc.rpm 128 kB/s | 369 kB 00:02
(3/8): cyrus-sasl-2.1.28-1.aix6.1.ppc.rpm 313 kB/s | 1.2 MB 00:03
(4/8): httpd-2.4.63-1.aix7.1.ppc.rpm 1.2 MB/s | 3.9 MB 00:03
(5/8): openldap-2.5.16-3.aix7.1.ppc.rpm 1.7 MB/s | 4.0 MB 00:02
(6/8): pcre-8.44-2.aix6.1.ppc.rpm 1.3 MB/s | 723 kB 00:00
(7/8): expat-2.6.3-1.aix7.1.ppc.rpm 1.6 MB/s | 855 kB 00:00
(8/8): db-5.3.28-1.aix6.1.ppc.rpm 3.4 MB/s | 17 MB 00:04
-----------------------------------------------------------------------------------
Total 3.7 MB/s | 28 MB 00:07
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : expat-2.6.3-1.ppc 1/9
Installing : apr-1.7.4-1.ppc 2/9
Installing : apr-util-1.6.3-2.ppc 3/9
Installing : pcre-8.44-2.ppc 4/9
Running scriptlet: db-1:5.3.28-1.ppc 5/9
Installing : db-1:5.3.28-1.ppc 5/9
Installing : cyrus-sasl-2.1.28-1.ppc 6/9
Running scriptlet: cyrus-sasl-2.1.28-1.ppc 6/9
From cyrus-sasl 2.1.26-5 onwards, symbolic links in /usr/sbin has been removed.
The binaries are shipped in /opt/freeware/sbin. Please use absolute path or
add /opt/freeware/sbin in PATH environment variable to use the binary.
Running scriptlet: openldap-2.5.16-3.ppc 7/9
Group "ldap" does not exist.
Installing : openldap-2.5.16-3.ppc 7/9
Running scriptlet: openldap-2.5.16-3.ppc 7/9
Running scriptlet: httpd-2.4.63-1.ppc 8/9
Group "apache" does not exist.
User "apache" does not exist.
Installing : httpd-2.4.63-1.ppc 8/9
Running scriptlet: httpd-2.4.63-1.ppc 8/9
This version of httpd has 32bit and 64bit support
To start 64bit httpd use : /opt/freeware/sbin/apachectl_64 start
Cleanup : expat-2.6.2-1.ppc 9/9
Running scriptlet: openldap-2.5.16-3.ppc 9/9
Verifying : apr-1.7.4-1.ppc 1/9
Verifying : apr-util-1.6.3-2.ppc 2/9
Verifying : cyrus-sasl-2.1.28-1.ppc 3/9
Verifying : db-1:5.3.28-1.ppc 4/9
Verifying : httpd-2.4.63-1.ppc 5/9
Verifying : openldap-2.5.16-3.ppc 6/9
Verifying : pcre-8.44-2.ppc 7/9
Verifying : expat-2.6.3-1.ppc 8/9
Verifying : expat-2.6.2-1.ppc 9/9
Upgraded:
expat-2.6.3-1.ppc
Installed:
httpd-2.4.63-1.ppc apr-1.7.4-1.ppc apr-util-1.6.3-2.ppc
cyrus-sasl-2.1.28-1.ppc db-1:5.3.28-1.ppc openldap-2.5.16-3.ppc
pcre-8.44-2.ppc
Complete!
Apacheがインストールできたことを確認します。
# lslpp -Lc | grep httpd
httpd:httpd-2.4.63-1:2.4.63-1: : :C:R:Apache HTTP Server: :/bin/rpm -e httpd: : : : :0: :/opt:Tue Apr 15 01:50:50 CDT 2025
Apacheの起動
Apacheの起動を確認します。起動コマンドはApacheインストール時にコンソールに表示されています。
# /opt/freeware/bin/dnf install httpd
...省略...
Installing : openldap-2.5.16-3.ppc 7/9
Running scriptlet: openldap-2.5.16-3.ppc 7/9
Running scriptlet: httpd-2.4.63-1.ppc 8/9
Group "apache" does not exist.
User "apache" does not exist.
Installing : httpd-2.4.63-1.ppc 8/9
Running scriptlet: httpd-2.4.63-1.ppc 8/9
This version of httpd has 32bit and 64bit support
To start 64bit httpd use : /opt/freeware/sbin/apachectl_64 start ← 起動コマンド
...省略...
起動コマンドを実行します。
# /opt/freeware/sbin/apachectl_64 start
AH00557: httpd_64: apr_sockaddr_info_get() failed for test2-nakada
AH00558: httpd_64: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
いくつかエラーが出てきました。
調べてみると、confファイルの設定が必要みたいです。
/opt/freeware/etc/httpd/conf/httpd.conf_64
ファイルの"ServerName"と"Listen"を以下のように設定しました。
...省略...
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
ServerName localhost:80
...省略...
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
#Listen 80
Listen xxx.xxx.xxx.xxx(サーバーのIPアドレス):80
...省略...
再起動をしてみます。
/opt/freeware/sbin/apachectl_64 restart
/opt/freeware/etc/httpd/conf/httpd.conf_64
の"Listen"で設定したIPアドレスにブラウザでアクセスします。
以下のように"It Works!"と表示されました!!
webページの編集
無事に"It Works!"とwebページが表示されましたが、webページの編集をしてみます。
webページの編集をするにはindex.html
ファイルを編集します。
/opt/freeware/etc/httpd/conf/httpd.conf_64
ファイルの"DocumentRoot"にindex.html
の配置先が設定されています。"DocumentRoot"の設定を変更することで配置先も変更できます。
...省略...
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/htdocs" ← index.htmlの配置先
<Directory "/var/www/htdocs">
...省略...
今回はchatgptにhtmlを生成してもらいました。
# cd /var/www/htdocs
# ls
index.html
# vi index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>美味しいオムライスの作り方</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #fff8e1;
color: #333;
}
...省略...
Apacheの再起動をします。
/opt/freeware/sbin/apachectl_64 restart
ブラウザでアクセスしてみると以下のようにwebベージが変更されました!
AIXにApacheをインストールしてwebサーバーを立ててみました。
以上です。