Chinaunix首页 | 论坛 | 博客
  • 博客访问: 200538
  • 博文数量: 62
  • 博客积分: 725
  • 博客等级: 上士
  • 技术积分: 746
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-09 17:07
个人简介

exyz

文章分类

全部博文(62)

分类: LINUX

2012-06-17 21:37:57

1。准备:lamp(linux,apach,mysql,php,以及各个库



文件和工具<二进制源文件>)

相关系统的工具:make,gcc,gcc-c++

2。设置,系统设置;设置selinux为disabled

文件位置:/etc/sysconfig/selinux

重启生效,重启动后,再#iptables -F ,即关闭



防火墙,有时候开机之后,防火墙会自动开启,造成,访



问网站根目录失败。

php,mysql,apach安装了的话,删除或者停止服



务。查看 #ps -le | grep php(mysql/http)

或者: #ls /etc/rc.d/init.d (查看进程列



表)

停止的话:#service httpd stop

#service mysql stop

#service php stop

3。解压

lamp目录下

#vi tar.sh

内容:

cd /root/lamp/

ls *.tar.gz > ls.list

for TAR in `cat ls.list` (此符号注



意)

do

tar -zxf $TAR

done

#sh -x tar.sh

...........

3。开始安装各个软件











cd /lamp/libxml2-2.6.30

./configure --prefix=/usr/local/libxml2/

make

make install



cd /lamp/libmcrypt-2.5.8

./configure --prefix=/usr/local/libmcrypt/

make

make install



cd /lamp/libmcrypt-2.5.8/libltdl

./configure --enable-ltdl-install

make

make install



cd /lamp/zlib-1.2.3

./configure

make

make install



cd /lamp/libpng-1.2.31

./configure --prefix=/usr/local/libpng/

make

make install



mkdir /usr/local/jpeg6

mkdir /usr/local/jpeg6/bin

mkdir /usr/local/jpeg6/lib

mkdir /usr/local/jpeg6/include

mkdir -p /usr/local/jpeg6/man/man1

cd /lamp/jpeg-6b

./configure --prefix=/usr/local/jpeg6/ --enable-



shared --enable-static

make

make install



cd /lamp/freetype-2.3.5

./configure --prefix=/usr/local/freetype/

make

make install



cd /lamp/autoconf-2.61

./configure

make

make install



cd /lamp/gd-2.0.35

./configure --prefix=/usr/local/gd2/ --with-



jpeg=/usr/local/jpeg6/ --with-



freetype=/usr/local/freetype/

make

make install







cd /lamp/httpd-2.2.9

./configure --prefix=/usr/local/apache2/ --



sysconfdir=/etc/httpd/ --with-included-apr --



disable-userdir --enable-so --enable-deflate=shared



--enable-expires=shared --enable-rewrite=shared --



enable-static-support

make

make install



/usr/local/apache2/bin/apachectl start

echo "/usr/local/apache2/bin/apachectl start" >>



/etc/rc.d/rc.sysinit

********************************************

*浏览器输入ip测试。。成功的话看到 it works!

*可能是防火墙没有关闭

*#intables -F

*再进行访问即可

********************************************



cd /lamp/ncurses-5.6

./configure --with-shared --without-debug --



without-ada --enable-overwrite

make

make install



groupadd mysql

grep mysql /etc/group[查看是否创建成功]

useradd -g mysql mysql

grep mysql /etc/passwd[查看mysql用户创建成功否]

cd /lamp/mysql-5.0.41

./configure --prefix=/usr/local/mysql/ --with-



extra-charsets=all

make

make install



***************************************************



***************************************************



***************

*1.数据库设置密码:



#/usr/local/mysql/bin/mysql -u root -p

*登陆mysql后,update mysql.user set



password=password("新密码") where user='root' ;

* flush privilege;

*一:增加数据库用户:Insert INTO mysql.user



(Host,User,Password) VALUES('%','exuxu',PASSWORD



('jinfaxia'));

* 之后:FLUSH PRIVILEGES

*二:mysql> REPLACE INTO mysql.user



(Host,User,Password)

*VALUES('%','jeffrey',PASSWORD('biscuit'));

*mysql> FLUSH PRIVILEGES

*

*2.将mysql设置为开机启动:

*在 /etc/rc.d/rc.local 文件中加入

* /etc/rc.d/init.d/mysql start

*

***************************************************



