centos6.6 x86下搭建lamap web平台
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos6.6 x86下搭建lamap web平台相关的知识,希望对你有一定的参考价值。
lamp搭建准备条件
安装gcc gcc-c++
yum -y install gcc .....
关闭selinux iptables
iptables -F
vi /etc/sysconfig/selinux
参数改为disable
利用rpm 查询并且删除
rpm -qa 查询
RPM -e删除
在linux 创建lamp文件夹
利用winscp上传所需要的源码包
安装环境centos6.6 64位
开始安装:
第一步:将所有的源代码包全部解压
1.
./configure --prefix=/usr/local/libxml2
make
make install
2.
./configure --prefix=/usr/local/libmcrypt
make
make install
3.
./configure --prefix=/usr/local/zlib
make
make install
4.
./configure --prefix=/usr/local/libpng
make
make install
安装编译libpng报错
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata‘ can not be used when making a shared object; recompile with -fPIC
collect2: ld returned 1 exit status
make[1]: *** [libpng12.la] Error 1
make[1]: Leaving directory `/lamp/libpng-1.2.31‘
make: *** [all] Error 2
原因与电脑是64位有关
解决办法
在编译前面加上 如下
CFLAGS="-O3 -fPIC" ./configure
5.jpeg
mkdir /usr/local/jpeg6 //建立jpeg6软件安装目录
mkdir /usr/local/jpeg6/bin //建立存放命令的目录
mkdir /usr/local/jpeg6/lib //创建jpeg6库文件所在目录
mkdir /usr/local/jpeg6/include //建立存放头文件目录
mkdir -p /usr/local/jpeg6/man/man1 //建立存放手册的目录
.6.freetype
./configure --prefix=/usr/local/freetype
make
make install
编译jpeg出现错误
执行make报错
./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c
make: ./libtool: Command not found
make: *** [jcapimin.lo] Error 127
原因:未安装Libtool 或者是版本太旧
可使用yum install -y libtool 安装
然后
cp /usr/share/libtool/config/config.sub .
cp /usr/share/libtool/config/config.guess .
注释: .代表安装包目录
然后重新编译安装
6.
./configure \
--prefix=/usr/local/jpeg6/ \
--enable-shared \ //建立共享库使用的GNU的libtool
--enable-static //建立静态库使用的GNU的libtool
7.autoconf
# ./configure
# make
# make install
8.gd2
#./configure
--prefix=/usr/local/gd2/
--with-zlib=/usr/local/zlib/
--with-jpeg=/usr/local/jpeg6/
--with-png=/usr/local/libpng/
--with-freetype=/usr/local/freetype/
9.
]#./configure
> --prefix=/usr/local/apache2
> --sysconfdir=/etc/httpd
> --with-z=/usr/local/zlib/
> --with-included-apr
> --enable-so
> --enable-deflate=shared
> --enable-expires=shared
> --enable-rewrite=shared
> --enable-static-support
make
make install
/usr/local/apache2/bin/apachectl start/stop 启动或者关闭
echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.local 设置为开机启动
测试:在浏览器中输入192.168.137.2 如显示It works 则为安装成功
10.
在安装mysql之前必须先安装
ncurses-5.9 否侧安装mysql会报错
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
编译安装
groupadd mysql
grep mysql /etc/group
useradd -g mysql mysql
grep mysql /etc/passwd
./configure --prefix=/usr/local/mysql --with-extra-charsets=all
cp support-files/my-medium.cnf /etc/my.cnf
创建授权表
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
ps -le |grep mysqld
netstat -an |grep 3306
/usr/local/mysql/bin/mysqladmin version
/usr/local/mysql/bin/mysqladmin variables
/usr/local/mysql/bin/mysql -u root
SET PASSWORD FOR ‘root‘@‘localhost‘=PASSWORD(‘502610‘); 设置mysql密码
/usr/local/mysql/bin/mysql -u root -p 登录mysql
cp /lamp/mysql-5.0.41/support-files/mysql.server /etc/rc.d/init.d/mysqld 设置开机启动
chown root.root /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
安装php
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-png-dir=/usr/local/libpng/ --with-jpeg-dir=/usr/local/jpeg6/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd2/ --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
make &&make install
cp php.ini-dist /usr/local/php/etc/php.ini
配置Apache解析php
打开Apache配置文件
vi /etc/httpd/httpd.conf
使用vi编辑apache配置文件Addtype application/x-httpd-php .php .phtml #添加这一条
vi test.php
编写
<?php
echo phpinfo();
?>
在浏览器中测试
安装zend加速器
mkdir /usr/local/zend
cp /lamp/ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /usr/local/zend
在PHP配置文件中添加
vim /etc/local/php/etc/php.ini
在末尾加入
[Zend Optimizer]
zend_optimizer.optimization_level=15
zend_extension="/usr/zend/ZendOptimizer.so"
安装phpadmin
cp -a /lamp/phpMyAdmin-3.0.0-rc1-all-languages /usr/local/apache2/htdocs/phpmyadmin
cp config.sample.inc.php config.inc.php
在phpmyadmin中配置使用http验证方式
本文出自 “空程记的博客” 博客,请务必保留此出处http://sjwnote.blog.51cto.com/10587073/1741427
以上是关于centos6.6 x86下搭建lamap web平台的主要内容,如果未能解决你的问题,请参考以下文章