lamp环境搭建

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

yum -y install zlib-devel

yum -y install openssl-devel



mv httpd-2.2.34.tar.gz php-5.5.38.tar.gz tools/

tar zxvf httpd-2.2.34.tar.gz -C /usr/src/


./configure --prefix=/usr/local/httpd --enable-so --enable-ssl --enable-rewrite  -enable-deflate -enable-expires --enable-modules=most --enable-mpm=worker 

make

make install



yum install gcc gcc-c++ ncurses-devel perl 

wget wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz

tar zxvf cmake-2.8.10.2.tar.gz -C /usr/src/

./configure &&make &&make install


tar zxvf mysql-5.5.22.tar.gz -C /usr/src/

cd /usr/src/mysql-5.5.22/

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf-8_general_ci -DWITH_EXTRA_CHARSETS=all -DSYSCONFDIR=/etc/ &&make &&make install


tar zxvf libmcrypt-2.5.8.tar.gz -C /usr/src/

tar zxvf mcrypt-2.6.8.tar.gz -C /usr/src/

tar zxvf mhash-0.9.9.9.tar.gz -C /usr/src/

cd /usr/src/


cd libmcrypt-2.5.8/

./configure &&make &&make install

cd ../mhash-0.9.9.9/

./configure &&make &&make install

cd ../mcrypt-2.6.8/

./configure &&make &&make install


./configure &&make &&make install

export LD_LIBRARY_PATH=/usr/local/lib: LD_LIBRARY_PATH

./configure &&make &&make install


tar zxvf php-5.5.38.tar.gz -C /usr/src/


yum -y install gcc gcc-c++ libxml2 libxml2-devel bzip2 bzip2-devel libmcrypt libmcrypt-devel openssl openssl-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel readline readline-devel libxslt-devel perl perl-devel psmisc.x86_64 recode recode-devel libtidy libtidy-devel

cd /usr/src/php-5.5.38/



./configure --prefix=/usr/local/php5 --with-mcrypt --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql/  --with-config-file-path=/usr/local/php5 --enable-mbstring --with-openssl --with-zlib 

make

make install


cp /usr/src/php-5.5.38/php.ini-development /usr/local/php5/php.ini


vim /usr/local/php5/php.ini

    short_open_tag = On   #将Off改为On

    default_charset = "utf8" ##添加到最后一行


vim /usr/local/httpd/conf/httpd.conf

    

    AddType application/x-httpd-php .php  ##添加此行以支持php

    DirectoryIndex index.html index.php   ##修改此行以支持php

    Include conf/extra/httpd-vhosts.conf    ##将注释取消掉

vim /usr/local/httpd/conf/extra/httpd-vhsots.conf

NameVirtualHost *:80


<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host.example.com

    DocumentRoot "/usr/local/httpd/htdocs/jiayihd"

    ServerName pp.leslie.com

    ServerAlias www.pp.leslie.com

    ErrorLog "logs/jiayihuanduan-error_log"

    CustomLog "logs/jiayihuanduan-access_log" common

<Directory /usr/local/httpd/htdocs/jiayihd>

Options FollowSymLinks

AllowOverride ALL

order allow,deny

Allow from all

</Directory>


</VirtualHost>


<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host2.example.com

    DocumentRoot "/usr/local/httpd/htdocs/jiayiyiduan"

    ServerName dd.leslie.com

    ErrorLog "logs/jiayiyiduan-error_log"

    CustomLog "logs/jiayiyiduan-access_log" common

<Directory /usr/local/httpd/htdocs/jiayiyiduan>

Options FollowSymLinks

AllowOverride ALL

order allow,deny

Allow from all

</Directory>


</VirtualHost>


##配置一个启动脚本

cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd

vim /etc/init.d/httpd

chkconfig httpd on

chmod +x /etc/init.d/httpd 

chkconfig --add httpd


/etc/init.d/httpd start













本文转自偏执与柔情51CTO博客,原文链接:http://blog.51cto.com/lesliecheung/1974251 ,如需转载请自行联系原作者





相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
1月前
|
关系型数据库 MySQL Apache
LAMP源码安装配置实战
LAMP源码安装配置实战
23 3
|
关系型数据库 MySQL 应用服务中间件
LAMP & LNMP及简单环境搭建
LAMP & LNMP及简单环境搭建
150 0
|
弹性计算 关系型数据库 MySQL
服务器LAMP环境搭建
搭建服务器环境
172 1
|
关系型数据库 MySQL PHP
|
关系型数据库 PHP Apache
|
Web App开发 关系型数据库 测试技术
|
关系型数据库 Linux PHP
|
关系型数据库 MySQL PHP
|
关系型数据库 PHP Apache
|
Web App开发 关系型数据库 应用服务中间件