锦州市广厦电脑维修|上门维修电脑|上门做系统|0416-3905144热诚服务,锦州广厦维修电脑,公司IT外包服务
topFlag1 设为首页
topFlag3 收藏本站
 
maojin003 首 页 公司介绍 服务项目 服务报价 维修流程 IT外包服务 服务器维护 技术文章 常见故障
锦州市广厦电脑维修|上门维修电脑|上门做系统|0416-3905144热诚服务技术文章
RHEL4.X下源码搭建LAMP服务器

作者: 佚名  日期:2010-07-17 03:46:19   来源: 本站整理

首先,系统为干净的系统 未安装apache mysql php等程序

(1).安装gd库

tar zxvf gd-2.0.35.tar.gz

cd gd-2.0.35

./configure --prefix=/web/gd

必须显示png jpeg freetype 状态为yes 说明编译正确,否则需要查找问题

make

make install


(2).apache

./configure --prefix=/web/apache --with-ssl --enable-ssl --enable-so --enable-rewrite --disable-cgid --disable-cgi

将apache设置成开机自启动的两种方法:
 
a.在/etc/rc.d/rc.local文件中加入一行
/usr/local/apache2/bin/apachectl start
这样每次重启以后apache也会随系统一起启动

b.或者将apache安装为系统服务
#cp /web/apache/bin/apachectl /etc/rc.d/init.d/httpd
然后vi /etc/rc.d/init.d/httpd添加(#!/bin/sh下面)
#chkconfig:2345 10 90
#description:Activates/Deactivates Apache Web Server
最后,运行chkconfig把Apache 添加到系统的启动服务组里面
#chkconfig --add httpd
#chkconfig httpd on


(3).mysql5

./configure --prefix=/web/mysql --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=mysql --without-debug --with-socket-path=/myweb/mysql/var/mysql.sock --with-big-tables --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-innodb --without-ndb-debug --without-isam --enable-local-infile --with-readline --with-raid

make

make install

groupadd mysql

useradd -g mysql mysql

cd /web/mysql

chown -R mysql .  //修改用户

chgrp -R mysql .  //修改用户组

bin/mysql_install_db --user=mysql //安装基本库

chown -R root .

chown -R mysql var

cp share/mysql/my-medium.cnf /etc/my.cnf

cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld

chmod 755 /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

chkconfig --level 3 mysqld on

/etc/rc.d/init.d/mysqld start

bin/mysqladmin -u root password 123456

http://www.yyblog.com.cn/post/76.html


(4).安装php5

./configure --prefix=/web/php --with-apxs2=/web/apache/bin/apxs --with-zlib-dir --with-bz2 --with-libxml-dir --with-gd=/web/gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-ttf --enable-mbstring --with-mysql=/web/mysql --with-config-file-path=/etc --with-iconv --disable-ipv6 --enable-static --enable-zend-multibyte --enable-inline-optimization --enable-zend-multibyte --enable-sockets --enable-soap --with-openssl --with-gettext --enable-ftp

make

make install

cp php.ini-recommended /etc/php.ini








(5).整合apache与php
#vi /web/apache/conf/httpd.conf
找到DocumentRoot "/web/websit"
<Directory"/web/website">
把它变成自己的服务目录

找到AddType application/x-gzip .gz .tgz在其下面加如下内容
AddType application/x-httpd-php .php

查找(设置WEB默认文件)
Directorylndex index.html
修改为
Directorylindex index.php index.html index.htm

找到这一段
#AllowOverride controls what directives may be placed in.htaccess files.
#Options Fileinfo AuthConfig Limit
#
AllowOverride none
更改为AllowOwerride all
允许appache rewrite

保存httpd.conf 退出


(6).zend安装
tar zxvf zend.tar.gz

cd zend

./install.sh

修改安装目录

指定php.ini的地址

指定apache 的apachectl的目录

重启apache显示安装成功

zend的作用主要是使php运行更加安全,无法提高php的速度更高。eaccelerator可以使效率更高


(7).eaccelerator-0.9.5.2.tar.bz2的安装

tar jxvf eaccelerator-0.9.5.2.tar.bz2

cd eaccelerator-0.9.5.2

export PHP_PREFIX="/web/php"  //加载php的安装目录

$PHP_PREFIX/bin/phpize        //显示php,zend的版本

./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config

make

make install

编译安装后我们会看到屏幕提示的eaccelerator.so所在的目录,php5.2X系列是在
/web/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so

/web/php/lib/php/extensions/no-debug-non-zts-20060613/

安装完毕,配置

在zend的安装目录下,打开php.ini
在文件最后,[zend]的下一行加入如下的代码
zend_extension="/web/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

然后
#mkdir /tmp/eaccelerator   //创建目录
#chmod 777 /tmp/eaccelerator //修改目录权限

注意:以上配置默认情况下,iptables已经开放80端口,selinux为允许模式,如果为强制模式,而网站代码不在apache中默认的位置,则需要设置web路径的上下文设置即用到chcon 命令
 



热门文章
  • 机械革命S1 PRO-02 开机不显示 黑...
  • 联想ThinkPad NM-C641上电掉电点不...
  • 三星一体激光打印机SCX-4521F维修...
  • 通过串口命令查看EMMC擦写次数和判...
  • IIS 8 开启 GZIP压缩来减少网络请求...
  • 索尼kd-49x7500e背光一半暗且闪烁 ...
  • 楼宇对讲门禁读卡异常维修,读卡芯...
  • 新款海信电视机始终停留在开机界面...
  • 常见打印机清零步骤
  • 安装驱动时提示不包含数字签名的解...
  • 共享打印机需要密码的解决方法
  • 图解Windows 7系统快速共享打印机的...
  • 锦州广厦电脑上门维修

    报修电话:13840665804  QQ:174984393 (联系人:毛先生)   
    E-Mail:174984393@qq.com
    维修中心地址:锦州广厦电脑城
    ICP备案/许可证号:辽ICP备2023002984号-1
    上门服务区域: 辽宁锦州市区
    主要业务: 修电脑,电脑修理,电脑维护,上门维修电脑,黑屏蓝屏死机故障排除,无线上网设置,IT服务外包,局域网组建,ADSL共享上网,路由器设置,数据恢复,密码破解,光盘刻录制作等服务

    技术支持:微软等