update
cat /etc/redhat-release
yum update
history
shopt
vi /etc/profile.d/history.sh

HISTTIMEFORMAT='%F %T '
HISTSIZE=100000
HISTFILESIZE=100000
HISTIGNORE='history:pwd:ls:ls *:ll:w:top:df *'      # 保存しないコマンド
PROMPT_COMMAND='history -a; history -c; history -r' # 履歴のリアルタイム反映
timezone
ll /etc/localtime
timedatectl
date

timedatectl set-timezone Asia/Tokyo
apache
systemctl status apache
systemctl status httpd

yum install epel-release
yum install https://repo.ius.io/ius-release-el7.rpm

vi /etc/yum.repos.d/epel.repo
vi /etc/yum.repos.d/ius.repo
enabled=0

yum install centos-logos.noarch mailcap openldap-devel expat-devel libdb-devel openssl perl
yum --enablerepo=epel install nghttp2 brotli
yum install --disablerepo=base,extras,updates --enablerepo=ius httpd httpd-devel mod_ssl
yum list | grep httpd
systemctl start httpd
systemctl enable httpd.service

httpd -h
httpd -S
httpd -t -D DUMP_VHOSTS
httpd -t -D DUMP_RUN_CFG
httpd -v
httpd -V
httpd -l
httpd -t -D DUMP_MODULES
httpd -M
httpd -t -D DUMP_INCLUDES

ll /var/log/httpd/
less /etc/logrotate.conf
less /etc/logrotate.d/httpd

mkdir /var/www/html/php
chmod 777 /var/www/html/php/
ps aux | grep httpd
systemctl reload httpd
systemctl status httpd
systemctl restart httpd
systemctl status httpd
php5.4
yum info php
rpm -q --changelog php | grep CVE | less

yum install php
php -v
php -r 'phpinfo();'  | less
php modules
php -m | less
yum list --enablerepo=epel | grep php | less
yum install php-bcmath
php -m | less

vi bcmath.php
php bcmath.php
vi gettext.php
php gettext.php
vi gettext.php
php /var/www/html/php/phpinfo.php | less
yum list --enablerepo=epel | grep php | less
yum install php-pgsql
vi postgresql.php
php postgresql.php
mkdir php
vi *.php php/.
mv *.php php/.

php -m | less
yum install --enablerepo=epel php-pecl-redis
php -m | less
vi redis.php
php redis.php
php -m | less
postgresql13
yum install postgresql
yum install centos-release-scl
yum repolist -q
yum repolist all | less
vi /etc/yum.repos.d/CentOS-SCLo-scl.repo
vi /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
↓
enabled=0

yum repolist all | less
yum repolist -q
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install postgresql13-contrib
yum install postgresql13-devel

yum repolist -q
yum install --enablerepo=epel postgresql13-devel
systemctl enable postgresql-13.service
ll /var/lib/pgsql/13/data/
PGSETUP_INITDB_OPTIONS="-E UTF8 --no-locale" /usr/pgsql-13/bin/postgresql-13-setup initdb
ll /var/lib/pgsql/13/data/
su - postgres

vi /var/lib/pgsql/.pgsql_profile
↓
PATH=/usr/pgsql-13/bin:$PATH
export PATH

which psql
psql -v
psql --version
/usr/pgsql-13/bin/psql --version
ls /bin/psql
ll /bin/psql
ll /etc/alternatives/pgsql-psql
pg_ctl
source .bash_profile

psql -l
psql -U postgres
createuser --login --pwprompt centos
createdb --owner=centos centos
systemctl start postgresql-13
ps aux | grep master
psql -U postgres
psql -l
redis6.2
yum list | grep redis
yum list --enablerepo=epel | grep redis
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
vi /etc/yum.repos.d/remi.repo
vi /etc/yum.repos.d/remi-safe.repo
↓
enabled=0

yum info --enablerepo=epel,remi redis
yum install --enablerepo=epel,remi redis
less /usr/lib/systemd/system/redis.service
systemctl status redis
systemctl enable redis
systemctl status redis
ps aux | grep redis
systemctl start redis
ps aux | grep redis
redis-cli ping
systemctl status redis

less /etc/logrotate.d/redis
pure-ftpd1.0.43
yum list | grep pure | less
yum list --enablerepo=epel | grep pure | less
cat /etc/redhat-release
yum update centos-release
→アップデート無し

yum repolist all | less
yum info --enablerepo=C7.0.1406-base pure-ftpd
yum search --enablerepo=C7.0.1406-base ftp
yum search ftp | less
yum install pure-ftpd
yum repolist all | less
yum list --enablerepo=epel | grep pure

