centOS6.8编译安装Apache 2.2+Mysql5.5+Php5.3
来源:互联网 发布:数据库应用access 编辑:程序博客网 时间:2024/06/05 07:51
LAMP有几个组合,这是其中一种经典组合。
LAMP版本的选择,主要是PHP版本的严格要求,需要根据程序代码选择。
首先,centos需要安装gcc之类的编译器。用yum比较简单。
yum install gcc gcc-c++ glibc glibc-devel
1、编译安装Apache2.2
wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.2.34.tar.gz
tar xvf httpd-2.2.34
cd httpd-2.2.34
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
make
make install
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
/etc/init.d/httpd start 启动apache
ps -ef |grep httpd 查看是否启动
service iptables stop 关闭防火墙,不然从外面无法访问apache
查看本服务器的ip地址,在其他电脑的浏览器地址栏输入该ip地址,显示:It works! 则表示安装成功。
2、安装Mysql5.5
需要先安装apr
yum install apr-devel apr-util-devel -y
wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.58.tar.gz
tar xvf mysql-5.5.58
cd mysql-5.5.58
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql55 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DMYSQL_DATADIR=/data/mysql \
-DSYSCONFDIR=/etc \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EXTRA_CHARSETS=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_BIG_TABLES=1 \
-DWITH_DEBUG=0
make
make install
cd /usr/local/mysql55/
\cp support-files/my-large.cnf /etc/my.cnf
\cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 35 mysqld on
mkdir -p /data/mysql
useradd mysql
/usr/local/mysql55/scripts/mysql_install_db --user=mysql --datadir=/data/mysql/ --basedir=/usr/local/mysql55/
ln -s /usr/local/mysql55/bin/* /usr/bin/
service mysqld restart
3、安装PHP
wget http://mirrors.sohu.com/php/php-5.3.28.tar.bz2
tar jxf php-5.3.28.tar.bz2
cd php-5.3.28 ;
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql55/
出错:
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using –with-apxs2=/path/to/apxs
3. Apache was not built using –enable-so (the apxs usage page is displayed)
The output of /usr/local/apache/bin/apxs follows:
./configure: /usr/local/apache/bin/apxs: not found
configure: error: Aborting
出现以上问题
#vi /usr/local/apache/bin/apxs
第一行的#!/replace/with/path/to/perl/interpreter -w,找到你perl的安装位置,如果不清楚,可以用which perl找到,一般在/usr/bin/perl ,于是将第一行改为:#!/usr/bin/perl -w. 再运行php的configure, 一切正常!
执行预编译的时候继续出错。
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
重新安装libxml2和libxml2-devel包
yum install libxml2 libxml2-devel -y
再次执行./configure通过。
。。。
apache和php的整合出问题了。。明天在研究。。
- centOS6.8编译安装Apache 2.2+Mysql5.5+Php5.3
- CentOS6.8编译安装Apache2.4.25、MySQL5.7.16、PHP5.6.29
- CentOS6.5 PHP5.4.0+Apache2.4.1+MySQL5.5.21 编译安装
- centos6.3编译安装Apache2.4.3+PHP5.4.8+Mysql5.5.8
- Ubuntu14.04 & CentOS6.5 编译安装Apache & PHP5.6
- centos6.5编译安装nginx1.6.2+mysql5.5.35+php5.2.17+Zendoptimizer+eaccelerator
- CentOS6.5,7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14
- centos6.5编译安装(配置shopex4.8.5) nginx1.6.2+mysql5.5.35+php5.2.17+Zendoptimizer+eaccelerator
- PHP之——CentOS6.5编译安装Nginx1.70 +PHP5.59+MySQL5.6.16
- CentOS6.5编译安装Nginx1.8.1+MySQL5.5.48+PHP5.2.17+xcache3.2+ZendOptimizer-3.3.9
- centos6.5编译安装nginx1.6.2+mysql5.5.35+php5.2.17+Zendoptimizer+eaccelerator
- CentOS6.3下编译安装配置nginx1.2.3+php5.3.16+mysql5.5.27+memcached1.4.5
- CentOS6.3下编译安装配置nginx1.2.3+php5.3.16+mysql5.5.27+memcached1.4.5
- Centos6.5 编译安装PHP5.3.28
- Centos6.3下编译安装php5.4.14
- centos6.3(final) 编译安装php5.6
- centos 5.0 编译安装apache 2.2.6+php5.2.5+mysql5.0.46+Zend笔记
- centos 5.0 编译安装apache 2.2.6 php5.2.5 mysql5.0.46 Z
- Jzoj4782 Math
- 浏览器渲染的过程
- ubantu之gcc vim的安装
- Web Scraping with Python: 使用 Python 爬 GitHub Star 数
- 执行nginx -s reload报错 [alert] kill(****, ***) failed
- centOS6.8编译安装Apache 2.2+Mysql5.5+Php5.3
- matlab过期问题的解决
- 创建图形用户界面
- JavaWeb框架-Hibernate-1-我来了,我看见,我征服!
- 版本控制
- [构造][度数序列的可图性]Codeforces Gym 100269K. Kids in a Friendly Class
- mysql数据库优化之系统配置优化及硬件优化
- HDU 2665 Kth number(主席树)
- 《深入理解java虚拟机》学习笔记2——Java内存溢出实例