- 檢驗網頁是否可讀取正常 (strlen)
- 檢驗網頁 HTML 格式 (tidy 或 xmllint)
- 檢驗網頁上的 link 個數 (preg_match_all)
- 檢驗 JSON 格式 (json_decode && json_last_error)
其他筆記:changyy / web-service-unit-test / phpunit / web-service-unit-test.php
define host {
host_name aws-rdb
alias aws-rdb-dns
address aws-rdb-dns
use rdb-host
contact_groups db-services
}
define host {
host_name aws-dev
alias aws-dev-dns
address aws-dev-dns
hostgroups ssh-servers,http-servers
use ec2-host
contact_groups pc-services
}
define command {
command_name check-rds-host-alive
command_line /usr/lib/nagios/plugins/check_tcp -H $HOSTADDRESS$ -p 3306
}
define command {
command_name check-ec2-host-alive
command_line /usr/lib/nagios/plugins/check_tcp -H $HOSTADDRESS$ -p 80
}
define host{
name rdb-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
check_command check-rds-host-alive
max_check_attempts 10
notification_interval 0
notification_period 24x7
notification_options d,u,r
contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
define host{
name ec2-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
check_command check-ec2-host-alive
max_check_attempts 10
notification_interval 0
notification_period 24x7
notification_options d,u,r
contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
$ sudo apt-get install mysql-client-5.6 php5 apache2 apache2-utils git php5-mysql
$ sudo a2ensite default-ssl.conf
$ sudo php5enmod mcrypt
$ sudo service apache2 restart
$ sudo vim /etc/phpmyadmin/config-db.php
// 在底部新增:
$dbuser='rds_account';
$dbpass='rds_password';
$dbserver='rds_location';
$ sudo vim /etc/phpmyadmin/config.inc.php
// 採用 HTTP Basic authentication
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'http';
// ...
// 最底層加上強制 HTTPS
$cfg['ForceSSL'] = true;