LAMP源码安装方法
创始人
2024-07-22 18:41:18
0

  lamp源码安装方法

  先安装centos系统,然后更新:

  1.   yum -y install apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel rpmbuild glib2-devel dbus-devel freetype-devel fontconfig-devel gcc-c++ expat-devel python-devel libXrender-devel  
  2.  

  mysql 源码包安装

  1.useradd mysql

  2.passwd mysql(增加密码,可以不用)

  3.进入mysql源码包解压目录

  cacti安装时的方法:

  1.   ./configure --prefix=/usr/local/mysql --enable-local-infile --with-charset=gbk --with-extra-charsets=all --with-low-memory --with-mysqld-user=mysql --enable-thread-safe-client  
  2.  

  4.make

  5.make install

  1.   cp support-files/my-medium.cnf /etc/my.cnf  
  2.  

  6.cd /opt/mysql5

  7.chown -R mysql:mysql .

  8.bin/mysql_install_db --user=mysql

  9.chown -R root .

  chown -R mysql var

  10.bin/mysqld_safe --user=mysql &(启动mysql)

  11、ln -s /usr/local/mysql/bin/* /usr/local/bin(可以直接运行mysql里面的命令了,不用在打目录)

  自启动的配置方法

  1.   cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld  
  2.  
  3.   chmod +x /etc/rc.d/init.d/mysqld  
  4.  
  5.   chkconfig --add mysqld  
  6.  
  7.   service mysqld start  
  8.  

  11.bin/mysqladmin shutdown(关闭mysql)

  service mysqld stop

  apache与php安装

  1.进入httpd的解压目录

  ./configure --enable-so --prefix=/opt/www(普通安装)

  cacti安装方法:

  1.   ./configure --prefix=/usr/local/www --enable-so --enable-rewrite --enable-ssl --with-ssl=/usr/local/openssl --with-zlib --enable-mods-shared=all --enable-track-vars --with-mysql=/usr/local/mysql --with-included-apr  
  2.  
  3.   make  
  4.  
  5.   make install  
  6.  
  7.   /opt/www/bin/apachectl start|stop  
  8.  
  9.   ln -s /opt/www/bin/apachectl /usr/local/bin/apachectl  
  10.  
  11.   cp /opt/www/bin/apachectl /etc/rc.d/init.d/httpd  
  12.  
  13.   chkconfig --add httpd  
  14.  
  15.   chkconfig --list httpd  
  16.  
  17.   service httpd start  
  18.  

  apache安装好了

  2.安装php,进入php解压目录

  1.   ./configure --with-apxs2=/opt/www/bin/apxs --with-mysql=/opt/mysql5 --enable-sockets  
  2.  

  说明:

  1.   ./configure --with-apxs2=/opt/www/bin/apxs(安装好的apache里面的apxs目录) --with-  
  2.  
  3.   mysql=/opt/mysql5(mysql的安装目录) --enable-sockets(cacti必须要带的参数)  
  4.  
  5.   ./configure --prefix=/usr/local/php --with-config-file-path=/etc -with-apxs2=/usr/local/www/bin/apxs --enable-fastcgi --enable-safe-mode --with-zlib --with-bz2 --with-freetype-dir --enable-mbstring -with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-gd --with-libxml-dir --with-png-dir --with-jpeg-dir --enable-sockets  
  6.  

  (出现要安装的lib库,用yum安装一下,包括库的-devel库)

  1.   make  
  2.  
  3.   make install  
  4.  
  5.   cp php.ini-dist /etc/php.ini  
  6.  

  (配置目录在./configure里面说明了是/etc)

  在httpd.conf里面修改:

  找到下面字段:

  DirectoryIndex

  在index.html前面添加index.php

  增加:

  1.   AddType application/x-httpd-php .php .phtml  
  2.  
  3.   AddType application/x-httpd-php-source .phps  
  4.  

  3.启动apache

  1.   /opt/www/bin/apachectl start  
  2.  

  mysql下载

  php下载

  apache下载

  ========================================

  错误解决:

  安装apache时类似于以下信息:

  “exports.c:1653: error: redefinition of 'ap_hack_apr_version_string'

  exports.c:1022: error: previous definition of 'ap_hack_apr_version_string' was here

  make[2]: *** [exports.lo] Error 1

  make[2]: Leaving directory `/usr/local/src/httpd-2.2.*/server'

  make[1]: *** [all-recursive] Error 1

  make[1]: Leaving directory `/usr/local/src/httpd-2.2.*/server'

  make: *** [all-recursive] Error 1”

  有些人说路径不对,有些说perl包不对,有的说zlib不对。

  反正有病乱投医。

  翻了好久的网页才搞定。

  解决办法:

  在configure后加上 “--with-included-apr”。

【编辑推荐】

  1. Ubuntu下LAMP的搭建
  2. Centos下搭建LAMP
  3. Linux下LAMP的安装方法

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...