一、安装MYSQL
64 yum install wget
65 wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
66 tar zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
67 mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql
68 cd /usr/local/mysql/
71 mkdir -p /data/mysql
72 useradd mysql
75 yum install -y perl*
76 ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
78 cp support-files/my-default.cnf /etc/my.cnf
79 vi /etc/my.cnf
basedir = /usr/local/mysql
datadir = /data/mysql
port = 3306
socket = /tmp/mysql.sock
80 cp support-files/mysql.server /etc/init.d/mysqld
81 vi /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/data/mysql
82 chmod 755 /etc/init.d/mysqld
83 chkconfig --add mysqld
84 chkconfig --list
85 /etc/init.d/mysqld start
或 86 service mysqld start
87 netstat -lnp
88 ps aux |grep mysqld
更改MYSQL密码
[root@localhost mysql]# cp bin/* /usr/bin/
[root@localhost mysql]# mysqladmin -uroot password
New password:
Confirm new password:
[root@localhost mysql]# mysql -uroot -p
Enter password: Welcome to the MySQL monitor.
Commands end with ; or \g. Your MySQL connection id is 2Server version: 5.6.32 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. 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> show databases;
+--------------------+
| Database
|+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.05 sec)
二、安装HTTP
96 cd /usr/local/src
98 wget http://mirrors.sohu.com/apache/httpd-2.4.33.tar.gz
99 tar zxvf httpd-2.4.33.tar.gz
149 wget http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
151 cd apr-1.6.3
154 yum install gcc*
156 yum install libtool* -y
157 ./configure --prefix=/usr/local/apr
159 make
160 make install
162 cd ..
wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2
166 yum install bzip2*
169 tar jxvf apr-util-1.6.1.tar.bz2
170 cd apr-util-1.6.1
175 yum install -y expat*
176 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
177 make
179 make install
185 cd ..
186 wget https://jaist.dl.sourceforge.net/project/pcre/pcre/8.41/pcre-8.41.tar.gz
https://netix.dl.sourceforge.net/project/pcre/pcre/8.42/pcre-8.42.tar.gz
188 tar zxvf pcre-8.41.tar.gz
190 cd pcre-8.41
192 ./configure --prefix=/usr/local/pcre
193 make
195 make install
197 cd ..
出现这种原因是因为apr,apr-util缺失,只需要把/usr/local/src下的apr和apr-util拷贝到./srclib下
#cd /usr/local/src/
#cp -r apr-1.6.3 /usr/local/src/httpd-2.4.33/srclib/apr
#cp -r apr-util-1.6.1 /usr/local/src/httpd-2.4.33/srclib/apr-util
198 cd httpd-2.4.33
#./configure --with-included-apr --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most --with-pcre=/usr/local/pcre
202 make
204 make install
208 cd /usr/local/apache2.4/conf
210 vi httpd.conf
ServerName localhost:80
211 /usr/local/apache2.4/bin/apachectl start
212 netstat -lnp
213 systemctl status firewalld
214 systemctl stop firewalld
215 systemctl disable firewalld
216 systemctl status firewalld