LoginSignup
0

More than 5 years have passed since last update.

マルチドメインのリストが欲しいときのコマンド

Posted at

■用途
 マルチドメインのみのリストを利用してプログラムを組みたいときなど

■マルチドメインのリストを取得するコマンド

cat httpd.confまでのパス | grep -e ServerAlias -e ServerName | sed -E "s/\s*(ServerAlias|ServerName)\s*//g"

■phpでマルチドメインのリストを取得して配列に入れるプログラム

$setting_domain = `cat {httpd.confまでのパス} | grep -e ServerAlias -e ServerName | sed -E "s/\s*(ServerAlias|ServerName)\s*//g"`;
$list_domain = explode("\n", trim($setting_domain));
$list_domain = array_unique($list_domain);

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0