博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
httpd 的坑
阅读量:6930 次
发布时间:2019-06-27

本文共 2491 字,大约阅读时间需要 8 分钟。

Httpd服务器的坑

  1. 在/etc/httpd/conf/httpd.conf中的配置信息, 有时注释到的内容仍然会生效
  2. 配置Auth时, 允许htpasswd规定的文件中的所有的用户, Require valid-uesr, 允许特定的用户Require user user1 user2 user3 ...
  3. 允许组, Require group group1 group2

在CentOS6中安装httpd2.4

1. 前提条件:

- Development tools
- Server Platform tools
- apr-1.5+
- apr-util-1.5+
- httpd-2.4
- expat-devel
- openssl-devel
- prec-devel
- httpd2.2(需要其httpd2.2的服务配置, 提供httpd2.4服务配置模板)

2. 操作:

1. 解压apr之后, .configure --prefix=/usr/local/apr; make && make install    2. 解压apr-util之后, .configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr; make && make install    3. 解压httpd2.4,         ./configure --prefix=/usr/local/httpd24 --sysconfdir=/etc/httpd24 --enable-so  --enable-ssl --enable-cgi  --enable-rewrite  --with-zlib  --with-pcre=/usr/local/pcre  --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util  --enable-modules=most  --enable-mpms-shared=all --with-mpm=event        4. 复制脚本, cp /etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd24
**注意**:单纯的复制服务脚本是不行的, 我们还要根据具体的情况进行修改 5. 添加服务脚本, chkconfig --add httpd24 6. 启动httpd, service httpd start 7. 导出man, 库文件(.so), 头文件, 系统的环境变量 8. 查看/var/run/httpd/httpd.pid的内容, 启动httpd服务会以该文件中定义的pid进行运行 9. 加载相应的模块 proxy_module和fcgi有关的 10. 关闭正向代理

CentOS6上编译安装php(先安装apr, apr-util, httpd, mariab, zlib2-devel, libmcrypt-devel, libxml2-devel, httpd-devel)

1. 解压php包2. 命令参数

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts

3. make && make install
4. 此时会在/etc/httpd24/httpd.conf中多出LoadModule php的信息
5. 为了能让httpd解析php文件, 在配置文件中添加
AddType application/x-httpd-php .php
AddType application/x-httpd-ph-source .phps
Directory Index index.php index.html
6. 我们编译安装的httpd的docroot是在/usr/localhttpd24/htdoc中, 在这里index.php进行测试即可
7. 为了加开运行, 编译安装xcache
解压
进入到解压目录
/usr/local/php/bin/phpize: 用于生成configure文件
./configure --enable-xcache --enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/local/php/bin/php-config
make && make install
创建/etc/php.d文件夹,将xcache.ini配置文件复制到此文件,以便php读取加载。
8. 这里使用的php安装时编译在httpd中(成为httpd的一个模块的, 所以配置时 需要指明httpd的相关位置), 而安装采用fpm则不需要, 但是因为php与mysql有关, 所以还是需要mysql的位置的配置信息

转载地址:http://rhmjl.baihongyu.com/

你可能感兴趣的文章
Thymeleaf教程 (七) 条件表达式用法
查看>>
Tcp的三次握手四次挥手
查看>>
flink1.3.3 on hdp 2.6(hadoop 2.7.3)部署指南
查看>>
LoadRunner监控Linux资源监控
查看>>
我的友情链接
查看>>
linux删除大文件后空间没释放的问题
查看>>
google打不开?更改一下chrome设置,畅通无阻玩谷歌
查看>>
RedHat 5.4 Squid配置本地代理服务器
查看>>
Poco官方PPT_030-MemoryManagement双语对照翻译
查看>>
ExpandableListView可展开列表
查看>>
升级moss sp1后User Profile Service Application 报错问题解决
查看>>
PHP新手上路
查看>>
常量指针和指针常量
查看>>
IT人员看待和预防×××十大建议
查看>>
linksys rv042配置client to gateway ***
查看>>
[李景山php]每天TP5-20170118|thinkphp5-Paginator.php
查看>>
使用PHP+Swoole实现的网页即时聊天工具
查看>>
KISS 原则 [ 设计原则 ]
查看>>
Java执行命令行命令的工具类RuntimeUtil
查看>>
webpy session debug 模式下无法使用
查看>>