码迷,mamicode.com
首页 > 数据库 > 详细

CentOS 6.6编译安装LAMP(Apache2+PHP+Mysql+PHPmyAdmin)

时间:2015-06-26 13:33:14      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:lamp   apache2   php   mysql   linux   

搭建环境:

Linux: CentOS 6.6(Final) x64
Apache:2.2.15
MySQL:5.1.52
PHP:5.3.2

步骤说明:

1.MySQL

# yum install mysql mysql-server


# chkconfig --levels 235 mysqld on # MySQL 能够随系统自动启动


# /etc/init.d/mysqld start


# mysql_secure_installation # 设置 MySQL 数据 root 账户的密码


# mysql -u root -p # 以root用户启动mysql数据库



2.Apache


# yum install httpd


# chkconfig --levels 235 httpd on # Apache 随系统启动


# /etc/init.d/httpd start


# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT # centos的防火墙开放80端口


# /etc/rc.d/init.d/iptables save # 保存


# /etc/init.d/iptables status # 确认检查



3.PHP


# yum install php


# /etc/init.d/httpd restart


# yum search php # 搜索模块


# yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc # 安装相关模块


# /etc/init.d/httpd restart # 重启 Apache



4.PHP-myAdmin


# cd /var/www/html


# wget http://nchc.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.10/phpMyAdmin-3.3.10-all-languages.tar.gz


# tar xvfz phpMyAdmin-3.3.10-all-languages.tar.gz # 解压


# mv phpMyAdmin-3.3.10-all-languages phpmyadmin


# cd phpmyadmin


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


# vim config.inc.php
      :
 $cfg[‘Servers‘][$i][‘auth_type‘] = ‘http‘; # default is cookies

      :


# service httpd restart



5.配置监听端口


# cd /etc/httpd/conf


# vim httpd.conf


  Listen 5000






CentOS 6.6编译安装LAMP(Apache2+PHP+Mysql+PHPmyAdmin)

标签:lamp   apache2   php   mysql   linux   

原文地址:http://blog.csdn.net/lemon_tree12138/article/details/46648923

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!