***************************************************



*****************









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

*********************************************

*

*# ls -ld /usr/local/mysql/

*drwxr-xr-x 12 mysql mysql 4096 Mar 6 19:41



/usr/local/mysql/

*# ls -ld /usr/local/mysql/var/

*drwx------ 4 mysql mysql 4096 Mar 6 19:41



/usr/local/mysql/var/

*

*********************************************



/usr/local/mysql/bin/mysqld_safe --user=mysql &

*********************************************

*

*查看mysql进程启动否:

*#ps -le | grep mysql

*//2个进程mysqld||mysqld_safe

*#netstat -an | grep 3306

*看mysql监听端口3306是否开启

*

*

*/usr/local/mysql/bin/mysqladmin variables

*mysqladmin 为mysql的管理软件

*

*********************************************

为mysql设置密码:

/usr/local/mysql/bin/mysql -u root

>SET PASSWORD FOR



'root'@'localhost'=PASSWORD('jinfaxiaa');

>exit





【将apach设置为开机启动#echo



"/usr/local/apache2/bin/apachect1 start" >>



/etc/rc.d/init.d/mysqld】

将apach设置为开机启动

cp /lamp/mysql-5.0.41/support-



files/mysql.server

chown root.root /etc/rc.d/init.d/mysqld

chmod 755 /etc/rc.d/init.d/mysqld

*********************************************

*

*检查权限设置

*# ls -l /etc/rc.d/init.d/mysqld

*-rwxr-xr-x 1 root root 10159 Mar 6 20:06



/etc/rc.d/init.d/mysqld

*

*********************************************

chkconfig --add mysqld

chkconfig --list mysqld [检测mysql运行级别的启动状



态]

chkconfig --levels 245 mysqld off [设置mysql运行级



别的启动状态,只在运行级别为3时启动]









cd /lamp/php-5.2.6

./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-jpeg-



dir=/usr/local/jpeg6/ --with-freetype-



dir=/usr/local/freetype/ --with-gd=/usr/local/gd2/



--with-mcrypt=/usr/local/libmcrypt/ --with-



mysqli=/usr/local/mysql/bin/mysql_config --enable-



soap --enable-mbstring=all --enable-sockets

make

make install







***************************************************



***************************************************



******

*1.安装php时的报错

*

*checking libxml2 install dir... no

*checking for xml2-config path...

*configure: error: xml2-config not found.



Please check your libxml2 installation.

*

*检查是否安装了libxm包

*[root@XKWB3403 php-5.3.8]# rpm -qa |grep



libxml2

*libxml2-2.6.26-2.1.12

*libxml2-python-2.6.26-2.1.12

*

*

*重新安装libxml2和libxml2-devel包

*

*yum install libxml2

*yum install libxml2-devel -y

*

*

*

*安装完之后查找xml2-config文件是否存在

*

*[root@XKWB3403 php-5.3.8]# find / -name



"xml2-config"

*/usr/bin/xml2-config

*

*

*

*如果存在的话重新安装php

*

*[root@XKWB3403 php-5.3.8]# ./configure

*...

*

*2.****************

*如果出现找不到库文件:libltdl.so.3

*那么可以:#yum install libtool-libs

* #yum install libtool-ltdl-devel

*然后再继续编译,安装。。。。。

*

*

***************************************************



***************************************************



*******



























cp php.ini-dist /usr/local/php/etc/php.ini

【echo "Addtype application/x-httpd-php .php



.phtml" >> /etc/httpd/httpd.conf】

vi /etc/httpd/httpd.config

/AddType【找到】

Addtype application/x-httpd-php .php .phtml【附加上



去】

/usr/local/apache2/bin/apachectl restart

[有问题的话,应该是selinux的没有关闭的原因]



vi /usr/local/apache2/htdocs/info.php

[加入]





Zend加速器 ./install.sh

php.ini位置: /usr/local/php/etc

cp -a /root/lamp/phpMyAdmin-3.0.0-rc1-all-languages



/usr/local/apache2/htdocs/phpmyadmin

cd /usr/loacl/apache2/htdocs/phpMyAdmin-3-.0.0-rc1



-all-languages/

cp config.ample.inc.php config.php

vi config.inc.php

/auth_type

将其改为http认证方式【网页管理】
阅读(768) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:【Linux】交换分区和交换交换文件

给主人留下些什么吧!~~