侧边栏壁纸
博主头像
silianpan博主等级

Feel no regret for this life.

  • 累计撰写 40 篇文章
  • 累计创建 22 个标签
  • 累计收到 3 条评论

CentOS6.9升级Httpd2.4和PHP5.6版本

silianpan
2022-03-18 / 0 评论 / 0 点赞 / 497 阅读 / 2,925 字
温馨提示:
本文最后更新于 2022-03-18,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

Httpd升级(2.4.43)

所需文件

image.png

automake安装

rpm -qf /usr/bin/automake
rpm -qf /usr/bin/automake
rpm -e --nodeps autoconf-2.63
rpm -e --nodeps automake-1.11.1-4.el6

先安装autoconf,再安装automake

tar zxvf autoconf-latest.tar.gz
cd autoconf-2.69
./configure --prefix=/usr
make && make install

tar zxvf automake-1.16.1.tar.gz
cd automake-1.16.1
./configure --prefix=/usr
make && make install

Httpd安装

按顺序安装expat,apr,apr-util,pcre

tar -zxvf expat-2.2.9.tar.gz
cd expat-2.2.9
./configure
make && make install

tar -zxvf apr-1.7.0.tar.gz
cd apr-1.7.0
./configure --prefix=/usr/local/apr
make && make install

tar -jxvf apr-util-1.6.1.tar.bz2
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

tar -zxvf pcre-8.44.tar.gz
cd pcre-8.44
./configure --prefix=/usr/local/pcre
make && make install

安装所需包

yum install -y gcc gcc-c++
yum install -y bison bison-devel
yum install -y flex
yum install -y zlib-devel

安装Httpd

tar -zxvf httpd-2.4.43.tar.gz
cd httpd-2.4.43
./configure --prefix=/usr/local/httpd2 --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache --enable-flie-cache --enable-disk-cache --enable-mem-cache --enable-rewrite --enable-so --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --with-included-apr
make && make install

PHP升级(5.6.40)

安装所需包

yum install -y libcurl-devel
yum install -y bzip2-devel
yum install -y libjpeg-devel
yum install -y libpng-devel
yum install -y freetype-devel
yum install -y libmcrypt-devel

确保MySQL已安装

tar -zxvf php-5.6.40.tar.gz
cd php-5.6.40
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2/bin/apxs --with-libxml-dir=/usr/include/libxml2 --with-config-file-path=/usr/local/httpd2/conf --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-gd --enable-gd-native-ttf --with-zlib --with-mcrypt --with-pdo-mysql=mysqlnd --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-zip --with-xmlrpc --enable-fpm --enable-mbstring --with-zlib-dir --with-bz2 --with-curl --enable-exif --enable-ftp --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-freetype-dir=/usr/lib/ --with-mysql-sock=/mysqldata/mysql/mysql.sock
make && make install

OpenSSH升级(8.3p1)(CentOS6.9)

参考

备份

cp -rf /etc/ssh /etc/ssh.bak

安装Telnet

yum install telnet-server

# 修改disable为no
vim /etc/xinetd.d/telnet

/etc/init.d/xinetd start
/etc/init.d/xinetd restart

# 关闭防火墙
/etc/init.d/iptables stop
# 或打开23端口
/etc/init.d/iptables -I INPUT -p tcp --dport 23 -j ACCEPT
/etc/init.d/iptables -I INPUT -p udp --dport 23 -j ACCEPT

# 修改SELINUX=disabled
vim /etc/sysconfig/selinux

# 允许root用户通过telnet登录
vim /etc/securetty # 添加pts/0 pts/1 ....按连接数来加
vim /etc/pam.d/login # 注释第一行带pam_securetty.so字样
vim /etc/pam.d/remote # 注释第一行带pam_securetty.so字样

安装OpenSSH

安装所需包

yum install -y gcc openssl-devel pam-devel rpm-build tcp_wrappers-devel

安装OpenSSH

tar -zxvf openssh-8.3p1.tar.gz
cd openssh-8.3p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords --with-tcp-wrappers
make && make install

修改配置

sed -i '/^#PermitRootLogin/s/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config

重启服务

service sshd restart
0

评论区