[计算机]LAMP环境配置方法 for CentOS 50

上传人:油条 文档编号:33859578 上传时间:2018-02-18 格式:DOC 页数:11 大小:41.50KB
返回 下载 相关 举报
[计算机]LAMP环境配置方法 for CentOS 50_第1页
第1页 / 共11页
[计算机]LAMP环境配置方法 for CentOS 50_第2页
第2页 / 共11页
[计算机]LAMP环境配置方法 for CentOS 50_第3页
第3页 / 共11页
[计算机]LAMP环境配置方法 for CentOS 50_第4页
第4页 / 共11页
[计算机]LAMP环境配置方法 for CentOS 50_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《[计算机]LAMP环境配置方法 for CentOS 50》由会员分享,可在线阅读,更多相关《[计算机]LAMP环境配置方法 for CentOS 50(11页珍藏版)》请在金锄头文库上搜索。

1、经过一天的时间终于搭建完成了,中间遇到了好多问题,比如编译 mysql 我用哪个方法死活编译不了,从网上找了个方法编译成功了就是这句./configure -prefix=/usr/local/mysql -localstatedir=/usr/local/mysql/data本文测试环境为 CentOS 5.0,如果使用 Red Hat AS3/4 则不能使用 yum 命令管理 rpm 包。一系统约定软件源代码包存放位置 /usr/local/src源码包编译安装位置(prefix) /usr/local/software_name脚本以及维护程序存放位置 /usr/local/sbinMy

2、SQL 数据库位置 /var/lib/mysqlApache 网站根目录 /home/www/wwwrootApache 虚拟主机日志根目录 /home/www/logsApache 运行帐户 www:www二系统环境部署及调整1检查系统是否正常# more /var/log/messages (检查有无系统级错误信息)# dmesg (检查硬件设备是否有错误信息) # ifconfig(检查网卡设置是否正确)# ping (检查网络是否正常)2关闭不需要的服务# ntsysv以下仅列出需要启动的服务,未列出的服务一律关闭:atdcrondirqbalancemicrocode_ctlnet

3、worksendmailsshdsyslog3重新启动系统# init 64配置 vim# vi /root/.bashrc在 alias mv=mv -i 下面添加一行:alias vi=vim 保存退出。# echo syntax on /root/.vimrc5使用 yum 程序安装所需软件包(以下为标准的 RPM 包名称)# yum install ntp vim-enhanced gcc gcc-c+ flex bison autoconf automake bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-de

4、vel freetype-devel pam-devel kernel6定时校正服务器时钟,定时与中国国家授时中心授时服务器同步# crontab -e加入一行:*/30 * * * * ntpdate 210.72.145.447源代码编译安装所需包(1) GD2# cd /usr/local/src# wget http:/www.libgd.org/releases/oldreleases/gd-2.0.34.tar.gz# tar xzvf gd-2.0.34.tar.gz# cd gd-2.0.34# ./configure -prefix=/usr/local/gd2# make#

5、 make install(2) LibXML2# cd /usr/local/src# wget ftp:/xmlsoft.org/libxml2/libxml2-2.6.29.tar.gz# tar xzvf libxml2-2.6.29.tar.gz# cd libxml2-2.6.29# ./configure -prefix=/usr/local/libxml2# make# make install(3) LibMcrypt# cd /usr/local/src#wget http:/ tar xjvf libmcrypt-2.5.8.tar.bz2# cd libmcrypt-2

6、.5.8# ./configure prefix=/usr/local/libmcrypt# make# make install(4) Apache 日志截断程序# cd /usr/local/src# wget http:/cronolog.org/download/cronolog-1.6.2.tar.gz# tar xzvf cronolog-1.6.2.tar.gz# cd cronolog-1.6.2# ./configure prefix=/usr/local/cronolog# make# make install8升级 OpenSSL 和 OpenSSH# cd /usr/l

7、ocal/src# wget http:/www.openssl.org/source/openssl-0.9.8e.tar.gz# wget http:/mirror.mcs.anl.gov/openssh/portable/openssh-4.6p1.tar.gz# tar xzvf openssl-0.9.8e.tar.gz# cd openssl-0.9.8e# ./config -prefix=/usr/local/openssl# make# make test# make install# cd .# tar xzvf openssh-4.6p1.tar.gz# cd opens

8、sh-4.6p1# ./configure -prefix=/usr -with-pam -with-zlib -sysconfdir=/etc/ssh -with-ssl-dir=/usr/local/openssl -with-md5-passwords# make# make install(1)禁用 SSH V1 协议找到:#Protocol 2,1改为:Protocol 2(2)禁止 root 直接登录此处先建立一个普通系统用户:# useradd username# passwd username找到:#PermitRootLogin yes改为:PermitRootLogin n

9、o(3)禁用服务器端 GSSAPI找到以下两行,并将它们注释:GSSAPIAuthentication yesGSSAPICleanupCredentials yes(4)禁用 DNS 名称解析找到:#UseDNS yeas改为:UseDNS no(5)禁用客户端 GSSAPI# vi /etc/ssh/ssh_config找到:GSSAPIAuthentication yes将这行注释掉。最后,确认修改正确后重新启动 SSH 服务# service sshd restart# ssh -v确认 OpenSSH 以及 OpenSSL 版本正确。三、编译安装 L.A.M.P 环境1. 下载软件

10、# cd /usr/local/src# wget http:/ wget http:/ wget http:/ http:/ 编译安装 MySQL# tar xzvf mysql-5.0.27.tar.gz# cd mysql-5.0.27# ./configure -prefix=/usr/local/mysql -localstatedir=/var/lib/mysql (注意:/var 分区是否适合?)-with-comment=Source -with-server-suffix=-Comsenz -with-mysqld-user=mysql -without-debug -wit

11、h-big-tables -with-charset= (此处设置 MySQL 默认字符集)-with-collation= (此处设置 MySQL 校正字符集)-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-isam -without-innodb -without-ndb-debug# make

12、# make install# useradd mysql# cd /usr/local/mysql # bin/mysql_install_db -user=mysql# chown -R root:mysql .# chown -R mysql /var/lib/mysql# cp share/mysql/my-f /etc/f# 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 my

13、sqld on# /etc/rc.d/init.d/mysqld start# bin/mysqladmin -u root password password_for_root3. 编译安装 Apache# cd /usr/local/src# tar xjvf httpd-2.2.4.tar.bz2# cd httpd-2.2.4# ./configure -prefix=/usr/local/apache2 -with-included-apr -enable-so -enable-deflate=shared -enable-expires=shared -enable-rewrite

14、=shared -enable-static-support -disable-userdir# make# make install# echo /usr/local/apache2/bin/apachectl start /etc/rc.local4. 编译安装 PHP# cd /usr/local/src# tar xjvf php-5.2.3.tar.bz2# cd php-5.2.3# ./configure -prefix=/usr/local/php -with-apxs2=/usr/local/apache2/bin/apxs -with-config-file-path=/usr/local/php/etc -with-mysql=/usr/local/mysql -with-libxml-dir=/usr/local/libxml2 -with-gd=/usr/local/gd2 -with-jpeg

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号