Skip to content

Instantly share code, notes, and snippets.

@tanaka-takayoshi
Created March 18, 2020 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanaka-takayoshi/5e78d513d0c0c3b3bf36e07ee07028ac to your computer and use it in GitHub Desktop.
Save tanaka-takayoshi/5e78d513d0c0c3b3bf36e07ee07028ac to your computer and use it in GitHub Desktop.
#!/bin/sh -eu
# 必ず最新バージョンの値を指定する必要あり。最新バージョン以外は https://download.newrelic.com/php_agent/archive/ 以下からダウンロード
curl -L "https://download.newrelic.com/php_agent/release/newrelic-php5-9.7.0.258-linux.tar.gz" -o /tmp/newrelic-php5-9.7.0.258-linux.tar.gz
tar -xvzf /tmp/newrelic-php5-9.7.0.258-linux.tar.gz -C /tmp
NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 /tmp/newrelic-php5-*/newrelic-install install
rm -rf /tmp/newrelic-php5-* /tmp/nrinstall*
# newrelic.ini ファイルを編集。ライセンスキーとアプリ名以外は必要に応じて追加・削除してください
sed -i \
-e 's/"REPLACE_WITH_REAL_KEY"/"YourLicenseKey"/' \
-e 's/newrelic.appname = "PHP Application"/newrelic.appname = "My PHP Lab on Azure"/' \
-e 's/;newrelic.daemon.app_connect_timeout =.*/newrelic.daemon.app_connect_timeout=15s/' \
-e 's/;newrelic.daemon.start_timeout =.*/newrelic.daemon.start_timeout=5s/' \
/usr/local/etc/php/conf.d/newrelic.ini
# 以下はデフォルトの起動スクリプトをそのまま実行する
# Enter the source directory to make sure the script runs where the user expects
cd /home/site/wwwroot
export APACHE_DOCUMENT_ROOT='/home/site/wwwroot'
export APACHE_PORT=8080
apache2-foreground
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment