码迷,mamicode.com
首页 > 其他好文 > 详细

lamp环境搭建

时间:2017-10-19 19:57:56      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:lamp 应用服务器

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




本文出自 “向往技术的小白” 博客,请务必保留此出处http://lesliecheung.blog.51cto.com/12622169/1974251

lamp环境搭建

标签:lamp 应用服务器

原文地址:http://lesliecheung.blog.51cto.com/12622169/1974251

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