vi /etc/profile
PROXY='proxy.server.path:8080' # proxyサーバのドメインとポートを指定
export http_proxy=$PROXY
export HTTP_PROXY=$PROXY
export https_proxy=$PROXY
export HTTPS_PROXY=$PROXY
source /etc/profile
apache証明書
https://blackbird-blog.com/jmeter-https-scenario
jmeter 待ち受けポート
https://kubotti.hatenablog.com/entry/2016/03/16/112954
CPU使用率:100 ーidle_time ーsteal_time
メモリ使用率:used / ( used + free + cach ) * 100
ディスク使用率:
df -l -T コマンド結果から
Used / Used + Available) * 100
date +%Y%m%d%H%M%S ; df -l -T
#!/bin/bash
echo netstat loop testing now!
while [ 0 ]
do
sleep 1
COL01=netstat -an|grep ESTABLISHED|grep -e 80|wc -l
COL02=netstat -an|grep ESTABLISHED|grep -e 443|wc -l
echo "date +%Y%m%d%H%M%S
80 $COL01 443 $COL02" >> netstat.log
done
1./etc/httpd/conf.modules.d/00-mpm.conf
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so ← コメントを取ってpreforkとした
/#LoadModule mpm_worker_module modules/mod_mpm_worker.so
/#LoadModule mpm_event_module modules/mod_mpm_event.so
2.etc/httpd/conf.d 配下にprefork.confを作成
IfModule mpm_prefork_module>
StartServers 180
MaxClients 180
/IfModule>
3.sudo systemctl restart httpd
!/bin/bash
while [ 0 ]
do
echo urata
done
yum-config-manager --disable rhel-8-baseos-rhui-rpms rhel-8-apps
yum-config-manager --disable rhui-client-config-server-8
vi /etc/yum.repos.d/RHEL8.2-DVD.repo
[InstallMedia-BaseOS]
name=Red Hat Enterprise Linux 8 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///media/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///media/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
scp -i jbdLinux.pem ./POC.txt ec2-user@18.218.120.4:/var/tmp/
mount -t iso9660 /var/tmp/rhel-8.2-x86_64-dvd.iso /media/
yum list | grep InstallMedia-BaseOS | wc -l 1319
yum list | grep InstallMedia-AppStream | wc -l 4888
疑似端末
sudo yum install wget -y
sudo yum install unzip -y
sudo yum install java
sudo yum install -y dstat
cd /var/tmp
unzip apache-jmeter-5.4.1.zip
sudo vi /home/ec2-user/.bash_profile
PATH=$PATH:$HOME/.local/bin:/var/tmp/apache-jmeter-5.4.1/bin
source /home/ec2-user/.bash_profile
dstat --version
java -version
jmeter --version
疑似Web
sudo yum install -y httpd
sudo yum install -y mod_ssl
sudo yum install -y php
sudo yum install -y dstat
sudo yum install net-tools
httpd -version
php --version
phpinfoページ確認
dstat --version
netstat --version
sudo systemctl start httpd
apache初期画面確認
echo "
Jmeter
jmeter.sh -n -H 10.175.10.14 -P 8080 -t /var/tmp/test.jmx
事前に配置してもらったtest.jmxファイルを使用して疑似Webサーバ#1への中継サーバ経由でhttpでアクセスできる事。
リクエスト先IPアドレスを修正する。 10.175.10.12
リクエスト先のプロトコルを修正する 80
リクエスト先のポートを修正する http
ResultTableのログファイル名を修正する /var/tmp/test01-table.log
ResultTreeのログファイル名を修正するhttp /var/tmp/test01-tree.log ✖4
********
ssh -i jbdLinux.pem ec2-user@3.20.226.181
scp -i jbdLinux.pem 別紙.xls ec2-user@3.20.226.181:/var/tmp/
yum install iptables-services ipset-service
ipset create WhiteListFtp hash:net ← ipset作成
ipset add WhiteListFtp xx.xx.xx.xx/8080
ipset save > /etc/sysconfig/ipset
vi /etc/sysconfig/iptables
-A INPUT -p tcp --dport 80 -j ACCEPT
jmeter.sh -n -H 172.31.17.* -P 3128 -t /var/tmp/test.jmx
wget https://s3.us-east-2.amazonaws.com/amazoncloudwatch-agent-us-east-2/centos/amd64/latest/amazon-cloudwatch-agent.rpm
rpm -i ./amazon-cloudwatch-agent.rpm
yum install amazon-cloudwatch-agent
amazon-cloudwatch-agent-config-wizard
systemctl start amazon-cloudwatch-agent.service
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m onPremise -s -c file:./config.json
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a start
sudo aws configure --profile AmazonCloudWatchAgent
送る側
vi /etc/rsyslog.conf
. @@remote-host:5141
. @@ xxx.yyy.zzz.aaa:514
systemctl restart rsyslog
iptables -A INPUT -p tcp --dport 514 -j ACCEPT ** 必要ない
iptables -A INPUT -p tcp --sport 514 -j ACCEPT
受け側
vi /etc/rsyslog.conf
tail /var/log/messages
Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
logger -p syslog.info -t TEST "Test"
tail /var/log/messages
nmtui
nmcli device
chkconfig yum
chkconfig ntpd on
systemctl list-units --type=service
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
sudo aws configure --profile AmazonCloudWatchAgent
sftp -oIdentityFile=/opt/aws/urataPri.ppk urataJbd@s-0832c55d03354dd19.server.transfer.us-east-2.amazonaws.com
mount -r /dev/cdrom /media
sftp -i id_rsa urata@s-c40c3567348f454bb.server.transfer.us-east-2.amazonaws.com
rpm -ivh http://ftp-2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install -y httpd php mysql-server php-mysqlnd
https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/install-LAMP.html#prepare-lamp-server-alami
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo systemctl start httpd
sudo usermod -a -G apache ec2-user
sudo chown -R ec2-user:apache /var/www
echo "" > /var/www/html/phpinfo.php
http:/publicdns/phpinfo.php
この画像は1Mbyteあります
この画像は1Mbyteあります