redhat5.4 安装mysql_RedHat5.4搭建LAMP

环境准备:

我的环境:Red Hat Enterprise Linux Server release 5.4

所需软件包:

apr-1.4.6.tar.gz

httpd-2.4.2.tar.bz2

php-5.4.4.tar.gz

apr-util-1.4.1.tar.gz

libmcrypt-2.5.7.tar.gz

cmake-2.8.6.tar.gz

mysql-5.5.25.tar.gz

辅助包:

ncurses-devel.i386

pcre-devel

libxml2

安装配置过程:

安装cmake编译工具

[root@orcl10g LAMP]# tar zxvf cmake-2.8.6.tar.gz

[root@orcl10g LAMP]# cd cmake-2.8.6

[root@orcl10g cmake-2.8.6]# ./configure

[root@orcl10g cmake-2.8.6]# make

[root@orcl10g cmake-2.8.6]# make install

查看cmake是否安装成功

[root@orcl10g cmake-2.8.6]# which cmake

/usr/local/bin/cmake

安装libmcrypt-2.5.7

[root@orcl10g LAMP]# tar zxvf libmcrypt-2.5.7

[root@orcl10g LAMP]# cd libmcrypt-2.5.7

[root@orcl10g libmcrypt-2.5.7]# ./configure

编译:

[root@orcl10g libmcrypt-2.5.7]# make

安装:

[root@orcl10g libmcrypt-2.5.7]# make install

安装mysql

添加mysql用户组

[root@orcl10g LAMP]# groupadd mysql

创建mysql用户,不允许其直接登入系统

[root@orcl10g LAMP]# useradd -g mysql -s /sbin/nologin mysql

创建mysql的数据存放路径并设置目录权限

[root@orcl10g mysql-5.5.25]# mkdir -p /mysql/data

[root@orcl10g mysql-5.5.25]# chown -R mysql:mysql /mysql/data

解压安装包:

[root@orcl10g LAMP]# tar zxvf mysql-5.5.25.tar.gz

[root@orcl10g LAMP]# cd mysql-5.5.25

cmake配置使安装路径为/usr/local/mysql5字符集设置为all

[root@orcl10g mysql-5.5.25]# cmake -DECMAKE_INSTALL_PREFIX=/usr/local/mysql5 -DEXTRA_CHARSETS=all

执行会出如下错误:

-- Could NOT find Curses  (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)

CMake Error at cmake/readline.cmake:83 (MESSAGE):

Curses library not found.  Please install appropriate package,

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.

Call Stack (most recent call first):

cmake/readline.cmake:127 (FIND_CURSES)

cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)

CMakeLists.txt:257 (MYSQL_CHECK_READLINE)

-- Configuring incomplete, errors occurred!

提示的很明显,需要安装ncurses-devel包,在镜像里找到该包并安装,yum安装更方便:

[root@orcl10g ~]# yum install ncurses-devel -y

删除ncurses-devel再次执行cmake命令

[root@orcl10g LAMP]# cd mysql-5.5.25

[root@orcl10g mysql-5.5.25]# rm -rf CMakeCache.txt

[root@orcl10g mysql-5.5.25]# cmake -DECMAKE_INSTALL_PREFIX=/usr/local/mysql5 -DEXTRA_CHARSETS=all

[root@orcl10g mysql-5.5.25]# make

[root@orcl10g mysql-5.5.25]# make install

添加数据存放路径:

[root@orcl10g apache2]# vi /etc/my.cnf

[mysqld]

添加

datadir = /mysql/data

添加root密码

[root@orcl10g apache2]# /usr/local/mysql/bin/mysqladmin -u root password 123456

登入测试:

[root@orcl10g apache2]# /usr/local/mysql/bin/mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 10

Server version: 5.5.25-log Source distribution

Copyright (c) 2000, 2011, 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.00 sec)

mysql>

[root@orcl10g mysql]# cp ./support-files/my-medium.cnf /etc/my.cnf

生成测试数据库:

[root@orcl10g mysql]# /usr/local/mysql/scripts/mysql_install_db --user=mysql

启动数据库

[root@orcl10g mysql-5.5.25]# /usr/local/mysql/bin/mysqld --user=mysql

安装配置apache2

安装apr-1.4.6

[root@orcl10g LAMP]# tar zxvf apr-1.4.6.tar.gz

[root@orcl10g LAMP]# cd apr-1.4.6

[root@orcl10g apr-1.4.6]# ./configure --prefix=/usr/local/apr-httpd/

[root@orcl10g apr-1.4.6]# make

[root@orcl10g apr-1.4.6]# make install

安装apr-util-1.4.1

[root@orcl10g apr-1.4.6]# cd ..

[root@orcl10g LAMP]# tar zxvf apr-util-1.4.1.tar.gz

[root@orcl10g LAMP]# cd apr-util-1.4.1

[root@orcl10g apr-util-1.4.1]# ./configure --prefix=/usr/local/apr-util-httpd/

--with-apr=/usr/local/apr-httpd/

[root@orcl10g apr-util-1.4.1]# make & make install

解压安装apache

[root@orcl10g LAMP]# tar ixvf httpd-2.4.2.tar.bz2

[root@orcl10g LAMP]# cd httpd-2.4.2

指定安装路径,并允许读写,指派刚安过的apr和apr-util路径

[root@orcl10g httpd-2.4.2]# ./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/

执行会报错:

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

需要安装依赖包pcre-devel.i386:

镜像中找到pcre-devel或者使用yum安装

[root@orcl10g httpd-2.4.2]# yum install pcre* -y

Installed:

pcre-devel.i386 0:6.6-2.el5_1.7

Complete!

重新执行./configure命令

[root@orcl10g httpd-2.4.2]# ./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/

编译

