CentOS源码安装Apache+PHP+MySQL

Linux公社

 

 

首页服务器应用

背景:

阅读新闻

CentOS源码安装Apache+PHP+MySQL

[日期:2011-09-05]   来源:Linux社区  作者:guoyin0612   [字体:]  

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-develcp /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="" target=_blank>mysql</A></SPAN>=/usr/local/<SPAN class=wp_keywordlink><A title=MYSQL href="" 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/etcmake
make installcp /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 6.0下搭建LAMP环境(源码安装)

CentOS源码安装Apache 2.2.17

相关资讯       CentOS  CentOS安装 

   

本文评论   查看全部评论 (0)


评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

 

 

 

最新资讯

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://127.0.0.1/wyygpp.html