网络模式选用net模式
vim bath-com net-tools
1、解压缩
tar -zxvf mysql-5.6.47-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.6.50-linux-glibc2.12-x86_64 /usr/local/mysql (mysql用于存放mysql的数据)
useradd -s /sbin/nologin mysql
初始化数据库
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql
yum install -y perl-Module-Install
./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
--user 是指定MySQL用户 ---datadir 是指定数据存放目录
配置文件
cp support-files/my-default.cnf /etc/my.cnf
basedir = /usr/local/mysql/ MySQL安装的目录
datadir = /data/mysql MySQL数据存放的目录
port = 3306 mysql的端口号
server_id = 155 集群id
socket = /tmp/mysql.sock
配置启动脚本文件
cp support-files/mysql.server /etc/init.d/mysqld
basedir=/usr/local/mysql/
datadir=/data/mysql
设置mysql 开启mysql
1、把启动脚本加入到系统服务中:
chkconfig --add mysqld
chkconfig mysqld on
2、启动mysql
service mysqld start
ps -ef |grep mysqld
1、解压安装包
tar -zxvf apr-1.6.5.tar.gz
tar -zxvf apr-util-1.6.1.tar.gz
tar -zxvf httpd-2.4.46.tar.gz
cd apr-1.6.5/
./configure --prefix=/usr/local/apr
4、报错安装:
yum install libtool* -y
make && make install
cd apr-util-1.6.1/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
yum install -y expat-devel
10、切换目录
cd httpd-2.4.46/
./configure \
--prefix=/usr/local/apache2.4 \ 安装目录
--with-apr=/usr/local/apr \ 依赖
--with-apr-util=/usr/local/apr-util \ 依赖
--enable-so \ 支持动态扩展模块 后缀:.so
--enable-mods-shared=most 支持多个动态扩展模块
yum install -y prce-devel
make&&make install
报错有两种办法
make&&make install
./configure --prefix=/usr/local/apache2.4 --enable-so --with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
1、解压
tar -zxvf php-5.6.30
cd php-5.6.30
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-gd --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
yum install libxml2-devel bzip2 bzip2-level libpng libpng-devel openssl openssl-devel freetype freetype-devel epel-release libmcrypt-devel -y
make&&make install
1、切换目录
cd /usr/local/apache2.4/conf/
vim /usr/local/apache2.4/conf/httpd.conf
搜索ServerName,把ServerName www.example.com:80前#去掉
搜索Require,把Require all denied改为Require all granted 允许所有请求访问
搜索AddType application/x-gzip .gz .tgz 在下面添加一行
AddType application/x-httpd-php .php
搜索Index,在DirectoryIndex index.html后面添加index.php
/usr/local/apache2.4/bin/apachectl -t
/usr/local/apache2.4/bin/apachectl graceful
/usr/local/apache2.4/bin/apachectl start
vim /usr/local/apache2.4/htodcs/test.php //增加如下内容
<?php
echo 123;
?>
curl localhost/test.php