lamp架构源码安装
来源:互联网 发布:php 高级算法 编辑:程序博客网 时间:2024/05/17 06:23
第一步:
首先安装linux或者虚拟linux,这里测试用的redhat5.6。系统安装就不用说了,如果是装学习用的空系统,可以大概看下:http://blog.csdn.net/korder/article/details/40416875
第二步:
把lamp所需包全部导入系统,在/usr/local/src/lamp目录,没有的自己建。
lamp全包下载地址:(网络太差,回头有时间在上传)
并且配置yum源,参考:http://blog.csdn.net/korder/article/details/40417055
第三步:
首先安装apache,安装前需要安装所需的软件包
安装跨平台底层支持工具包apr第一个包:mv bao /usr/local/src/lamp 把解压后的包全放在lamp目录下cd /usr/local/src/lamplsrpm -qa |grep httpd 查看appache版本tar fvxj apr-1.4.6.tar.bz2 clearlscd apr-1.4.6./configure --prefix=/usr/local/aprmake && make install安装跨平台底层支持工具包apr第二个包:
tar fvxj apr-util-1.5.1.tar.bz2lscd apr-util-1.51 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/make && make install第四步:
安装apache
tar xzvf httpd-2.4.3.tar.gzcd httpd-2.4.3yum install zlib-devel gcc* openssl-devel pcre-devel -y 安装相关依赖包cd /usr/localmkdir apache2./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-module=so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --enable-static-support --enable-static-ab --disable-userdir --with-mpm=prefork --enable-nonportable-atomics --disable-ipv6 --with-sendfilemake && make install cd /usr/local/apache2/bin./apachectl -k start 或者(/usr/local/apache2/bin/httpd)第五步:
安装mysql
cd /usr/local/src/lamp/lsrpm -ivh cmake-2.6.4.7.e15.i386.rpmgroupadd mysqluseradd -g mysql mysqlrpm -qa |grep mysqlyum remove mysql-server mysql mysql-devel -y 删除系统自带的mysql包yum install ncurses-devel libtool -y 安装ncurses、libtool依赖包给mysql建立一个目录mkdir -pv /usr/local/mysql/data解压tar fvxz mysql-5.5.29.tar.gzcd /usr/local/src/lamp/mysql-5.5.29 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data/ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DWITH_INNODBBASE_STORAGE_ENGINE=1 -DENABLE_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_USER=mysql -DWITH_DEBUG=0 -DWITH_EMBEDED_SERVER=0make && make install
第六步:
优化mysql
<pre name="code" class="python">cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnfvim /etc/my.cnf#在mysqld后面添加skip-name-resolve = 1 #不加载配置域名cp support-files/my-innodb-heavy-4G.cnf /etc/init.d/mysqlsourcechmod 755 /etc/init.d/mysqlsourcechown -R mysql.mysql /usr/local/mysql/ sh scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ ln -s /usr/local/mysql/bin/* /usr/bin/ ln -s /usr/local/mysql/lib/* /usr/lib/ ln -s /usr/local/mysql/libexec/* /usr/local/libexec/ ln -s /usr/local/mysql/share/man/man1/* /usr/share/man/man1 ln -s /usr/local/mysql/share/man/man8/* /usr/share/man/man8 #启动mysql服务service mysqlsource restart#如果过程有错误查看错误日志:cat /usr/local/mysql/data/localhost.localdomain.err
第七步:安装php首先安装依赖包:
tar fvxz libiconv-1.14.tar.gzcd libiconv-1.14./configure --prefix=/usr/local/ --with-apr=/usr/local/apr && make && make install
tar fvxz libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8./configure && make && make installcd libltdl./configure --enable-ltdl-install && make && make install
tar fvxz mhash-0.9.9.9.tar.gzcd mhash-0.9.9.9./configure && make && make installln -s /usr/local/lib/* /usr/lib/ln -s /usr/local/bin/libmcrypt-config /usr/sbin/
tar fvxz mcrypt-2.6.8.tar.gz cd mcrypt-2.6.8./configure && make && make install
ldconfig开始安装php:
tar fvxj php-5.4.11.tar.bz2cd php-5.4.11ls yum install libxml2-devel libpng-devel bzip2-devel curl-devel libjpeg-devel freetype-devel net-snmp-devel./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-iconv-dir=/usr/local/ --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --with-pcre-regex --with-zlib --with-bz2 --enable-calendar --disable-phar --with-curl --enable-dba --with-libxml-dir --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-mhash --enable-mbstring --with-mcrypt --enable-pcntl --enable-xml --disable-rpath --enable-shmop --enable-sockets --enable-zip --enable-bcmath --with-snmp --disable-ipv6 --disable-rpath --disable-debug --with-apxs2=/usr/local/apache2/bin/apxsmake ZEND_EXTRA_LIBS='-liconv'make installcp php.ini-production /usr/local/php/etc/php.ini让apache支持phpvim /usr/local/apache2/conf/httpd.conf添加AddType application-httpd-php .php测试php添加,在index.html 后面加上 index.phpps aux |grep httpdkillall httpd重新启动/usr/local/apache2/bin/httpd
第八步:
测试
测试页面:
vim /usr/local/apache2/htdocs/index.php随便写一个空的php页面解压测试论坛包:cd /usr/local/srcunzip Discuz_7.2_FULL_SC_UTF8.zip mv upload/* /usr/local/apache2/htdocs/ vim /usr/local/php/etc/php.ini 设置short_open_tag = Onkillall httpd /usr/local/apache2/bin/httpd在访问页面并安装论坛过程中,会提示某些文件没有权限,这时候根据提示的哪个文件没有权限,去/usr/local/apache2/htdocs/目录下找到并修改权限
chmod -R 777 * 为了图省事,全改了,工作中并不要这么做额!
0 0
- lamp架构源码安装
- 源码包安装LAMP
- 源码安装LAMP环境
- centos 源码安装lamp
- LAMP源码安装
- lamp源码安装
- 源码安装lamp
- lamp源码安装
- 源码编译安装LAMP
- lamp源码包安装
- Linux源码安装LAMP
- lamp-server 源码安装
- LAMP架构之myeclipse安装
- Lamp源码包安装实录
- Centos6.5 源码安装LAMP
- Linux笔记:源码安装lamp
- 源码编译安装lamp环境
- LAMP环境 源码包安装
- linux-redhat5.6虚拟学习机安装.txt
- 配置yum源
- 「最长单调序列变形」 最大前缀链
- Servlet学习
- Rotate List
- lamp架构源码安装
- 手机第三方支付产品安全性
- 【Leetcode】Find Minimum in Rotated Sorted Array II
- Remove Nth Node From End of List
- poj 3356 文本编辑距离
- Maximum Product Subarray
- [Leetcode] Search in Rotated Sorted Array
- PostgreSQL的特性
- USACO Picture 解题报告