全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2616|回复: 12
打印 上一主题 下一主题

[疑问] lamp一键安装包怎么做的

[复制链接]
跳转到指定楼层
1#
发表于 2011-7-2 09:35:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
lamp一键安装包怎么做的
2#
发表于 2011-7-2 09:37:39 | 只看该作者
linux shell
3#
发表于 2011-7-2 09:38:15 | 只看该作者
好像还没有合适的LAMP一键包。自己编译吧
4#
 楼主| 发表于 2011-7-2 09:38:25 | 只看该作者
能具体点吗
5#
发表于 2011-7-2 09:40:00 | 只看该作者
kloxo 真的不错

不用的别喷
6#
发表于 2011-7-2 09:42:31 | 只看该作者
把你手动编译的步骤写成脚本,就可以了
7#
发表于 2011-7-2 09:47:15 | 只看该作者
直接从源安装就OK了。。。

Debian系:apt-get install apache2 libapache2-mod-php5 php5 php5-gd php5-mysql php5-mcrypt php5-sqlite php5-crul mysql-server mysql-client
ArchLinux:pacman -S apache php php-apache php-gd php-curl mysql

红帽系楼下补充。
8#
发表于 2011-7-2 09:49:21 | 只看该作者
  1. #!/bin/bash
  2. mkdir installtmp
  3. cd installtmp
  4. #---add lnmp user----
  5. groupadd mysql
  6. groupadd www
  7. useradd -g mysql mysql -s /sbin/nologin -M
  8. useradd -g www www -s /sbin/nologin
  9. #---yum remove&install----
  10. yum remove -y httpd mysql php
  11. yum install -y gcc gcc-c++ make autoconf wget ncurses-devel  libmcrypt-devel    libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel  freetype-devel  openldap-devel libtool-ltdl-devel  libevent-devel gd-devel bzip2-devel  pcre-devel bison-devel
  12. #----Downing install ---
  13. wget http://labs.renren.com/apache-mirror//httpd/httpd-2.2.19.tar.gz
  14. wget http://am.php.net/distributions/php-5.3.6.tar.bz2
  15. wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
  16. wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.56.tar.gz
  17. wget http://xcache.lighttpd.net/pub/Releases/1.3.1/xcache-1.3.1.tar.gz
  18. wget http://voxel.dl.sourceforge.net/project/re2c/re2c/0.13.5/re2c-0.13.5.tar.gz
  19. #---export-----------
  20. tar -xvzf libiconv-1.13.1.tar.gz -C /usr/local/src/
  21. tar -xvzf mysql-5.1.56.tar.gz -C /usr/local/src/
  22. tar -xvjf php-5.3.6.tar.bz2 -C /usr/local/src/
  23. tar -xvzf httpd-2.2.19.tar.gz -C /usr/local/src/
  24. tar -xvzf xcache-1.3.1.tar.gz -C /usr/local/src/
  25. tar -xvzf re2c-0.13.5.tar.gz -C /usr/local/src/
  26. #----------install-----------------
  27. cd /usr/local/src/libiconv-1.13.1/
  28. ./configure
  29. make&&make install
  30. ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2

  31. cd /usr/local/src/re2c-0.13.5/
  32. ./configure
  33. make&&make install

  34. cd /usr/local/src/mysql-5.1.56/
  35. ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
  36. make&&make install


  37. cd /usr/local/src/httpd-2.2.19/
  38. ./configure --prefix=/usr/local/httpd --with-included-apr --with-mpm=worker --enable-deflate --enable-cache --enable-disk-cache --enable-file-cache --enable-mem-cache --enable-rewrite --enable-so --enable-speling --enable-ssl --with-apr --with-apr-util --with-ssl --with-z --enable-modules=all --enable-mods-shared=all
  39. make&&make install


  40. cd /usr/local/src/php-5.3.6/
  41. ./configure --prefix=/usr/local/php --with-config-file-path=/etc/ --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/httpd/bin/apxs --with-mysqli=mysqlnd --with-iconv-dir=/usr/local/lib --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --enable-safe-mode --enable-bcmath --with-mhash --with-pdo-mysql=mysqlnd --with-gd --enable-gd-native-ttf --enable-soap --with-openssl --enable-sockets --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --with-mcrypt --with-ldap --with-ldap-sasl --enable-bcmath --enable-shmop --without-pear --enable-zip --with-mhash --with-mcrypt --enable-inline-optimization
  42. make ZEND_EXTRA_LIBS='-liconv'
  43. make install

  44. cd /usr/local/src/xcache-1.3.1/
  45. /usr/local/php/bin/phpize
  46. ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
  47. make&&make install


  48. #--------------------Configure---------------------
  49. #-----------------mysql------------
  50. cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
  51. cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
  52. cd /usr/local/mysql
  53. chown -R mysql .
  54. chgrp -R mysql .
  55. bin/mysql_install_db --user=mysql --skip-external-locking
  56. chown -R root .
  57. chown -R mysql var
  58. bin/mysqld_safe --user=mysql &
  59. #-----------------php--------------
  60. cp /usr/local/src/php-5.3.6/php.ini-production /etc/php.ini
  61. sed -i 's:;cgi.fix_pathinfo=1:cgi.fix_pathinfo=0:g' /etc/php.ini
  62. sed -i 's#/usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so#/usr/local/php/lib/php/extensions/no-debug-zts-20090626/xcache.so#g' /usr/local/src/xcache-1.3.1/xcache.ini
  63. sed -i 's#zend_extension_ts#;zend_extension_ts#g' /usr/local/src/xcache-1.3.1/xcache.ini
  64. cat /usr/local/src/xcache-1.3.1/xcache.ini >>/etc/php.ini
  65. #-----------------apache--------------
  66. cp /usr/local/src/httpd-2.2.19/build/rpm/httpd.init /etc/init.d/httpd
  67. sed -i 's#var/log/httpd/#/usr/local/httpd/logs/#g' /etc/init.d/httpd
  68. sed -i 's#/usr/sbin/httpd#/usr/local/httpd/bin/httpd#g' /etc/init.d/httpd
  69. sed -i 's#/etc/httpd/conf/httpd.conf#/usr/local/httpd/conf/httpd.conf#g' /etc/init.d/httpd
  70. sed -i 's:User daemon:User www:g' /usr/local/httpd/conf/httpd.conf
  71. sed -i 's:Group daemon:Group www:g' /usr/local/httpd/conf/httpd.conf
  72. sed -i '221,225s/index.html/index.php/g'  /usr/local/httpd/conf/httpd.conf
  73. sed -i '364a AddType application/x-httpd-php .php' /usr/local/httpd/conf/httpd.conf
  74. echo "<?php phpinfo() ?>" >/usr/local/httpd/htdocs/index.php
  75. #----------------config iptables-----------------
  76. /etc/rc.d/init.d/iptables stop
  77. iptables -F
  78. iptables -X
  79. iptables -Z
  80. iptables -P INPUT DROP
  81. iptables -P OUTPUT ACCEPT
  82. iptables -P FORWARD DROP
  83. iptables -A INPUT -i lo -p all -j ACCEPT
  84. iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
  85. iptables -A INPUT -p icmp -j ACCEPT
  86. iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  87. iptables -A INPUT -p tcp --dport 80 -j ACCEPT
  88. iptables -A INPUT -p tcp --sport 80 -j ACCEPT
  89. iptables -A INPUT -p tcp --dport 22 -j ACCEPT
  90. iptables -A INPUT -p tcp --sport 22 -j ACCEPT
  91. /etc/rc.d/init.d/iptables save
  92. cp /etc/sysconfig/iptables /etc/sysconfig/iptables.save
  93. /etc/rc.d/init.d/iptables start
  94. #-----------------config other-----------------
  95. chkconfig mysqld on
  96. chkconfig httpd on
  97. service mysqld start
  98. service httpd start
  99. echo "/usr/local/mysql/bin/mysqladmin -u root password 'new-password'"
  100. echo "/usr/local/mysql/bin/mysqladmin -u root -h YourHostname password 'new-password'"
复制代码

评分

参与人数 1威望 +20 收起 理由
WAKAKA + 20 原创内容

查看全部评分

9#
发表于 2011-7-2 09:58:59 | 只看该作者

回复 7# nbclare 的帖子

不需要在配置了?
10#
发表于 2011-7-2 10:04:41 | 只看该作者

实战linux shell编程与服务器管理  page 8 9
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-10 03:23 , Processed in 0.074059 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表