编译apache,mysql,php for linux

编译按照apache,mysql,php for linux: 每个开源软件包的安装都可以在代码包的README OR INSTALL文档中找到详细的安装方法! 另外请使用--prefix,来指定每个包安装的路径,这样可以很方便的进行卸载,或安装多个版本到不同的路径! 可以先到网站上下载各个组件的包!

1,先装mysql

#tar-xzvf mysql-5.1.33.tar.gz
#cd mysql-5.1.33

#./configure --prefix=/usr/local/mysql5.1 --default-character-set=utf8
#make;make install
#cp support-files/my-medium.cnf /etc/my.conf
#cp scripts/mysql.server /etc/init.d/mysqld5.1
#cd scripts
#./mysql_install_db --user=mysql

mysql 的启动,可以使用脚本:

#/etc/init.d/mysqld5.1 start

自启动设置:

chkconfig add mysqld5.1

chkconfig mysqld5.1  on

set password for root:
1, 初始无密码进入
mysql>set password for root@localhost=old_password('123456');
test login
mysql -S /tmp/mysql.sock -uroot -P3306 -p

可以重新设置PATH,把新安装的mysql的bin目录加入命令搜索路径,并且放置于前面,这样可以在运行mysql的时候尽量使用的是新安装的mysql客户端工具!


远程机器登录:
需要作本地授权:
grant all on root@172.16.68.12 [identified by password];


2,APACHE2  HTTPD2 INSTALL

版本:httpd-2.2.11.tar.gz

#tar -xzvf httpd-2.2.11.tar.gz

#cd httpd-2.2.11
#./configure --prefix=/usr/local/httpd2 --enable-so --enable-mods-shared=most
#make
#make install

 

3,PHP install

版本:php-5.2.9.tar.gz

#tar -xzvf php-5.2.9.tar.gz

#cd php-5.2.9
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2/bin/apxs --with-mysql=/usr/local/mysql5.1

#make
#make install
#cp php.ini.dest /usr/local/php/lib/php.ini

4,编辑apache的配置文件!修改下面相关的配置,

edit httpd.conf

LoadModule php5_module        modules/libphp5.so


    DirectoryIndex index.html index.php

    AddType application/x-httpd-php .php .phtml .php3 .inc
    AddType application/x-httpd-php-source .phps

start httpd
/usr/local/httpd2/bin/apachectl start

可以测试php是否生效,在/usr/local/httpd2/htdocs/index.php

加入:

<?php

phpinfo()

?>

5,mysql的基于web方式的管理

需要apache,php的支持!

phpMyADmin download
http://sourceforge.net/project/shownotes.php?release_id=670714

下载管理包,见上面的地址;

解压后放置于apache的主目录里 /usr/local/httpd2/htdocs/phpmyadmin

使用浏览器能够访问即可!

修改配置文件:

#cd /usr/local/httpd2/htdocs/phpmyadmin

#cp config.sample.inc.php config.inc.php

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';

/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

/* User for advanced features */
 $cfg['Servers'][$i]['controluser'] = 'root';
 $cfg['Servers'][$i]['controlpass'] = '123456';
/* Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';

完毕!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/241699/viewspace-589017/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/241699/viewspace-589017/

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值