文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>CentOS5.4安装LAMP

CentOS5.4安装LAMP

时间:2010-09-13  来源:yrsjy

CentOS5.4源码包安装LAMP环境

一、安装gcc环境

#yum install gcc  gcc-c++  glibc  glibc-devel  gd  gd-devel  zlib  zlib-devel  libtool-ltdl-devel flex  autoconf  automake

二、

安装mysql数据库

#tar zxvf ncurses-5.6.tar.gz

#cd ncurses-5.6

#./configure

#make&&make install

#cd ..

#tar  zxvf mysql-5.1.38.tar.gz

#cd myssql-5.1.38

# useradd -g mysql -s /bin/false -M mysql

#useradd –g mysql mysql

#./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql  --with-mysqld-user=mysql --enable-static  --with-charset=gbk  --with-extra-charset=all --with-low-memory --sysconfdir=/etc --enable-thread-safe-client   --enable-local-infile

#make&&make install

#cd /usr/local/mysql/bin/

#chown mysql -R  /usr/local/mysql/

#chown root:mysql -R  /usr/local/mysql/

#chgrp -R  mysql   /usr/local/mysql/

#./mysql_install_db  --user=mysql

#./mysqld_safe  --user=mysql &

#cd /usr/local/mysql/

#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

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

#/etc/rc.d/init.d/mysqld  restart

#bin/mysqladmin  -u root password webcc

#bin/mysql -u root –p

# bin/mysql -u root –p

配置库文件搜索路径

# echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf

#ldconfig

# ldconfig –v

添加/usr/local/mysql/bin到环境变量PATH中

# export PATH=$PATH:/usr/local/mysql/bin

三、         安装Apache

cd /usr/src/

#tar xvjf httpd-2.2.10.tar.bz

#cd httpd-2.2.10

#./configure --prefix=/usr/local/apache2 --with-mysql=/usr/local/mysql --enable-so --enable-rewrite --enable-track-vars --with-zlib --enable-mods-shared=all --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/var/www/

#make&&make install

# vi /usr/local/apache2/conf/httpd.conf

1、添加如下二行

  AddType application/x-httpd-php .php

  AddType application/x-httpd-php-source .phps

2、定位至DirectoryIndex index.html

  修改为:

   DirectoryIndex  index.php index.html

3、按照使用习惯,这里将网站根目录指定到/var/www:

找到DocumentRoot “/usr/local/apache/htdocs”

修改为:DocumentRoot “/var/www”(后文中我们还会注释掉此行,以启用虚拟主机)

找到<Directory “/usr/local/apache/htdocs”>

修改为:<Directory “/var/www”>

找到<#ServerName

相关阅读 更多 +
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载