Linux下编译安装Apache报AP牧马人 not found错误的消除办法

我在编译安装完Nginx、MySQL和PHP(见之前一篇博客:LNMP环境搭建详细教程)之后,进行apache的编译安装:

cd /usr/local/src 

wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.34.tar.gz 

tar zxvf httpd-2.4.34.tar.gz  

cd httpd-2.4.34  

./configure --prefix=/usr/local/httpd  

就在这个时候提示:configure: error: APR not found. Please read the documentation.
这说明缺少APR依赖,那么安装即可,可以用yum安装但是不推荐,因为yum安装的APR版本可能不足以支持你所安装的apache版本,所以还是要用编译安装高版本的APR:

cd /usr/local/src

wget http://archive.apache.org/dist/apr/apr-1.6.3.tar.gz 

wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz

以下是用yum在linux中布署php环境:

  linux下安插php项目环境足以分为三种,一种拔取Apache,php,mysql的压缩包安装,一种用yum命令举行安装。

关联php和mysql

 

  1.物色模块

[[email protected] ~]# yum search php

 

  2.设置相关模块

[[email protected] ~]# yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml  php-xmlrpc

 

  3.装置完毕,重启mysqld,重启httpd

再一次访问刚才的info.php,大家发现已经多了MySQL的连锁新闻。如右图:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   至此,php在linux中的运营条件就已经成功布置落成了。

 

  1.mysql yum安装暗中认同文件夹及相关命令

数据库目录:/var/lib/mysql/

配置文件:/usr/share/mysql(mysql.server命令及配置文件)

相关命令:/usr/bin(mysqladmin mysqldump等命令)

my.cnf: /etc/my.cnf

启动脚本:/etc/rc.d/init.d/(启动脚本文件mysql的目录)

启动命令:service mysql start

停止命令:service mysql stop

运行状态:service mysql status

 

 

  2.apache

配置文件路径:/etc/httpd/conf/httpd.conf

启动命令:service httpd start

停止命令:service httpd stop

运行状态:service httpd status

 

 

  3.php

php默认页面路径:/var/www/html

 

 

 

连锁链接:

 

linux下安顿php项目条件足以分成二种,一种采纳Apache,php,mysql的压缩包安装,一种用yu…

tar zxvf apr-1.6.3.tar.gz

tar zxvf apr-util-1.6.1.tar.gz

cd/usr/local/src/apr-1.6.3 #安装apr

./configure --prefix=/usr/local/apr  

make && make install

cd /usr/local/src/apr-util-1.6.1  #安装apr-util

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr   

make && make install

依赖全部安装完毕后再次切换到httpd的安装目录安装apache:

cd /usr/local/src/httpd-2.4.34

./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

make && make install

 

  1.php安装命令

[root@tele-2 ~]# yum install php

 

  2.一向一路装置,安装已毕将来重新重启httpd服务

[root@tele-2 ~]# service httpd start
Redirecting to /bin/systemctl start  httpd.service

 

  3.重启之后大家开展测试PHP相关音信,大家新建3个PHP界面举办测试

在apache暗许页面路径/``var``/www/html下新建1个test.php页面,添加代码

<?php
 phpinfo();
?>

     

图片 1

 

  4.拜访这么些页面,输入localhost/test.php,只怕

ip:端口号/test.php就可以看见php环境的配置消息了。如右图:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

linux下部署php项目-Apache、php、mysql关联,-apachemysql

  linux下布置php项目条件得以分为两种,一种选拔Apache,php,mysql的压缩包安装,一种用yum命令进行设置。

动用二种软件的缩减包举行设置,须求手动配置三者之间的涉及。apache和php之间的配置没有怎么难度,但是和mysql进行配备的时候就须求对php的刺探了。

以下是用yum在linux中陈设php环境:

 

到此设置成功,想要运转、为止、重启apache须求用到命令:

  linux下布置php项目环境足以分成三种,一种选拔Apache,php,mysql的压缩包安装,一种用yum命令进行安装。

