CentOS用yum构建LAMP环境

参考:http://blog.chinaunix.net/u2/71827/showart_1005370.html

1、安装

apache yum install httpd*

2、安装

mysql yum install mysql mysql-server mysql-devel

3、安装

php yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml

4、配置Apache

vim /etc/httpd/conf/httpd.conf

(1)搜索Listen Listen 80 修改为自己的端口

(2)搜索DocumentRoot DocumentRoot "/www/"

(3)搜索<Directory> <Directory "/www/"> 完毕。

5、配置MySQL

在[mysqld]下面加入

default-character-set = utf8

mysql -u root -p 进入mysql控制台后

grant all privileges on *.* to remote @ "%" identified by "password"

分配好的这个remote就可以从远程访问了,最好是在@中限定一下IP。

Leave a Reply

Your email address will not be published. Required fields are marked *