Ubuntu 26.04.01
Serverでメールサーバを作る 〜postfixadminの管理画面がブラウザで見えるまで〜
概要
更新履歴
- 2026/10/15 初版
目次
はじめに
- 今回作るメールサーバは,PostfixadminによるGUI管理を行うので,そのバックボーンとしてデータベースとして MySQL/Apache2/PHP8.5を使用する.
- それらのモジュールや関連ライブラリのインストールを行い,postfixadminの初期の管理画面にアクセスできるまでの設定と する.
ベースとなるモジュールのMySQL/Apache2/PHPライブラリのインストール
- MySQLのデータベース本体,MySQLクライアント,PHPの関連ライブラリ,Apache HTTPDなどをインストール.
server@himuro:~$ sudo apt install apache2 mysql-server php php-mysql php-mbstring php-imap php-curl php-gd php-xml -y🆑
Package php-imap is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Error: Package 'php-imap' has no installation candidate🈁
server@himuro:~$
- エラーの理由.
- Ubuntu 26.04 が標準で搭載している PHP
8.5(または8.4以降)において、IMAP拡張機能がPHP公式のコアコードから完全に削除されたためAPTレポジトリに
php-imapというパッケージ自体が存在しなくなっている.
PHPのライブラリ関連をインストール
- PostfixAdminを動かすために必要なライブラリをインストール.
server@himuro:~$ sudo apt install libc-client-dev libkrb5-dev php-dev php-pear build-essential -y🆑
Note, selecting 'libc-client2007e-dev' instead of 'libc-client-dev'
The following packages were automatically installed and are no longer required:
linux-headers-7.0.0-30 linux-modules-7.0.0-30-generic
linux-headers-7.0.0-30-generic linux-tools-7.0.0-30
linux-image-unsigned-7.0.0-30-generic linux-tools-7.0.0-30-generic
linux-main-modules-zfs-7.0.0-30-generic
Use 'sudo apt autoremove' to remove them.
Installing:
build-essential libc-client2007e-dev libkrb5-dev php-dev php-pear
ー略ー
No VM guests are running outdated hypervisor (qemu) binaries on this host.
server@himuro:~$
- 成功.
PECLを使ってIMAP拡張機能ビル ド
- PECLを使ってIMAP拡張機能をダウンロードし、自動ビルド.
- (ピークル / PHP Extension Community
Library)は、PHPの機能を拡張するためのモジュール(C言語で書かれた拡張ライブラリ)を集めたリポジトリおよび配信サー
ビスです。
- 途中でKerberosやSSLのパスなどの設定を聞かれた場合は、何も入力せずにそのまま Enter キーを押して進める.
server@himuro:~$ sudo pecl install imap🆑
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imap-1.0.3.tgz ...
Starting to download imap-1.0.3.tgz (63,476 bytes)
................done: 63,476 bytes
6 source files, building
running: phpize
Configuring for:
PHP Version: 8.5
PHP Api Version: 20250925
Zend Module Api No: 20250925
Zend Extension Api No: 420250925
configure.ac:154: warning: The macro 'AC_PROG_LIBTOOL' is obsolete.
configure.ac:154: You should run autoupdate.
build/libtool.m4:100: AC_PROG_LIBTOOL is expanded from...
configure.ac:154: the top level
Include Kerberos Support [yes] :🆑
Include SSL Support [yes] :🆑
building in /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/imap-1.0.3
running: /tmp/pear/temp/imap/configure --with-php-config=/usr/bin/php-config --with-kerberos --with-imap-ssl
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
ー略ー
----------------------------------------------------------------------
Libraries have been installed in:
/tmp/pear/temp/pear-build-root19o29umt06qafddZvEF/imap-1.0.3/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3" install
Installing shared extensions: /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3/usr/lib/php/20250925/
running: find "/tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3" | xargs ls -dils
349 0 drwxr-xr-x 3 root root 60 Sep 26 16:58 /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3
648 0 drwxr-xr-x 3 root root 60 Sep 26 16:58 /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3/usr
649 0 drwxr-xr-x 3 root root 60 Sep 26 16:58 /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3/usr/lib
650 0 drwxr-xr-x 3 root root 60 Sep 26 16:58 /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3/usr/lib/php
651 0 drwxr-xr-x 2 root root 60 Sep 26 16:58 /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3/usr/lib/php/20250925
652 340 -rwxr-xr-x 1 root root 347648 Sep 26 16:58 /tmp/pear/temp/pear-build-root1e0cl6akqrqm0CixWR8/install-imap-1.0.3/usr/lib/php/20250925/imap.so
Build process completed successfully
Installing '/usr/lib/php/20250925/imap.so'🆑
install ok: channel://pecl.php.net/imap-1.0.3🆑
configuration option "php_ini" is not set to php.ini location🆑
You should add "extension=imap.so" to php.ini
server@himuro:~$
- ビルドできました.
MySQLのインストールを再チャレン ジ
- 一番最初にインストールしようとして失敗したので,
server@himuro:~$ sudo apt install libapache2-mod-php mysql-server php-mysql php-mbstring php-curl php-gd php-xml -y🆑
php-xml is already the newest version (2:8.5+99ubuntu1).
php-xml set to manually installed.
The following packages were automatically installed and are no longer required:
linux-headers-7.0.0-30 linux-image-unsigned-7.0.0-30-generic linux-modules-7.0.0-30-generic linux-tools-7.0.0-30-generic
linux-headers-7.0.0-30-generic linux-main-modules-zfs-7.0.0-30-generic linux-tools-7.0.0-30
Use 'sudo apt autoremove' to remove them.
Installing:
libapache2-mod-php mysql-server php-curl php-gd php-mbstring php-mysql
Installing dependencies:
apache2 libaprutil1-dbd-sqlite3 libfcgi0t64 libhttp-date-perl libmecab2 mysql-client-core
apache2-bin libaprutil1-ldap libfontconfig1 libhttp-message-perl libprotobuf-lite32t64 mysql-common
apache2-data libaprutil1t64 libgd3 libimagequant0 libsharpyuv0 mysql-server-core
apache2-utils libcgi-fast-perl libgoogle-perftools4t64 libio-html-perl libtcmalloc-minimal4t64 php8.5-curl
fontconfig-config libcgi-pm-perl libheif-plugin-aomdec libjbig0 libtiff6 php8.5-gd
fonts-dejavu-core libclone-perl libheif-plugin-aomenc libjpeg-turbo8 libtimedate-perl php8.5-mbstring
fonts-dejavu-mono libdeflate0 libheif1 libjpeg8 liburi-perl php8.5-mysql
libaom3 libencode-locale-perl libhtml-parser-perl liblerc4 libwebp7 ssl-cert
libapache2-mod-php8.5 libfcgi-bin libhtml-tagset-perl liblua5.4-0 libxpm4
libapr1t64 libfcgi-perl libhtml-template-perl liblwp-mediatypes-perl mysql-client
Suggested packages:
apache2-doc libheif-plugin-libde265 libheif-plugin-j2kdec libdata-dump-perl libregexp-ipv6-perl
apache2-suexec-pristine libheif-plugin-x265 libheif-plugin-j2kenc libipc-sharedcache-perl libwww-perl
| apache2-suexec-custom libheif-plugin-ffmpegdec libheif-plugin-kvazaar libio-compress-brotli-perl
www-browser libheif-plugin-jpegdec libheif-plugin-rav1e libbusiness-isbn-perl
libgd-tools libheif-plugin-jpegenc libheif-plugin-svtenc libmime-base32-perl
Recommended packages:
mecab-ipadic-utf
Summary:
Upgrading: 0, Installing: 64, Removing: 0, Not Upgrading: 21
Download size: 36.1 MB
Space needed: 220 MB / 91.5 GB available
ー略ー
No VM guests are running outdated hypervisor (qemu) binaries on this host.
server@himuro:~$
- 成功.
Ubuntu ServerでインストールされているPHP8.5にimapのライブラリを追加する.
-
imap.iniファイルにライブラリを追加する.
server@himuro:~$ sudo ls -la /etc/php/8.5/mods-available/imap.ini🆑
ls: cannot access '/etc/php/8.5/mods-available/imap.ini': No such file or directory
server@himuro:~$
server@himuro:~$ echo "extension=imap.so" | sudo tee /etc/php/8.5/mods-available/imap.ini🆑
extension=imap.so🈁
server@himuro:~$
- モジュールを有効化する.
server@himuro:~$ sudo phpenmod imap🆑
server@himuro:~$
- Apache httpdを起動して動作を確認する.
server@himuro:~$ sudo systemctl start apache2🆑
server@himuro:~$ sudo systemctl status apache2🆑
● apache2.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-09-26 17:11:04 UTC; 54s ago
Invocation: 01fcfb9e4b8a4632ae0adcb386e8e343
Docs: https://httpd.apache.org/docs/2.4/
Main PID: 15837 (apache2)
Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec: 0 B/sec"
Tasks: 6 (limit: 5898)
Memory: 15.3M (peak: 15.3M)
CPU: 149ms
CGroup: /system.slice/apache2.service
├─15837 /usr/sbin/apache2 -k start -DFOREGROUND
├─15840 /usr/sbin/apache2 -k start -DFOREGROUND
├─15841 /usr/sbin/apache2 -k start -DFOREGROUND
├─15843 /usr/sbin/apache2 -k start -DFOREGROUND
├─15844 /usr/sbin/apache2 -k start -DFOREGROUND
└─15848 /usr/sbin/apache2 -k start -DFOREGROUND
Sep 26 17:11:04 mail.deimos.ujp.jp systemd[1]: Starting apache2.service - The Apache HTTP Server...
Sep 26 17:11:04 mail.deimos.ujp.jp systemd[1]: Started apache2.service - The Apache HTTP Server.
server@himuro:~$
- Apacheの起動は成功している.
PostfixAdmin用のデータ ベースを作成する.
- 以下のSQL文を実行する.
- データベースを作成.
- postfixadmin用のユーザアカウントを作成.
- パスワードは適切に設定する.
CREATE DATABASE postfixadmin DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'postfixadmin'@'localhost' IDENTIFIED BY 'Your_Strong_Password';
GRANT ALL PRIVILEGES ON postfixadmin.* TO 'postfixadmin'@'localhost';
FLUSH PRIVILEGES;
EXIT;
- 次のようになる.
- ここまでの設定では,MySQLのrootユーザにパスワードは設定されてないので,パスワードなしでログインしている.
server@himuro:~$ sudo mysql -u root🆑
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.11-0ubuntu0.26.04.1 (Ubuntu)
Copyright (c) 2000, 2026, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE DATABASE postfixadmin DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;🆑
Query OK, 1 row affected (0.02 sec)
mysql> CREATE USER 'postfixadmin'@'localhost' IDENTIFIED BY 'Your_Strong_Password';🆑
Query OK, 0 rows affected (0.02 sec)
mysql> GRANT ALL PRIVILEGES ON postfixadmin.* TO 'postfixadmin'@'localhost';🆑
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> EXIT;🆑
Bye
server@himuro:~$
PostfixAdminのダウンロー ドとインストール
- PostfisAdminはダウンロードしてWeb用のディレクトリに展開するだけ.
- まずはダウンロード.
server@himuro:~$ cd /tmp🆑
server@himuro:/tmp$ wget https://github.com/postfixadmin/postfixadmin/archive/refs/tags/v4.0.5.tar.gz🆑
--2026-09-26 17:45:13-- https://github.com/postfixadmin/postfixadmin/archive/refs/tags/v4.0.5.tar.gz
Resolving github.com (github.com)... 20.27.177.113
Connecting to github.com (github.com)|20.27.177.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/postfixadmin/postfixadmin/tar.gz/refs/tags/v4.0.5 [following]
--2026-09-26 17:45:14-- https://codeload.github.com/postfixadmin/postfixadmin/tar.gz/refs/tags/v4.0.5
Resolving codeload.github.com (codeload.github.com)... 20.27.177.114
Connecting to codeload.github.com (codeload.github.com)|20.27.177.114|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘v4.0.5.tar.gz’
v4.0.5.tar.gz [ <=> ] 2.43M 9.73MB/s in 0.2s
2026-09-26 17:45:14 (9.73 MB/s) - ‘v4.0.5.tar.gz’ saved [2550022]
server@himuro:/tmp$ tar -xvf v4.0.5.tar.gz🆑
postfixadmin-4.0.5/
postfixadmin-4.0.5/.github/
postfixadmin-4.0.5/.github/workflows/
postfixadmin-4.0.5/.github/workflows/php.yml
postfixadmin-4.0.5/.github/workflows/release.yml
postfixadmin-4.0.5/.gitignore
postfixadmin-4.0.5/.php-cs-fixer.dist.php
postfixadmin-4.0.5/ADDITIONS/
postfixadmin-4.0.5/ADDITIONS/README.md
postfixadmin-4.0.5/ADDITIONS/change_password.tgz
postfixadmin-4.0.5/ADDITIONS/cleanupdirs.pl
postfixadmin-4.0.5/ADDITIONS/convert-passwd-to-postfixadmin.pl
postfixadmin-4.0.5/ADDITIONS/cyrus/
postfixadmin-4.0.5/ADDITIONS/cyrus/Changelog
ー略ー
postfixadmin-4.0.5/tests/PacryptTest.php
postfixadmin-4.0.5/tests/PasswordValidationCallableTest.php
postfixadmin-4.0.5/tests/RemoteAliasTest.php
postfixadmin-4.0.5/tests/RemoteTest.php
postfixadmin-4.0.5/tests/RemoteUserTest.php
postfixadmin-4.0.5/tests/RemoteVacationTest.php
postfixadmin-4.0.5/tests/RemoveFromArrayTest.php
postfixadmin-4.0.5/tests/TotpPfTest.php
postfixadmin-4.0.5/tests/ValidatePasswordTest.php
postfixadmin-4.0.5/tests/bootstrap.php
server@himuro:/tmp$
- Apacheの公開用ディレクトリを作成.
server@himuro:/tmp$ sudo mkdir -p /var/www/html/postfixadmin🆑
[sudo: authenticate] Password:🔑
server@himuro:/tmp$
- ファイルを移動して権限付与.それを確認.
server@himuro:/tmp$ sudo mv postfixadmin-4.0.5/* /var/www/html/postfixadmin/🆑
server@himuro:/tmp$ sudo chown -R www-data:www-data /var/www/html/postfixadmin🆑
server@himuro:/tmp$ ls -la /var/www/html/postfixadmin/🆑
total 304
drwxr-xr-x 13 www-data www-data 4096 Sep 26 17:52 .
drwxr-xr-x 3 root root 4096 Sep 26 17:50 ..
drwxrwxr-x 4 www-data www-data 4096 Jul 5 13:10 ADDITIONS
-rw-rw-r-- 1 www-data www-data 68554 Jul 5 13:10 CHANGELOG.TXT
drwxrwxr-x 3 www-data www-data 4096 Jul 5 13:10 DOCUMENTS
-rw-rw-r-- 1 www-data www-data 15148 Jul 5 13:10 GPL-LICENSE.TXT
-rw-rw-r-- 1 www-data www-data 8173 Jul 5 13:10 INSTALL.TXT
-rw-rw-r-- 1 www-data www-data 2189 Jul 5 13:10 LICENSE.TXT
-rw-rw-r-- 1 www-data www-data 4268 Jul 5 13:10 README.md
-rw-rw-r-- 1 www-data www-data 661 Jul 5 13:10 SECURITY.md
drwxrwxr-x 3 www-data www-data 4096 Jul 5 13:10 VIRTUAL_VACATION
-rw-rw-r-- 1 www-data www-data 3743 Jul 5 13:10 common.php
-rw-rw-r-- 1 www-data www-data 97 Jul 5 13:10 composer-update.sh
-rw-rw-r-- 1 www-data www-data 2080 Jul 5 13:10 composer.json
-rw-rw-r-- 1 www-data www-data 33460 Jul 5 13:10 config.inc.php
drwxrwxr-x 2 www-data www-data 4096 Jul 5 13:10 configs
drwxrwxr-x 8 www-data www-data 4096 Jul 5 13:10 debian
-rw-rw-r-- 1 www-data www-data 72279 Jul 5 13:10 functions.inc.php
-rw-rw-r-- 1 www-data www-data 248 Jul 5 13:10 index.php
-rw-rw-r-- 1 www-data www-data 3020 Jul 5 13:10 install.sh
drwxrwxr-x 2 www-data www-data 4096 Jul 5 13:10 languages
drwxrwxr-x 2 www-data www-data 4096 Jul 5 13:10 model
-rw-rw-r-- 1 www-data www-data 204 Jul 5 13:10 password_expiration.sql
-rw-rw-r-- 1 www-data www-data 866 Jul 5 13:10 phpunit.xml
-rw-rw-r-- 1 www-data www-data 66 Jul 5 13:10 postfixadmin.my.cnf
-rw-rw-r-- 1 www-data www-data 1193 Jul 5 13:10 psalm.xml
drwxrwxr-x 5 www-data www-data 4096 Jul 5 13:10 public
drwxrwxr-x 3 www-data www-data 4096 Jul 5 13:10 scripts
drwxrwxr-x 2 www-data www-data 4096 Jul 5 13:10 templates
drwxrwxr-x 2 www-data www-data 4096 Jul 5 13:10 tests
server@himuro:/tmp$
postfixadminから MySQLへの接続情報を設定する
- 接続定義ファイルは存在しないので,新しく作成する.
server@himuro:/tmp$ sudo vi /var/www/html/postfixadmin/config.local.php
server@himuro:/tmp$ cat /var/www/html/postfixadmin/config.local.php
<?php
$CONF['configured'] = true;
$CONF['database_type'] = 'mysqli';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'postfixadmin';
$CONF['database_password'] = 'appleduo';
$CONF['database_name'] = 'postfixadmin';
$CONF['encrypt'] = 'dovecot:ARGON2I';
?>
server@himuro:/tmp$
postfixAdminのセットアッ プ画面に接続する
- 最初にcurlコマンドでpostfixadminのセットアップ画面に接続する.
ujpadmin@hotei:~$ curl http://192.168.20.48/postfixadmin/public/setup.php🆑
<!DOCTYPE html>
vendor/autoload.php is missing. Please run 'install.sh' or follow the instructions in INSTALL.TXT
ujpadmin@hotei:~$
- エラーとなった.
- 外部ライブラリが不足している模様.
- install.shを実行すれば良い模様.
install.shを実行する
- postfixadminのinstall.shファイルを確認.
- 実行権限がないはずなので,付与する.
ujpadmin@hotei:~$ cd /var/www/html/postfixadmin🆑
ujpadmin@hotei:/var/www/html/postfixadmin$ ls -la install.sh🆑
-rw-rw-r-- 1 www-data www-data 3020 Jul 5 13:10 install.sh
ujpadmin@hotei:/var/www/html/postfixadmin$ sudo chmod +x install.sh🆑
ujpadmin@hotei:/var/www/html/postfixadmin$ ls -la install.sh🆑
-rwxrwxr-x 1 www-data www-data 3020 Jul 5 13:10 install.sh
ujpadmin@hotei:/var/www/html/postfixadmin$
- install.shを実行.
ujpadmin@hotei:/var/www/html/postfixadmin$ sudo ./install.sh🆑
* Checking for composer.phar
* 'composer' not found in your path, will try to download from https://getcomposer.org/download/latest-stable/composer.phar
ujpadmin@hotei:/var/www/html/postfixadmin$
- composerが不足とのこと.
- Composer は、PHPで書かれたアプリケーション(今回の PostfixAdmin など)で使われている、ライブラリや依存関係を管理するためのツール(パッケージ管理ツール) です。
- Node.jsでいう npm や、Pythonでいう pip、Ubuntu(APT)でいう apt のPHP版のようなものだとイメージしていただくと分かりやすいかもしれません。
composerのインストール
- composerをaptでインストールする.
ujpadmin@hotei:/var/www/html/postfixadmin$ sudo apt install composer -y🆑
[sudo: authenticate] Password:
Installing:
composer
Installing dependencies:
jsonlint php-composer-semver php-psr-container php-symfony-filesystem php8.5-intl
libzip5 php-composer-spdx-licenses php-psr-log php-symfony-finder php8.5-zip
php-composer-ca-bundle php-composer-xdebug-handler php-react-promise php-symfony-process unzip
php-composer-class-map-generator php-enum php-seld-signal-handler php-symfony-service-contracts
php-composer-metadata-minifier php-intl php-symfony-console php-symfony-string
php-composer-pcre php-json-schema php-symfony-deprecation-contracts php-zip
Suggested packages:
fossil mercurial subversion zip
Summary:
Upgrading: 0, Installing: 28, Removing: 0, Not Upgrading: 23
Download size: 1,448 kB
Space needed: 7,215 kB / 224 GB available
ー略ー
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
ujpadmin@hotei:/var/www/html/postfixadmin$
- インストール成功.
- 再度,install.shを実行する.
ujpadmin@hotei:/var/www/html/postfixadmin$ sudo ./install.sh🆑
* Checking for composer.phar
* checking for PHP database support ...
* Using composer ( /bin/composer )
* Installing libraries ( composer install --no-dev ... )
Composer plugins have been disabled for safety in this non-interactive session.
Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
Do not run Composer as root/super user! See https://getcomposer.org/root for details
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 88 installs, 0 updates, 0 removals
- Locking bacon/bacon-qr-code (v3.1.1)
- Locking clue/ndjson-react (v1.3.0)
- Locking composer/pcre (3.4.0)
- Locking composer/semver (3.5.1)
- Locking composer/xdebug-handler (3.0.5)
- Locking dasprid/enum (1.0.7)
ー略ー
- ターミナルが赤色とか黄色で警告が出たけど,問題ない模様.
- 非インタラクティブセッション(スクリプト経由) および root ユーザー で Composer を実行したため、セキュリティ上の安全装置が働き、「Composer プラグインの実行を一時的に無効化しました」という警告(赤文字)が出ました。
- しかし、これはあくまで「プラグインを無効化した」という警告(Notice /
Warning)であり、エラー(致命的な失敗)ではありません。
- 以下のように表示されて終了.
14 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
9 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Warning:
templates_c directory didn't exist, now created.
You should change the ownership and reduce permissions on templates_c to 750.
The ownership needs to match the user used to execute PHP scripts, perhaps 'www-data' or 'httpd'
e.g. chown www-data templates_c && chmod 750 templates_c
Please continue configuration / setup within your web browser.
See also : https://github.com/postfixadmin/postfixadmin/blob/master/INSTALL.TXT#L58
- 警告が出ているが次のとおり.
- 後に表示されている Warning(警告) は、PostfixAdmin が画面描画に使うテンプレートのキャッシュ用ディレクトリ(templates_c)が自動作成されたため、「安全のために適切な パーミッションと所有者 に設定しておいてね」 という親切な案内です。
- 案内文に従って、Webサーバーの実行ユーザー(UbuntuのApache標準である
www-data)に変更・設定を行いましょう。
- 権限について警告が出ているので,正しく所有権を設定する.
server@himuro:/var/www/html/postfixadmin$ cd /var/www/html/postfixadmin🆑
server@himuro:/var/www/html/postfixadmin$ sudo chown www-data:www-data templates_c🆑
[sudo: authenticate] Password:🔑
server@himuro:/var/www/html/postfixadmin$ sudo chmod 750 templates_c🆑
server@himuro:/var/www/html/postfixadmin$
-
OK.
curlコマンドで管理画面にアクセス できるか確認
とりあえず,サーバ上で自分のサーバにアクセスしてみる.
ujpadmin@hotei:/var/www/html/postfixadmin$ curl -i http://192.168.20.48/postfixadmin/public/setup.php🆑
HTTP/1.1 200 OK
Date: Thu, 15 Oct 2026 09:19:03 GMT
Server: Apache/2.4.66 (Ubuntu)
Set-Cookie: postfixadmin_session=3cfce2536db735b4194bc9f8dddb684a; path=/; HttpOnly; SameSite=Strict
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-Frame-Options: DENY
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:
Vary: Accept-Encoding
Content-Length: 6420
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>ー略ー
- curlコマンドで管理画面にアクセスできた.
macOSのブラウザから接続すると postfixadminの管理画面にアクセスできない件
- PCのブラウザから管理画面にアクセス.
- 確認したらmacOSの「プライバシーとセキュリティ」の「ローカルネットワーク」で
ブラ ウザアプリが許可されてなかったのが原因.
Webブラウザで postfixadminの管理画面にアクセス
- 以下のようなページが表示される.
- 次のドキュメントに続く.

