30选5玩法|福彩30选5开奖结果321|
 

CentOS5.2配置LAMP全过程(第二版)

No Comments Linux

这个文档是参考版主的文章,学习了2个多月总结出来的啊,请大家多多指教
参考文档
参考了网上不少文档,下面的3篇是重点,不少代码都是从下面复制过来的。
RHEL4上安装基于postfix的全功能邮件服务器(全部使用目前最新源码包构建) (http://blog.s135.com/read.php/366.htm
基于CentOS构建高性能的LAMP?#25945;?(------中间广告---------

复制代码

编辑httpd.conf

  1. sed -i -e ‘121 s/^/#/’ -i -e ‘122 s/^/#/’ /usr/local/apache2/conf/httpd.conf
  2. sed -i -e "s/User daemon/User www/" -i -e "s/Group daemon/Group www/" /usr/local/apache2/conf/httpd.conf
  3. sed -i ‘s/DirectoryIndex index.html/ DirectoryIndex index.php index.html index.htm/g’ /usr/local/apache2/conf/httpd.conf
  4. sed -i -e ‘101 s/^#//g’ -i -e ‘374 s/^#//g’ -i -e ‘389 s/^#//g’ -i -e ‘392 s/^#//g’ -i -e ‘401 s/^#//g’ /usr/local/apache2/conf/httpd.conf
  5. sed -i "58 s/^/AddType application\/x-httpd-php .php/" /usr/local/apache2/conf/httpd.conf

复制代码

编辑php.ini

  1. cp /usr/local/php/etc/php.ini /usr/local/php/etc/php.ini.save
  2. sed -i ‘205 s#;open_basedir =#open_basedir = /data/www/wwwroot:/tmp#g’ /usr/local/php/etc/php.ini
  3. sed -i ‘/expose_php/s/On/Off/’ /usr/local/php/etc/php.ini
  4. sed -i ‘/display_errors/s/On/Off/’ /usr/local/php/etc/php.ini

复制代码

 

 

配置虚拟主机
备份相关配置文件

  1. mv /usr/local/apache2/conf/extra/httpd-vhosts.conf /usr/local/apache2/conf/extra/httpd-vhosts.conf.save
  2. mv /usr/local/apache2/conf/extra/httpd-default.conf /usr/local/apache2/conf/extra/httpd-default.conf.save
  3. mv /usr/local/apache2/conf/extra/httpd-mpm.conf /usr/local/apache2/conf/extra/httpd-mpm.conf.save

复制代码

创建3个apache相关的文件

  1. vi /usr/local/apache2/conf/extra/httpd-vhosts.conf

复制代码

  1. NameVirtualHost *:80
  2. <VirtualHost *:80>
  3.     ServerAdmin [email protected]
  4.     DocumentRoot "/data/www/wwwroot/test.com"
  5.     ServerName test.com
  6.     ServerAlias bbs.test.com
  7.     ErrorLog "logs/test.com-error_log"
  8.     CustomLog "|/usr/local/cronolog/sbin/cronolog /data/logs/access_www.test.com.%Y%m%d" combined
  9. </VirtualHost>
  10. <VirtualHost *:80>
  11.     ServerAdmin [email protected]
  12.     DocumentRoot "/data/www/wwwroot/linux.com"
  13.     ServerName linux.com
  14.     ServerAlias bbs.linux.com
  15.     ErrorLog "logs/linux.com-error_log"
  16.     CustomLog "|/usr/local/cronolog/sbin/cronolog /data/logs/access_www.linux.com.%Y%m%d" combined
  17. </VirtualHost>

复制代码

  1. vi /usr/local/apache2/conf/extra/httpd-default.conf

复制代码

  1. Timeout 15
  2. KeepAlive Off
  3. MaxKeepAliveRequests 50
  4. KeepAliveTimeout 5
  5. UseCanonicalName Off
  6. AccessFileName .htaccess
  7. ServerTokens Prod
  8. ServerSignature Off
  9. HostnameLookups Off

复制代码

  1. vi /usr/local/apache2/conf/extra/httpd-mpm.conf

复制代码

  1. <IfModule mpm_prefork_module>
  2.     ServerLimit         2000
  3.     StartServers          10
  4.     MinSpareServers       10
  5.     MaxSpareServers      15
  6.     MaxClients          2000
  7.     MaxRequestsPerChild   10000
  8. </IfModule>

复制代码

 

七:测试
修改本地hosts文件
192.168.1.200   
www.test.com
启动Apache

  1. service httpd start

复制代码

测试php

  1. cd /data/www/wwwroot/test.com
  2. vi info.php

复制代码

  1. <?
  2. phpinfo()
  3. ?>

复制代码

这个时候 http://192.168.1.200/info.php 或者 http://www.test.com/info.php 就可以看到php的信息。
安装phpadmin

  1. cd /usr/local/src
  2. tar zxvf phpMyAdmin-2.11.8.1-all-languages-utf-8-only.tar.gz
  3. cp -rf phpMyAdmin-2.11.8.1-all-languages-utf-8-only /data/www/wwwroot/test.com/phpmyadmin
  4. cd /data/www/wwwroot/test.com/phpmyadmin
  5. cp config.sample.inc.php config.inc.php
  6. sed -i -e "/^\$cfg\[‘blowfish_secret’\]/{ [email protected]”;@’88888888888888888’;@; }" config.inc.php

复制代码

这个时候,你就可以通过 http://192.168.1.200/phpmyadmin 或者http://www.test.com/phpmyadmin 来进行数据库管理, 我上面已经给mysql设置的密码。
user:root
password:chenshake
安装sugarcrm
sugarcrm的邮件模块需要用到imap,ssl,所以我编译的时候,需要吧imap,curl模块编译进去.

  1. cd /usr/local/src
  2. unzip SugarCE-5.1.0.zip
  3. mv SugarCE-Full-5.1.0/ /data/www/wwwroot/test.com/sugarcrm
  4. chmod -R 777 /data/www/wwwroot/test.com/sugarcrm/

复制代码

发表评论

30选5玩法