LAMP环境部署指南

1.安装apache

1)安装httpd:

yum install httpd

2)启动httpd服务

service httpd start

2.安装mysql

1)安装mysql

yum install mysql mysql-server

2)修改mysql编码为utf8

vi /etc/my.cnf

在[mysqld]下添加如下:

default-character-set=utf8

init_connect="SET NAMES utf8"

3)启动mysql服务

service mysqld start

3.安装php56及扩展

rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm 

1)安装php54以及集成扩展

yum install php54w php56w-pear php56w-mcrypt

2)安装mysql扩展

yum install php56w-mysql

3)安装mongodb扩展

yum install gcc openssl openssl-devel

pecl install mongo

vi /etc/my.ini

添加extension=mongo.so

4)重启apache

service httpd restart

4.配置域名

1)被修改文件:/etc/httpd/conf/httpd.conf

2)修改DocumentRoot:

DocumentRoot "/var/www/项目目录"

3)修改Directory:

<Directory "/var/www/iot">

......

    Order allow,deny

    Allow from all

</Directory>

下面关于LAMP相关的内容你可能也喜欢

相关推荐