[root@orcl10g httpd-2.4.2]# make

安装

[root@orcl10g httpd-2.4.2]# make install

启动apache2

[root@orcl10g httpd-2.4.2]# /usr/local/apache2/bin/apachectl start

如果报以下错误,需修改一下配置文件:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

[root@orcl10g httpd-2.4.2]# vi /usr/local/apache2/conf/httpd.conf

加入ServerName

# If your host doesn't have a registered DNS name, enter its IP address here.

#

#ServerName www.example.com:80

ServerName localhost:80

再次启动apache

[root@orcl10g httpd-2.4.2]# /usr/local/apache2/bin/apachectl start

[root@orcl10g httpd-2.4.2]# /usr/local/apache2/bin/apachectl

httpd (pid 15249) already running

安装php

解压php包

[root@orcl10g LAMP]# tar zxvf php-5.4.4.tar.gz

[root@orcl10g LAMP]# cd php-5.4.4

配置:

[root@orcl10gphp-5.4.4]# ./configure --prefix=/usr/local/php5/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --enable-mbstring

提示报错:

checking libxml2 install dir... no

checking for xml2-config path...

configure: error: xml2-config not found. Please check your libxml2 installation.

缺少 libxml2包

[root@orcl10g php-5.4.4]# yum install libxm*

再次执行配置:

[root@orcl10g php-5.4.4]# ./configure --prefix=/usr/local/php5/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --enable-mbstring

编译

[root@orcl10g php-5.4.4]#make

安装

[root@orcl10g php-5.4.4]#make install

测试:

[root@orcl10g ~]# cd /usr/local/apache2/htdocs/

[root@orcl10g htdocs]# vi index.php

写入内容如下:

phpinfo();

?>

6378c302cec7e743030ca9bf6ab89ead.png

php信息:

e99b05ec682d5cbf2a9d80213528dd7d.png

apache信息

2aabf80e5d37e8add4f1aa274d3a719f.png

mysql信息

44ead2c5c17a17af14f214ac37155197.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
目标检测(Object Detection)是计算机视觉领域的一个核心问题,其主要任务是找出图像中所有感兴趣的目标(物体),并确定它们的类别和位置。以下是对目标检测的详细阐述: 一、基本概念 目标检测的任务是解决“在哪里?是什么?”的问题,即定位出图像中目标的位置并识别出目标的类别。由于各类物体具有不同的外观、形状和姿态,加上成像时光照、遮挡等因素的干扰,目标检测一直是计算机视觉领域最具挑战性的任务之一。 二、核心问题 目标检测涉及以下几个核心问题: 分类问题:判断图像中的目标属于哪个类别。 定位问题:确定目标在图像中的具体位置。 大小问题:目标可能具有不同的大小。 形状问题:目标可能具有不同的形状。 三、算法分类 基于深度学习的目标检测算法主要分为两大类: Two-stage算法:先进行区域生成(Region Proposal),生成有可能包含待检物体的预选框(Region Proposal),再通过卷积神经网络进行样本分类。常见的Two-stage算法包括R-CNN、Fast R-CNN、Faster R-CNN等。 One-stage算法:不用生成区域提议,直接在网络中提取特征来预测物体分类和位置。常见的One-stage算法包括YOLO系列(YOLOv1、YOLOv2、YOLOv3、YOLOv4、YOLOv5等)、SSD和RetinaNet等。 四、算法原理 以YOLO系列为例,YOLO将目标检测视为回归问题,将输入图像一次性划分为多个区域,直接在输出层预测边界框和类别概率。YOLO采用卷积网络来提取特征,使用全连接层来得到预测值。其网络结构通常包含多个卷积层和全连接层,通过卷积层提取图像特征,通过全连接层输出预测结果。 五、应用领域 目标检测技术已经广泛应用于各个领域,为人们的生活带来了极大的便利。以下是一些主要的应用领域: 安全监控:在商场、银行
目标检测(Object Detection)是计算机视觉领域的一个核心问题,其主要任务是找出图像中所有感兴趣的目标(物体),并确定它们的类别和位置。以下是对目标检测的详细阐述: 一、基本概念 目标检测的任务是解决“在哪里?是什么?”的问题,即定位出图像中目标的位置并识别出目标的类别。由于各类物体具有不同的外观、形状和姿态,加上成像时光照、遮挡等因素的干扰,目标检测一直是计算机视觉领域最具挑战性的任务之一。 二、核心问题 目标检测涉及以下几个核心问题: 分类问题:判断图像中的目标属于哪个类别。 定位问题:确定目标在图像中的具体位置。 大小问题:目标可能具有不同的大小。 形状问题:目标可能具有不同的形状。 三、算法分类 基于深度学习的目标检测算法主要分为两大类: Two-stage算法:先进行区域生成(Region Proposal),生成有可能包含待检物体的预选框(Region Proposal),再通过卷积神经网络进行样本分类。常见的Two-stage算法包括R-CNN、Fast R-CNN、Faster R-CNN等。 One-stage算法:不用生成区域提议,直接在网络中提取特征来预测物体分类和位置。常见的One-stage算法包括YOLO系列(YOLOv1、YOLOv2、YOLOv3、YOLOv4、YOLOv5等)、SSD和RetinaNet等。 四、算法原理 以YOLO系列为例,YOLO将目标检测视为回归问题,将输入图像一次性划分为多个区域,直接在输出层预测边界框和类别概率。YOLO采用卷积网络来提取特征,使用全连接层来得到预测值。其网络结构通常包含多个卷积层和全连接层,通过卷积层提取图像特征,通过全连接层输出预测结果。 五、应用领域 目标检测技术已经广泛应用于各个领域,为人们的生活带来了极大的便利。以下是一些主要的应用领域: 安全监控:在商场、银行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值