[root@localhost ~]# wget https://downloads.apache.org/apr/apr-1.7.0.tar.gz[root@localhost ~]# wget https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz[root@localhost ~]# wget https://downloads.apache.org/httpd/httpd-2.4.53.tar.gz[root@localhost ~]# ls
anaconda-ks.cfg apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.54.tar.gz
[root@localhost ~]# dnf -y group mark install "Development Tools"[root@localhost ~]# dnf -y install gcc gcc-c++ openssl-devel pcre-devel expat-devel make ncurses-compat-libs[root@localhost ~]# useradd -r -M -s /sbin/nologin apache[root@localhost ~]# tar xf apr-1.7.0.tar.gz [root@localhost ~]# tar xf apr-util-1.6.1.tar.gz [root@localhost ~]# tar xf httpd-2.4.54.tar.gz [root@localhost ~]# cd apr-1.7.0[root@localhost ~]# cd apr-1.7.0[root@localhost apr-1.7.0]# vim configure$RM"$cfgfile" //删除此行
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr[root@localhost apr-1.7.0]# make && make install[root@localhost apr-1.7.0]# cd ../apr-util-1.6.1[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr[root@localhost apr-util-1.6.1]# make && make install[root@localhost apr-util-1.6.1]# cd ../httpd-2.4.54[root@localhost httpd-2.4.53]# ./configure --prefix=/usr/local/apache \> --enable-so \> --enable-ssl \> --enable-cgi \> --enable-rewrite \> --with-zlib \> --with-pcre \> --with-apr=/usr/local/apr \> --with-apr-util=/usr/local/apr-util/ \> --enable-modules=most \> --enable-mpms-shared=all \> --with-mpm=prefork
[root@localhost httpd-2.4.54]# make && make install[root@localhost apache]# echo 'export PATH=/usr/local/apache/bin:$PATH' > /etc/profile.d/apache.sh[root@localhost apache]# source /etc/profile.d/apache.sh [root@localhost apache]# apachectl start
安装mysql数据库
[root@localhost ~]# wget https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz[root@localhost ~]# useradd -r -M -s /sbin/nologin mysql[root@localhost ~]# tar xf mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz -C /usr/local/[root@localhost ~]# cd /usr/local/ src[root@localhost local]# mv mysql-5.7.37-linux-glibc2.12-x86_64/ mysql[root@localhost local]# ls
apache apr apr-util bin etc games include lib lib64 libexec mysql sbin share src
[root@localhost local]# chown -R mysql.mysql mysql/[root@localhost local]# echo 'export PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh[root@localhost local]# source /etc/profile.d/mysql.sh [root@localhost local]# ln -s /usr/local/mysql/include /usr/include/mysql[root@localhost local]# vim /etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib
[root@localhost local]# ldconfig[root@localhost local]# mkdir -p /opt/data[root@localhost local]# chown -R mysql.mysql /opt/data/# 初始化后有临时密码[root@localhost local]# mysqld --initialize --user mysql --datadir /opt/data[root@localhost local]# echo 'wctmvl*oI7<;' > /root/pass[root@localhost local]# vim /etc/my.cnf[mysqld]
basedir = /usr/local/mysql
datadir = /opt/data
socket = /tmp/mysql.sock
port =3306
pid-file = /opt/data/mysql.pid
user = mysql
skip-name-resolve
[root@localhost local]# /usr/local/mysql/support-files/mysql.server start
[root@localhost local]# mysql -uroot -p'wctmvl*oI7<;'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.37
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> set password = password('123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> exit
Bye