cd /usr/local/src/
yum install wget
wget https://download.pureftpd.org/pub/pure-ftpd/releases/obsolete/pure-ftpd-1.0.43.tar.gz
tar xvzf pure-ftpd-1.0.43.tar.gz
cd pure-ftpd-1.0.43
yum install gcc
yum install openssl-devel
./configure --with-everything --with-paranoidmsg --without-capabilities --with-virtualchroot --with-uploadscript --with-tls
make
make install

https://gist.githubusercontent.com/zrong/c9588a17ccb15e75fdf7/raw/a24c563bfe0cdc238952ce24f560a8de42631c0f/pure-ftpd.sh

systemctl status pure-ftpd
cp configuration-file/pure-ftpd.conf /etc/.
cp configuration-file/pure-config.py /usr/local/bin/.
vi /etc/init.d/pure-ftpd
chmod 755 /etc/init.d/pure-ftpd
chmod 755 /usr/local/bin/pure-config.py
/etc/init.d/pure-ftpd start
ps aux | grep pure
yum install ftp
ftp localhost
java1.8.0
yum list | grep java | less
yum install java-1.8.0-openjdk
java -version
node.js14
yum list --enablerepo=epel | grep node | less
curl -fsSL https://rpm.nodesource.com/setup_14.x | bash -
vi /etc/yum.repos.d/nodesource-el7.repo
yum list | grep node
yum list | grep node | less
yum install nodejs
node -v
npm install forever -g
vi index.js
node index.js
forever start index.js
ll
vi node.js
mkdir node.js
mv index.js node.js/.

vi /etc/vsftpd/vsftpd.conf

pasv_enable=YES
pasv_min_port=60000
pasv_max_port=60001
pasv_address=x.x.x.x

vi /etc/pure-ftpd/pure-ftpd.conf

Bind                            z.z.z.z,10021

PassivePortRange          60010 60011

ForcePassiveIP x.x.x.x

 

vi nginx.conf

stream {
#FTP
upstream ftp {
hash $remote_addr;
server z.z.z.z:21 weight=5 max_fails=3 fail_timeout=30s; #v
server z.z.z.z:10021 weight=5 max_fails=3 fail_timeout=30s; #p
}

server {
listen 20021;
proxy_connect_timeout 1s;
# proxy_timeout 3s;
proxy_pass ftp;
}

#FTP data
upstream ftpdata-v1 {
server z.z.z.z:60000 weight=5 max_fails=3 fail_timeout=30s;
}
upstream ftpdata-v2 {
server z.z.z.z:60001 weight=5 max_fails=3 fail_timeout=30s;
}
upstream ftpdata-p1 {
server z.z.z.z:60010 weight=5 max_fails=3 fail_timeout=30s;
}
upstream ftpdata-p2 {
server z.z.z.z:60011 weight=5 max_fails=3 fail_timeout=30s;
}

# vsftpd
server {
listen 60000;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass ftpdata-v1;
}
server {
listen 60001;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass ftpdata-v2;
}

# pure-ftpd
server {
listen 60010;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass ftpdata-p1;
}
server {
listen 60011;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass ftpdata-p2;
}

vi /etc/rsyslog.conf

 

http://unixservermemo.web.fc2.com/sv/pure-log.htm

stream {
#FTP
upstream ftp {
server 127.0.0.1:21 weight=5 max_fails=3 fail_timeout=30s;
server 127.0.0.1:10021 weight=5 max_fails=3 fail_timeout=30s;
}

server {
listen 20021;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass ftp;
}

 

と思ったら、vsftpd/pureftpd共に、Passiveコマンドで失敗している

227 Entering Passive Mode (160,16,117,208,47,254)
421 Service not available, remote server has closed connection

 

vsftpdは以下設定で回避できたが、

pasv_promiscuous=yes

 

pure-ftpdは回避できるオプションがなさそう。

 

 

同一サーバ、単一PHPから、

ログイン、chdir後、異なる5000ファイルをアップロード

 

vsftpd 3.0.3 from source

pure-ftpd v1.0.30 from yum install

 

pure-ftpdの方が早いみたい。。

 

vsftpd
num : 5000
total : 2.30912 s
one : 0.00046s/req

pure-ftpd
num : 5000
total : 2.0004 s
one : 0.0004s/req

wget pure-ftpd-1.0.32

※1.0.42は、configure で、autoconfでエラー

※yum install (1.0.30)でも動作

 

cd pure-ftpd-1.0.32

./configure –with-pam –with-pgsql=/var/lib/pgsql

make

make install

cp xxx /etc/init.d/pure-ftpd-src

cp xxx /etc/pure-ftpd/pure-ftpd-src.conf

PGSQLConfigFile               /etc/pure-ftpd/pureftpd-pgsql.conf

PAMAuthentication             no

UnixAuthentication            no

CreateHomeDir               yes

 

/etc/pure-ftpd/pureftpd-pgsql.conf

諸々

SELECT “Password” FROM users WHERE “User”=’\L’

ダブルクォーテーションが必要