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<br>
    **注意**:单纯的复制服务脚本是不行的, 我们还要根据具体的情况进行修改
    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的位置的配置信息

最新文章

  1. BZOJ 1911: [Apio2010]特别行动队 [斜率优化DP]
  2. laravel administrator 一款通用的后台插件(PHP框架扩展)
  3. 从库查看状态的时候显示“ Last_Error”
  4. 对接微信红包时:CA证书出错,请登录微信支付商户平台下载证书
  5. python 中time模块使用
  6. [学习Vulkan之一] 初识Vulkan
  7. Android学习之 Intent详解
  8. 那些年独自踩过的flascc的坑
  9. 学一点Git--20分钟git快速上手 [Neil]
  10. how to make choices about girls?
  11. [LeetCode 109] - 将已排序链表转换为二叉搜索树 (Convert Sorted List to Binary Search Tree)
  12. XmlDocument,XDocument相互转换
  13. js 切换全屏
  14. scrapy_图片下载
  15. U盘安装Mac OS X要点
  16. 网络编程-线程-3、通过继承Thread类创建线程
  17. SQL优化之踩过的坑【一】
  18. Azure IoT 技术研究系列2-设备注册到Azure IoT Hub
  19. Linux(CentOS)下的apache服务器配置与管理
  20. js json转url参数

热门文章

  1. 不应该使用Connected属性作为Socket是否连接上的依据
  2. 判断某元素是否在Array中
  3. js 操作html dom
  4. ubuntu - 14.04,安装Eclipse(开源开发工具)
  5. php 过滤掉多维数组空值
  6. Linux根目录结构
  7. 牛客寒假算法基础集训营4 I Applese 的回文串
  8. django终端打印Sql语句
  9. 如何将微信上传AMR格式语音转化为MP3格式
  10. oracle中所有表的字段和注释