- ubuntu12.04环境下使用kvm ioctl接口实现最简单的虚拟机
- Ubuntu 通过无线网络安装Ubuntu Server启动系统后连接无线网络的方法
- 在Ubuntu上搭建网桥的方法
- ubuntu 虚拟机上网方式及相关配置详解
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.
这篇CFSDN的博客文章64位CentOS 6.0下搭建LAMP环境详细步骤由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.
1、确认搭建LAMP所需要的环境是否已经安装 。
[root@centos6 ~]# rpm -q make gcc gcc-c++zlib-devellibaio 。
备注:安装libpng时候需要zlib-devel 。
安装mysql时候需要libaio 。
2、如果没安装则yum安装 。
[root@centos6 ~]# yum install make gcc gcc-c++zlib-devel libaio -y 。
3、由于要使用编译安装,所以查看httpd、mysql、php是否安装,如果安装则卸载 。
[root@centos6 ~]# rpm -q httpd mysql php 。
4、编译安装libxml2 。
注:libxml2是一个xml的c语言版的解析器,不仅支持c语言,还支持c++、php、Pascal、Ruby、Tcl等语言的绑定 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf libxml2-2.7.8.tar.gz 。
[root@centos6 LAMP]# cd ./libxml2-2.7.8 。
[root@centos6 libxml2-2.7.8]# ./configure --prefix=/usr/local/libxml2/ 。
[root@centos6 libxml2-2.7.8]# make;make install 。
5、编译安装libmcrypt 。
注:libmcrypt是加密算法扩展库。支持DES, 3DES, RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUR, SERPENT, SAFER+等算法.
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf libmcrypt-2.5.8.tar.gz 。
[root@centos6 LAMP]# cd ./libmcrypt-2.5.8 。
[root@centos6 libmcrypt-2.5.8]# ./configure --prefix=/usr/local/libmcrypt/ 。
[root@centos6 libmcrypt-2.5.8]# make;make install 。
6、编译安装zlib 。
注:zlib是提供数据压缩用的函式库 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf zlib-1.2.5.tar.gz 。
[root@centos6 LAMP]# cd ./zlib-1.2.5 。
[root@centos6 zlib-1.2.5]# ./configure --prefix=/usr/local/zlib/ 。
[root@centos6 zlib-1.2.5]# make ; make install 。
7、编译安装libpng 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf libpng-1.5.4.tar.gz 。
[root@centos6 LAMP]# cd ./libpng-1.5.4 。
[root@centos6 libpng-1.5.4]# 。
./configure --prefix=/usr/local/libpng/ --enable-shared 。
[root@centos6 libpng-1.5.4]# make ; make install 。
8、编译安装jpeg 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf jpegsrc.v8c.tar.gz 。
[root@centos6 LAMP]# cd ./jpeg-8c/ 。
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/(创建jpeg软件的安装目录) 。
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/bin/(创建存放命令的目录) 。
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/lib/(创建jpeg库文件所在目录) 。
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/include/(创建存放头文件目录) 。
[root@centos6 jpeg-8c]# mkdir -p /usr/local/jpeg/man/man1(建立存放手册的目录) 。
[root@centos6 jpeg-8c]# 。
./configure --prefix=/usr/local/jpeg/ --enable-shared --enable-static(建立共享库使用的GNU的libtool和静态库使用的GNU的libtool) 。
[root@centos6 jpeg-8c]# make ; make install 。
9、编译安装freetype 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf freetype-2.4.6.tar.gz 。
[root@centos6 LAMP]# cd ./freetype-2.4.6 。
[root@centos6 freetype-2.4.6]# 。
./configure --prefix=/usr/local/freetype/ --enable-shared 。
[root@centos6 freetype-2.4.6]# make ;make install 。
10、编译安装autoconf 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf autoconf-2.68.tar.gz 。
[root@centos6 LAMP]# cd ./autoconf-2.68 。
[root@centos6 autoconf-2.68]# ./configure 。
[root@centos6 autoconf-2.68]# make ; make install 。
11、编译安装GD 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf gd-2.0.35.tar.gz 。
[root@centos6 LAMP]# cd ./gd-2.0.35 。
[root@centos6 gd-2.0.35]# 。
./configure --prefix=/usr/local/gd/ --with-zlib=/usr/local/zlib/ --with-jpeg=/usr/local/jpeg/ --with-png=/usr/local/libpng/ --with-freetype=/usr/local/freetype/ 。
[root@centos6 gd-2.0.35]# make ; make install 。
12、安装apache 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf httpd-2.2.19.tar.gz 。
[root@centos6 LAMP]# cd ./httpd-2.2.19 。
[root@centos6 httpd-2.2.19]# 。
./configure --prefix=/usr/local/apache/ --enable-so --enable-rewrite 。
[root@centos6 httpd-2.2.19]# make ; make install 。
[root@centos6 LAMP]# /usr/local/apache/bin/apachectl start 。
[root@centos6 LAMP]# 。
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd 。
[root@centos6 LAMP]# chmod +x /etc/init.d/httpd 。
[root@centos6 ~]# chkconfig --add httpd 。
注意:如果提示servicehttpddoes not support chkconfig错误 。
解决办法:编辑/etc/rc.d/init.d/httpd在文件第二行加入 。
#chkconfig:234510 90 。
#description:Activates/Deactivates Apache Web Server 。
[root@centos6 ~]# chkconfig --level 2345 httpd on 。
[root@centos6 LAMP]# service httpd restart 。
开机自动启动apache的另一种方法:
修改/etc/rc.local文件 。
# vim /etc/rc.local 。
在文件中添加/usr/local/apache/bin/apachectl start 。
13、编译安装mysql 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf mysql-5.5.15-linux2.6-x86_64.tar.gz 。
[root@centos6 LAMP]# cd ./mysql-5.5.15-linux2.6-x86_64 。
[root@centos6 mysql-5.5.15-linux2.6-x86_64]# groupadd mysql 。
[root@centos6 mysql-5.5.15-linux2.6-x86_64]# useradd -r -g mysql mysql(创建mysql用户,并将用户指定至mysql组) 。
[root@centos6 mysql-5.5.15-linux2.6-x86_64]# cd /usr/local/ 。
[root@centos6 local]# ln -s /tmp/LAMP/mysql-5.5.15-linux2.6-x86_64 mysql 。
[root@centos6 local]# cd ./mysql/ 。
[root@centos6 mysql]# chown -R mysql .(将该目录的用户权限全部更改为mysql用户) 。
[root@centos6 mysql]# chgrp -R mysql .(将该目录的用户组全部改为mysql用户组) 。
[root@centos6 mysql]# ./scripts/mysql_install_db --user=mysql(将mysql目录的数据库使用权限指定为mysql) 。
[root@centos6 mysql]# chown -R root . 。
[root@centos6 mysql]# chown -R mysql data 。
[root@centos6 mysql]# cp support-files/my-medium.cnf /etc/my.cnf(将当前目录下的配置文件拷贝到系统配置文件下,并更名为my.cnf) 。
[root@centos6 mysql]# cp support-files/mysql.server /etc/init.d/mysqld 。
[root@centos6 mysql]# chmod +x /etc/init.d/mysqld 。
[root@centos6 mysql]# chkconfig --add mysqld 。
[root@centos6 mysql]# chkconfig --level 345 mysqld on 。
[root@centos6 mysql]# servicemysqld restart 。
[root@centos6 mysql]# 。
/usr/local/mysql/bin/mysqladmin -u root password '123456'(设置root用户登录mysql的密码) 。
[root@centos6 mysql]# /usr/local/mysql/bin/mysql -u root –p(进入并访问mysql数据) 。
Enter password
Welcome to the MySQL monitor.Commands end with ; or g. 。
Your MySQL connection id is 2 。
Server version: 5.5.15-log MySQL Community Server (GPL) 。
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 。
Oracle is a registered trademark of Oracle Corporation and/or its 。
affiliates. Other names may be trademarks of their respective 。
owners. 。
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. 。
mysql>(成功登录mysql) 。
14、编译安装php 。
[root@centos6 LAMP]# pwd 。
/tmp/LAMP 。
[root@centos6 LAMP]# tar -zxvf php-5.3.7.tar.gz 。
[root@centos6 LAMP]# cd ./php-5.3.7 。
[root@centos6 php-5.3.7]# 。
./configure --prefix=/usr/local/php/ --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg/ --with-freetype-dir=/usr/local/freetype/--with-gd-dir=/usr/local/gd/--with-zlib-dir=/usr/local/zlib/--with-mcrypt=/usr/local/libmcrypt/--with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets 。
[root@centos6 php-5.3.7]# make ; make install 。
[root@centos6 php-5.3.7]# 。
cp php.ini-development /usr/local/php/lib/php.ini 。
#vim/usr/local/php/lib/php.ini 。
//这里需要将register_globals=Off更改on模式,还有时间格式改为本地 。
15、更改apache的配置文件,达到解析php文件的目的 。
[root@centos6 ~]# vim /usr/local/apache/conf/httpd.conf 。
AddType application/x-compress .Z 。
AddType application/x-gzip .gz .tgz 。
Addtype application/x-httpd-php .php .phtml 。
Addtype application/x-httpd-php-source .phps 。
添加上面绿色内容,表示apache服务中可以解析php格式文件 。
接下来要检查apache目录下生成的php动态连接库文件,在目录/usr/local/apache/modules,找到是否存在libphp5.so文件 。
16、验证 。
[root@centos6 ~]# vim /usr/local/apache/htdocs/index.php 。
添加内容为 。
<?php 。
echo phpinfo(),
?> 。
在客服端验证,出现下图说明php搭建成功 。
最后此篇关于64位CentOS 6.0下搭建LAMP环境详细步骤的文章就讲到这里了,如果你想了解更多关于64位CentOS 6.0下搭建LAMP环境详细步骤的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
LAMP 堆栈一词是什么意思? 我在招聘启事中看到过这个引用,但我不完全理解它的含义。 我觉得在我的开发中我相当普遍地使用 LAMP,但是当我听到“stack”时,我觉得我没有像我应该的那样使用 LA
完全在 WAMP 中开发,我需要将其部署在组织中的 LAMP 设置上。我想确保部署顺利进行并花费尽可能少的时间。在将其部署到 LAMP 之前,我需要更改哪些内容?还有什么方法可以在一些模拟的 LAMP
在变得有点疏远开源,并花了几年时间在 ASP.NET 中开发 Web 应用程序之后,我将开始做相当多的PHP/MySQL开发。 我已经很轻松地安装了WampServer在我的 Windows 机器上建
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 6年前关闭。 Improve this questi
我正在尝试遵循一些与AWS相关的亚马逊教程(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html)。这将允许我在我刚
我想在 Azure 服务器中设置 LAMP,可以使用以下方法设置 LAMP LAMP 包:sudo apt-get install lamp-server^ Apache、PHP、MySQL 单独安装
搭建LAMP Web服务器 在家中翻到了以前用的老电脑,在思索一番后,决定把这台电脑改造成一台Web服务器,作为我自己搭建博客的测试机器。 一、Linux服务器 LAMP中的L指的是Linux服
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 10年前关闭。 Improve this
请向我推荐一个基于Web的简单文档存储库,用于保存我的小公司文档(.DOC,.PDFs),以便我可以从任何地方访问它们。互联网上有很多可用的工具,但是它们很繁琐,并且充满了不必要的功能和要求。 我没有
我有一个个人项目已经在线一段时间了。我一直在通过这样做来记录下载量: 当用户点击下载链接时,它会点击一个 PHP 脚本,该脚本将一些信息写入表格。 写入数据后,脚本会返回实际文件的路径。 然后用户可以
我是 Ubuntu 的新手。安装灯。有几个问题 1)假设第一个网站目录看起来像:var/www/first/和第二个网站:var/www/second。如何设置多个网站,并将它们与 IIS 上的单独端
我的应用程序在 LAMP 服务器上运行时遇到了一些困难。我将解释该场景,下面我将介绍我的配置和一些 AB 结果。 我正在运行一个使用 Laravel 4.2 开发的应用程序。这是一个问答游戏,在某个时
情况: 我制作了一个可以打开和关闭灯的 Java 应用程序。现在我需要更改灯光,这必须发生在 class ColorLamp 中。正常的“黄”灯放在 class Lamp 中。 类 Colorlamp
嗨,最近我安装了 linux 并安装了 lamp + phpmyadmin,这个脚本在 xampp 上运行良好,而我使用了 win,但现在它不会执行,我已经更改了 dbconnect.php 文件中的
我在 Google 云上的 VM 实例上安装了 LAMP,但是当我尝试使用从 Linux 终端远程访问 mysql 数据库时 $ mysql -u username -h ipaddress -p 输
我在 EasyPHP 3.5.9 上开发了我的 php 软件,一切都很完美,现在我在 ubuntu 12.04 x64 上安装了 LAMP。如果我尝试在 ubuntu 上上传我的软件,我会显示一个白页
我最近(大约1个月)开始使用LAMP和Bootstrap。 我开发的网站在重新安装 LAMP 之前一直运行良好。 这是我的进展: 0. reinstalled LAMP 1. moved my "ba
我的项目驻留在一个共享的 Linux 托管服务器上。当然,托管服务提供商已经设置了相对于其他服务器用户的必要目录和文件所有权。我现在关心的是如何在我的域中设置权限,以便我的用户可以读取他们应该拥有的文
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 11 年前。 Improve thi
我是一名优秀的程序员,十分优秀!