安装lamp详细版本

@font-face { font-family: "宋体"; }@font-face { font-family: "Verdana"; }p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 0.0001pt; text-align: justify; font-size: 10.5pt; font-family: "Times New Roman"; }a:link, span.MsoHyperlink { color: rgb(2, 122, 198); text-decoration: none; }a:visited, span.MsoHyperlinkFollowed { color: purple; text-decoration: underline; }p { margin: 7.2pt 0cm 14.4pt; font-size: 12pt; font-family: 宋体; }div.Section1 { page: Section1; }

1 、安装 mysql
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> tar zxvf mysql.tar.gz
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-extra-charsets=all --with-big-tables --with-charset=utf8 --with-collation=utf8_unicode_ci
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql (
初始化数据库 )
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql & (
启动服务器 )
shell> mysqladmin -u root -p password '1234' (
修改 root 用户密码 )
shell> cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
shell> chmod 700 /etc/rc.d/init.d/mysqld
shell> chkconfig --add mysqld (
以上三行作为 mysql 自动启动来用 )

 

env 查看环境变量

cp /usr/local/mysql/bin/mysql /usr/bin

chkconfig –del httpd 删除系统中的apache 服务;

2 、安装 apache
解压 httpd-2.0.59.tar.gz
# tar -zvxf httpd-2.0.59.tar.gz
进入 httpd-2.0.59 目录
# cd httpd-2.0.59
生成 /usr/local/apache2 目录
# mkdir -p /usr/local/apache2
配置安装目录
# ./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-rewrite
编译
# make
安装
# make install
安装完毕
#/usr/local/apache2/bin/apachectl -k start
启动测试

  直接访问服务器http://localhost/,可以看到 It WORKS!

apahce 系统启动时自动启动
/usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd 建立一个符号连接:
# ln -s /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

然后在此文件总添加以下几行(大概在文件顶部,约第二行的地方):

# chkconfig: 2345 30 100
# description: Activates/Deactivates Apache Web Server

最后,运行 chkconfig Apache 添加到系统的启动服务组里面:

# /sbin/chkconfig --del httpd
# /sbin/chkconfig --add httpd

另外一种方法系统启动时加载 apache
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
cd /etc/rc.d/rc3.d
ln -s ../init.d/httpd S80httpd

3 、第三方库

安装 libxml2
tar -zxvf libxml2-2.6.19.tar.gz
cd libxml2-2.6.19
./configure --prefix=/usr/local/libxml2
make
make install
这一步结束时, libxml2 被安装在 /usr/local/ 下。

安装 zlib
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3

如果是64 位系统 则 CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/zlib/
./configure --prefix=/usr/local/zlib
make
make install
这一步结束时, zlib 被安装在 /usr/local/ 下。

安装 libpng
tar -zxvf libpng-1.2.10.tar.gz
cd libpng-1.2.10
cp scripts/makefile.linux makefile
make
make install
注意:这里的 makefile 不是用 ./configure 生成的 , 而是直接从 script/ 目录里拷一个
这一步结束时, zlib 被安装在 /usr/local/lib

安装  freetype
tar -zxvf freetype-2.2.1.tar.gz
cd freetype-2.2.1
./configure --prefix=/usr/local/freetype
make
make install
这一步结束时, freetype 被安装在 /usr/local/lib

安装 jpeg6
建立目录
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/include
mkdir /usr/local/jpeg6/man
mkdir /usr/local/jpeg6/man/man1
tar -zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make
make install
注意:这里 ./configure 一定要带 --enable-shared 参数,不然,不会生成共享库

安装  gd
tar -zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --prefix=/usr/local/gd --with-png=/usr/local/lib --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg6
make && make install

4 、安装 PHP

tar -zxvf php5.tar.gz

cd php5
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/etc --with-libxml-dir=/usr/local/libxml2 --with-zlib-dir=/usr/local/zlib --with-gd=/usr/local/gd --with-jpeg-dir=/usr/local/jpeg6 --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/freetype --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-openssl --enable-gd-native-ttf --enable-mbstring --enable-ftp --enable-bcmath --enable-sockets --enable-zip --enable-soap --enable-calendar
make
make install
cp php.ini-dist /etc/php.ini

5 、整合 apache2 php5
apache
配置文件及目录是:
/usr/local/apache2/conf/httpd.conf
apache
默认存放主页的位置是:
/usr/local/apache2/htdocs
以下是配置文件里面的信息:(有的地方要做修改)
ServerRoot "/usr/local/apache2"
这是指定 apache 程序所在的目录,比如日志文件、配置文件等目录。
DocumentRoot "/usr/local/apache2/htdocs"
这个是存放网页的目录

这一句应该和 DocumentRoot 的目录保持一致。
找到  DirectoryIndex index.html
改为  DirectoryIndex index.html index.html.var index.htm index.php
找到  AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php ( 注意空格 )
AddType application/x-httpd-php-source .phps
添加 AddDefaultCharset utf8 使 apache 默认支持 utf8 字符集
保存配置文件就重启 apache 的守护进程。
/usr/local/apache2/bin/apachectl restart

注意: 
每次更改配置文件。要重启服务。
对存放网页的目录执行:命令 chmod 755 目录名 或者  chmod -R 755 目录名

编辑 php.ini 文件,找到
;default_charset="iso-8859-1"
增加一行: default_charset="utf8"

以上步骤都执行完后。在 /usr/local/apache2/htdocs/ 里编辑文件进行测试。
phpinfo.php
里面的内容:
phpinfo();
?>
在浏览器地址栏中输入:
http://localhost/phpinfo.php
出现 php 说明页面说明安装成功。

 

 

Yum install subversion

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值