关联php和mysql

 

  1.寻觅模块

[root@tele-2 ~]# yum search php

 

  2.装置相关模块

[root@tele-2 ~]# yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml  php-xmlrpc

 

图片 2

  3.安装到位,重启mysqld,重启httpd

再一次访问刚才的info.php,大家发现早已多了MySQL的连锁音信。如右图:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   至此,php在linux中的运营环境就曾经打响陈设完结了。

 

  1.mysql
yum装置暗中同意文件夹及有关命令

数据库目录:/var/lib/mysql/

配置文件:/usr/share/mysql(mysql.server命令及配置文件)

相关命令:/usr/bin(mysqladmin mysqldump等命令)

my.cnf: /etc/my.cnf

启动脚本:/etc/rc.d/init.d/(启动脚本文件mysql的目录)

启动命令:service mysql start

停止命令:service mysql stop

运行状态:service mysql status

 

 

  2.apache

配置文件路径:/etc/httpd/conf/httpd.conf

启动命令:service httpd start

停止命令:service httpd stop

运行状态:service httpd status

 

 

  3.php

php默认页面路径:/var/www/html

 

 

 

连锁链接:

 

 

vim /usr/local/httpd/conf/httpd.conf

利用三种软件的减弱包进行设置,要求手动配置三者之间的涉嫌。apache和php之间的布署没有何样难度,然而和mysql举行配置的时候就要求对php的摸底了。

MySql

 

  1.mysql和apache最好是率先举办安装的,因为在安排php的时候需求与mysql和apache举行关联配置和测试

第③下载mysql-sever文件,因为博主linux环境是CentOS版本,yum源中一般没有例行安装mysql时的mysql-sever文件,须要去官网上下载

1.下载mysql-service文件

[root@tele-1 ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

2.安装mysql-service文件

[root@tele-1 ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm

 

   2.安装mysql

[root@tele-1 ~]# yum install mysql-community-server

 

   3.装置收尾之后运营mysql服务

[root@tele-1 ~]# service mysqld restart

 

  4.
开首安装的mysql是向来不密码的,用户名暗中认同是root。所以大家必要修改密码,用mysql命令行举行修改

 1.进入mysql命令行

[root@tele-1 ~]# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 474801
Server version: 5.6.36 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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> 

2.使用命令进行密码修改

mysql> set password for 'root'@'localhost' = password('你要修改的密码');
Query OK, 0 rows affected (0.06 sec)

 

  5.因为博主是用当地navicat软件来连接linux下的mysql的,所以如若要在地点访问的话,就须求改一下mysql数据库中的user表了

1.操作mysql数据库表

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> 


2.查看user表中的数据(在mysql命令行中可以直接进行sql语句编写)

mysql> select * from user;
+-----------+------+-----------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+------------------+
| Host      | User | Password                                  | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin                | authentication_string | password_expired |
+-----------+------+-----------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+------------------+
| %         | root | *3ce8dad2446975d8b0c771bd7e48d15b | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password |                       | N                |
| localhost | root | *3ce8dad2446975d8b0c771bd7e48d15b | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password |                       | N                |
| 127.0.0.1 | root | *3ce8dad2446975d8b0c771bd7e48d15b | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password |                       | N                |
| ::1       | root | *3ce8dad2446975d8b0c771bd7e48d15b | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password |                       | N                |
| tele-1    |      |                                           | N           | N           | N           | N           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            | N                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password | NULL                  | N                |
+-----------+------+-----------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+------------------+
5 rows in set (0.00 sec)

mysql> 

 

  3.博主的表中是修改之后的表了,想要远程访问,就须要下边金棕标注的多少了,Host指的是足以访问此数据库的ip地址,%代表的是富有的请求都足以连接进来。

世家能够修改一条数据,也可以添加一条数据。但是最好不用改动上面浅绿标注的多寡,修改语句就是上面的格式

mysql> update user set Host = '%' where ???

 

  4.说到底推出exit大概\q都以退出mysql命令行的艺术

mysql> \q
Bye

 

 

 

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注