标签:源码包搭建lamp
[root@localhost~]#yum–y install gcc make openssl-devel c++ libxml2-devel
[root@localhostsrc]# tar -zxf httpd-2.2.25
[root@localhostsrc]#cd httpd-2.2.25
[root@localhost src]# ./configure--prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-cgi--enable-ssl --enable-charset-lite --enable-suexec --with-suexec-caller=daemon--with-suexec-docroot=/usr/local/httpd/htdocs
[root@localhost src]#make&& make install
[root@localhosthttpd-2.2.25]# /usr/local/httpd/bin/apachectl start
[root@localhost httpd-2.2.25]# netstat-tlnp | grep :80
tcp 0 0 :::80 :::* LISTEN 56629/httpd
[root@localhost init.d]# cp/usr/local/httpd/bin/apachectl /etc/init.d/myhttpd
[root@localhost init.d]# vim/etc/init.d/myhttpd
在#!/bin/bash下面加上如下两行:
# chkconfig: 35 85 15
# description: 描述信息
[root@localhost init.d]# chkconfig --add myhttpd
[root@localhost src]# useradd -M -u 49 -s/sbin/nolog mysql
[root@localhost src]# tar -zxfmysql-5.1.62.tar.gz
[root@localhostsrc]# cd mysql-5.1.62
[root@localhost mysql-5.1.62]# ./configure--prefix=/usr/local/mysql --with-charset=utf8 --with-collation=utf8_general_ci--with-extra-charsets=gbk,gb2312
[root@localhost mysql-5.1.62]# make&& make install
[root@localhostmysql-5.1.62]# cp support-files/my-medium.cnf /etc/my.cnf
[root@localhostmysql-5.1.62]# cd /usr/local/mysql/bin/
[root@localhostbin]# ./mysql_install_db --user=mysql
[root@svr5 bin]#chown -R root:mysql /usr/local/mysql/
[root@svr5 bin]#chown -R mysql /usr/local/mysql/var/
[root@svr5 bin]#ln -s /usr/local/mysql/bin/* /usr/local/bin/
[root@svr5 bin]#ln -s /usr/local/mysql/lib/mysql/* /usr/lib64/
[root@svr5 bin]#ln -s /usr/local/mysql/include/mysql/* /usr/include/
[root@svr5 bin]#cd /usr/src/mysql-5.1.62/support-files/
[root@svr5support-files]# cp mysql.server /etc/init.d/mysqld
[root@svr5 support-files]# chmod +x /etc/rc.d/init.d/mysqld
[root@svr5support-files]# chkconfig --add mysqld
[root@localhost support-files]# servicemysqld start
[root@localhost support-files]# netstat-tlnp | grep :3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 18314/mysqld
[root@localhost support-files]#
1、 [root@localhost src]# tar -zxf php-5.4.19.tar.gz
2、 [root@localhost src]# cdphp-5.4.19
3、 [root@localhost php-5.4.19]# ./configure --prefix=/usr/local/php--enable-mbstring --enable-sockets --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php
[root@svr5 php-5.4.19]# make && make install
[root@svr5 php-5.4.19]# cpphp.ini-development /usr/local/php/php.ini
[root@localhost httpd]# vim/usr/local/httpd/conf/httpd.conf,添加一行:
AddType application/x-httpd-php .php
[root@localhost httpd]#vim /var/www/html/index.php
<?
php phpinfo();
?>
本文出自 “linux学习” 博客,请务必保留此出处http://2993336.blog.51cto.com/2983336/1439708
标签:源码包搭建lamp
原文地址:http://2993336.blog.51cto.com/2983336/1439708