日期:2011-09-07 13:39:00  来源:本站整理

CentOS源码安装Apache+PHP+MySQL[服务器安全]

赞助商链接



  本文“CentOS源码安装Apache+PHP+MySQL[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

CentOS源码安装Apache2.2.17

#安装需求的库
yum -y install zlib-devel

cp /home/root/httpd-2.2.17.tar.gz /usr/local/src
cd /usr/local/src
tar xzvf httpd-2.2.17.tar.gz

./configure --prefix=/usr/local/apache2 --enable-so --enable-threads --with-mpm=worker --enable-cache --enable-rewrite=shared -enable-deflate=shared --enable-expires=shared

make
make install
#启动apache
/usr/local/apache2/bin/apachectl start
#若呈现notice如httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
vi /usr/local/apache2/conf/httpd.conf
改正ServerName那行为:ServerName localhost:80
/usr/local/apache2/bin/apachectl restart
 
#安装PHP

#先安装需求的库
yum -y install libxml2
yum -y install libxml2-devel
yum -y install gd
yum -y install gd-devel
yum -y install curl curl-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel
yum -y install freetype freetype-devel
yum -y install openldap
yum -y install openldap-devel
cp /home/root/php-5.2.17.tar.gz /usr/local/src
cd /usr/local/src
tar xzvf php-5.2.17.tar.gz
./configure --prefix=/usr/local/php5 \
--with-<SPAN class=wp_keywordlink><A title=MYSQL href="http://www.satsuns.com/category/mysql" target=_blank>mysql</A></SPAN>=/usr/local/<SPAN class=wp_keywordlink><A title=MYSQL href="http://www.satsuns.com/category/mysql" target=_blank>mysql</A></SPAN> \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-libxml-dir=/usr/local/lib \
--with-gd \
--with-jpeg-dir=/usr/local/jpeg6 \
--with-zlib \
--with-curl \
--with-ldap \
--with-gettext \
--with-iconv \
--enable-mbstring \
--enable-soap \
--with-png-dir=/usr/local/libpng2 \
--with-freetype-dir=/usr/local/freetype \
--with-xmlrpc \
--with-config-file-path=/usr/local/php5/etc
make
make install
cp /usr/local/src/php.ini-dist /usr/local/php5/etc/php.ini
 
配置
 
vi /usr/local/apache2/conf/httpd.conf
#DirectoryIndex index.html后增添index.php
DirectoryIndex index.html index.php
#<IfModule mime_module>中增添:
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
/usr/local/apache2/bin/apachectl restart
#若碰到错误如:/usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
#办理办法:
setenforce 0
chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /usr/local/apache2/modules/libphp5.so
/usr/local/apache2/bin/apachectl restart
setenforce 1
/usr/local/apache2/bin/apachectl restart   以上是“CentOS源码安装Apache+PHP+MySQL[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:

  • Windows 2008R2 HyperV下安装CentOS6,网卡无痛设置
  • CentOS 6.x 利用安装光盘作为yum源
  • CentOS 下 Nginx + Keepalived 配置高可用Web站点
  • CentOS 5.8布置web缓存服务器(squid+memcached)
  • centos6.2改正yum的源为安装光盘
  • CentOS6 yum搭建Linux+Nginx+PHP+MYSQL(LNMP)
  • CentOS 6.2 安装Nginx并设置为开机服务
  • CentOS 6.2布置DNS
  • CentOS6.2利用yum安装LAMP及phpMyadmin
  • CentOS下配置PHP+phpMyAdmin
  • centos下mysql主从同步快速设置步骤分享
  • 在Windows主机上按时备份远程VPS(CentOS)数据的批处理
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .