gcc版本切换
yum -y install centos-release-scl
yum -y install devtoolset-6-gcc*
scl enable devtoolset-6 bash
none
yum -y install centos-release-scl
yum -y install devtoolset-6-gcc*
scl enable devtoolset-6 bash
最近今天心血来潮又折腾了下fedora, 直接从23跳到34版本.
但是遇上了rpmlib(PayloadIsZstd) <= 5.4.18-1 is needed by 错误.
大致上就是rpmlib依赖包过不去又不想挨个版本升级,
简单搜索了下解决方案先升级到25 30 32 然后就可以升级至34最新了.
dnf system-upgrade download --releasever=34 --allowerasing --nogpgcheck -y
dnf system-upgrade reboot
顺道看了下fedora自带php7.4 / mariadb 10.5 / nginx 1.20 也有openresty的支持, 其实用于个人的生产环境妥妥的简单省事.
现在windows10下的PowerShell下命令安装, 或者直接在商店里面搜索Windows Terminal并安装。
winget install --id=Microsoft.WindowsTerminal -e
大致上看了一下可以支持各种配色,除了windows拉跨的字体渲染显示比较拉跨外,其他都还不错。
搭配一下OpenSSH再配置下RSYNC基本上用起来和Linux原生环境差不多了。
安装完后在cmd或者powershell里面运行wt就启动了, 接下来配色更换字体等等都可以DIY定制了。
自从Kvm进入内核自带后自己编译Xen内核相对比较麻烦, 已经很多年没玩Xen了.
Centos也停止Xen更新了, 另外还有个crc.id.au的一直在更新维护安装包.
https://xen.crc.id.au/downloads/
https://wiki.centos.org/HowTos/Xen/Xen4QuickStart
由于有现成的安装包, 就不用去编译内核了.
https://rpms.remirepo.net/wizard/
yum -y install epel-release -y
yum install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
备用记录下, 下次装libzip不用去编译了.
yum -y --enablerepo=remi install libzip-last-devel
yum -y install epel-release
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y --enablerepo=remi install libzip-last-devel
yum -y install gcc vim-enhanced gcc-c++ libtool-libs libtool autoconf subversion zip unzip wget crontabs iptables file bison patch mlocate flex diffutils automake imake make cmake kernel-devel cpp zlib-devel \
libevent-devel libxml2-devel freetype-devel gd gd-devel libjpeg-devel libpng-devel ncurses-devel \
curl-devel readline-devel openssl-devel glibc-devel glib2-devel bzip2-devel e2fsprogs-devel libidn-devel gettext-devel expat-devel libcap-devel libtool-ltdl-devel pam-devel \
libxslt-devel libc-client-devel freetds-devel unixODBC-devel libXpm-devel krb5-devel libicu-devel icu sqlite-devel libsodium-devel oniguruma-devel
wget https://www.php.net/distributions/php-8.0.11.tar.gz -O - | tar xz
cd php-8.*
prefix="/opt/php8";
# --with-zip
./configure --quiet --prefix=$prefix/usr --with-config-file-path=$prefix/etc --sysconfdir=$prefix/etc --sbindir=$prefix/sbin --bindir=$prefix/bin --localstatedir=$prefix/var --enable-fpm --enable-bcmath --enable-exif --enable-ftp --enable-mbstring --enable-soap --enable-sockets --with-curl --with-gettext --with-openssl --with-mhash --with-mysql-sock=/var/lib/mysql/mysql.sock --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-imap --with-imap-ssl --with-kerberos --with-zlib --enable-intl=shared --enable-xml --disable-rpath --enable-shmop --enable-sysvsem --enable-mbregex --enable-pcntl --enable-opcache --enable-exif --with-sqlite3 --with-pdo-sqlite --enable-calendar --with-freetype --with-jpeg --enable-gd --with-sodium --with-zip --with-libdir=lib64 ;
make -j `grep name /proc/cpuinfo|wc -l`
make install
sed -i 's#expose_php = On#expose_php = Off#' php.ini-production
sed -i 's#;date.timezone =#date.timezone=Asia/Shanghai#g' php.ini-production
sed -i 's#;cgi.fix_pathinfo=1#cgi.fix_pathinfo=0#g' php.ini-production
sed -i 's#enable_dl = Off#enable_dl = On#' php.ini-production
sed -i 's#register_argc_argv = Off#register_argc_argv = On#' php.ini-production
sed -i 's#short_open_tag = Off#short_open_tag = On#' php.ini-production
sed -i 's#output_buffering = Off#output_buffering = On#' php.ini-production
sed -i 's/memory_limit = 32M/memory_limit = 128M/g' php.ini-production
sed -i 's/post_max_size = 8M/post_max_size = 32M/g' php.ini-production
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 128M/g' php.ini-production
sed -i 's#allow_call_time_pass_reference = Off#allow_call_time_pass_reference = On#' php.ini-production
sed -i 's/disable_functions =/disable_functions="passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen"/g' php.ini-production
mkdir -p $prefix/etc/php-fpm.d
ln -s $prefix/bin/ph* /usr/bin/
ln -s $prefix/sbin/ph* /usr/sbin/
#cp ./sapi/fpm/php-fpm /etc/init.d/php-fpm #弃用init.d
install -p -D -m 0644 sapi/fpm/php-fpm.service /usr/lib/systemd/system/
install -p -D -m 0644 php.ini-production $prefix/etc/php.ini
#Set fpm.conf
cat>$prefix/etc/php-fpm.conf<<EOF
[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
log_level = warning
emergency_restart_threshold = 30
emergency_restart_interval = 60s
process_control_timeout = 5s
daemonize = yes
include=$prefix/etc/php-fpm.d/*.conf
EOF
cat>$prefix/etc/php-fpm.d/default.conf<<EOF
[default]
;listen=127.0.0.1:9006
listen=/dev/shm/php-fpm.sock
listen.mode=0666
user=nobody
group=nobody
pm=dynamic
pm.max_children=128
pm.start_servers=20
pm.min_spare_servers=5
pm.max_spare_servers=35
pm.max_requests=10000
rlimit_files=51200
slowlog=log/\$pool.log.slow
env[PATH] = /usr/local/bin:/usr/bin:/bin:$prefix/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
EOF
systemctl enable php-fpm
systemctl start php-fpm