VPS侦探论坛

 找回密码
 注册
查看: 9596|回复: 9

我在 lnmp0.5 的基础上再安装Apache ., 军哥.再进来看看脚本

[复制链接]
发表于 2010-11-29 08:22:50 | 显示全部楼层 |阅读模式

因为已经安装了  lnmp0.5 ,我想先停止掉 nginx ,取消自启动. 然后安装  apache ,用它来运行.. 要注意哪方面.要修改哪些参数呀?
我安装好apache, 但是PHP好像没作用.打开PHP网页.是提示下载保存的.

[ 本帖最后由 liangcq132 于 2010-11-29 10:39 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-11-29 08:42:18 | 显示全部楼层


怎么搞呢/

[ 本帖最后由 liangcq132 于 2010-11-29 08:50 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2010-11-29 09:19:05 | 显示全部楼层

回复 1# 的帖子


那是php 没有安装上,所以提示下载。

参考:https://www.vpser.net/build/nginx-apache-guide.html
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-11-29 10:07:56 | 显示全部楼层



Licess ,  有没有LAMP安装包..我用别人根据修改你的LNMP.的LAMP安装.安装后..PHP 不知道为什么没安装上呀?
你看看他修改的脚本 ,,哪方面有问题?

我安装你的LNMP0.4 , 0.5 都非常顺利安装完成.能使用..    现在想试试LAMP,用这个脚本安装完后.发现PHP没装完?
  1. #!/bin/bash

  2. clear
  3. echo "========================================================================="
  4. echo "lamp v0.0.1 for VPS  Written by Licess "
  5. echo "========================================================================="
  6. echo "A tool to auto-compile & install Apache+MySQL+PHP on Linux "
  7. echo "For more information please visit http://blog.licess.cn/lamp/"
  8. echo ""
  9. echo ""
  10. echo "The path of some dirs:"
  11. echo "mysql dir:   /usr/local/mysql"
  12. echo "php dir:     /usr/local/php"
  13. echo "apache dir:   /usr/local/apache"
  14. echo "web dir      /home/www/default"
  15. echo ""
  16. echo "========================================================================="

  17. if [ "$1" != "--help" ]; then
  18.         get_char()
  19.         {
  20.         SAVEDSTTY=`stty -g`
  21.         stty -echo
  22.         stty cbreak
  23.         dd if=/dev/tty bs=1 count=1 2> /dev/null
  24.         stty -raw
  25.         stty echo
  26.         stty $SAVEDSTTY
  27.         }

  28.         domain="www.lamp.org"
  29.         echo "Please input domain:"
  30.         read -p "(Default domain: www.lamp.org):" domain

  31.         echo ""
  32.         mysqlpassword=""
  33.         read -p "Please input mysql password:" mysqlpassword

  34.         if [ "$domain" = "" ]; then
  35.                 domain="www.lamp.org"
  36.         fi

  37.         echo ""
  38.         groupadd www
  39.         useradd -g www www
  40.         echo ""
  41.         echo "Please input ftp password:"
  42.         passwd www

  43.         echo ""
  44.         echo "==========================="

  45.         echo domain="$domain"

  46.         echo "==========================="

  47.         echo ""
  48.         echo "Press any key to start installing..."
  49.         char=`get_char`


  50. echo "========================================================================="
  51. echo "start download LNMP package "
  52. wget http://us.php.net/distributions/php-5.2.10.tar.gz
  53. wget http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.35.tar.gz
  54. wget http://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz
  55. wget http://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz
  56. wget http://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz
  57. wget http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz
  58. wget http://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz
  59. wget http://blog.s135.com/soft/linux/nginx_php/pcre/pcre-7.9.tar.gz
  60. wget http://pecl.php.net/get/APC-3.1.2.tgz
  61. wget http://mirror.atlanticmetro.net/apache/httpd/httpd-2.2.15.tar.gz
  62. wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
  63. wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
  64. wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.0/phpMyAdmin-3.3.0-all-languages.tar.gz?use_mirror=cdnetworks-us-2
  65. echo "download package finished!"
  66. echo ""
  67. echo "========================================================================="

  68. yum remove httpd -y
  69. yum yum-fastest-mirror
  70. yum -y update
  71. yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers vim-minimal patch tar unzip screen diffutils sendmail

  72. tar zxvf libiconv-1.13.tar.gz
  73. cd libiconv-1.13/
  74. ./configure --prefix=/usr/local
  75. make
  76. make install
  77. cd ../

  78. tar zxvf libmcrypt-2.5.8.tar.gz
  79. cd libmcrypt-2.5.8/
  80. ./configure
  81. make
  82. make install
  83. /sbin/ldconfig
  84. cd libltdl/
  85. ./configure --enable-ltdl-install
  86. make
  87. make install
  88. cd ../../

  89. tar zxvf mhash-0.9.9.9.tar.gz
  90. cd mhash-0.9.9.9/
  91. ./configure
  92. make
  93. make install
  94. cd ../

  95. ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
  96. ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
  97. ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
  98. ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
  99. ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
  100. ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
  101. ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
  102. ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
  103. ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

  104. tar zxvf mcrypt-2.6.8.tar.gz
  105. cd mcrypt-2.6.8/
  106. ./configure
  107. make
  108. make install
  109. cd ../

  110. echo "============================mysql install=================================="
  111. tar -zxvf mysql-5.1.35.tar.gz
  112. cd mysql-5.1.35
  113. ./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
  114. make;make install
  115. cd ../
  116. groupadd mysql
  117. useradd -g mysql mysql
  118. cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
  119. /usr/local/mysql/bin/mysql_install_db --user=mysql
  120. chown -R mysql /usr/local/mysql/var
  121. chgrp -R mysql /usr/local/mysql/.
  122. cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
  123. chmod 755 /etc/init.d/mysql
  124. chkconfig --level 345 mysql on
  125. echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
  126. echo "/usr/local/lib" >>/etc/ld.so.conf
  127. ldconfig
  128. ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
  129. ln -s /usr/local/mysql/include/mysql /usr/include/mysql
  130. service mysql start
  131. /usr/local/mysql/bin/mysqladmin -u root password $mysqlpassword
  132. cat >>/etc/profile<
  133. MYSQL_HOME=/usr/local/mysql
  134. PATH=$MYSQL_HOME/bin:$PATH
  135. export PATH
  136. EOF
  137. service mysql restart
  138. service mysql stop
  139. echo "============================mysql intall finished========================="

  140. echo "============================apache httpd install======================"
  141. tar zxvf httpd-2.2.15.tar.gz
  142. cd httpd-2.2.15
  143. ./configure -enable-headers -enable-info -enable-rewrite -enable-so -prefix=/usr/local/apache
  144. make
  145. make install
  146. cd ../
  147. rm -rf /usr/local/apache/conf
  148. cp -r apache_conf /usr/local/apache/conf
  149. sed -i 's/www.lamp.org/'$domain'/g' /usr/local/apache/conf/extra/httpd-vhosts.conf
  150. echo "============================apache httpd install finished======================"

  151. echo "============================php+apc install======================"
  152. tar zxvf php-5.2.10.tar.gz
  153. cd php-5.2.10/
  154. ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-ftp --without-pear
  155. make ZEND_EXTRA_LIBS='-liconv'
  156. make install
  157. mkdir -p /usr/local/php/etc
  158. cp php.ini-dist /usr/local/php/etc/php.ini
  159. cd ../

  160. tar zxvf memcache-2.2.5.tgz
  161. cd memcache-2.2.5/
  162. /usr/local/php/bin/phpize
  163. ./configure --with-php-config=/usr/local/php/bin/php-config
  164. make
  165. make install
  166. cd ../

  167. tar zxvf APC-3.1.2.tgz
  168. cd APC-3.1.2/
  169. /usr/local/php/bin/phpize
  170. ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config
  171. make
  172. make install
  173. cd ../
复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-11-29 10:08:34 | 显示全部楼层

补上:
  1. sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"\nextension = "memcache.so"\nextension = "apc.so"\nextension = "pdo_mysql.so"\n#' /usr/local/php/etc/php.ini
  2. sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/php/etc/php.ini

  3. cat >>/usr/local/php/etc/php.ini<
  4. apc.enabled = 1
  5. apc.cache_by_default = on
  6. apc.shm_segments = 1
  7. apc.shm_size = 32
  8. apc.ttl = 600
  9. apc.user_ttl = 600
  10. apc.num_files_hint = 0
  11. apc.write_lock = On
  12. EOF

  13. mkdir -p /home/www/default
  14. chmod +w /home/www/default
  15. mkdir -p /home/logs
  16. chmod 777 /home/logs

  17. chown -R www:www /home/www/default
  18. echo "============================php+eaccelerator install finished======================"

  19. echo "============================pdo_mysql install======================"
  20. tar -zxvf PDO_MYSQL-1.0.2.tgz
  21. cd PDO_MYSQL-1.0.2
  22. /usr/local/php/bin/phpize
  23. ./configure -with-php-config=/usr/local/php/bin/php-config -with-pdo-mysql=/usr/local/mysql
  24. make
  25. make install
  26. cd ../
  27. echo "============================pdo_mysql finished======================"

  28. echo "============================cronolog install======================"
  29. tar zxvf cronolog-1.6.2.tar.gz
  30. cd cronolog-1.6.2
  31. ./configure
  32. make
  33. make install
  34. cd ../
  35. echo "============================cronolog install finished======================"

  36. echo "============================set service======================"
  37. echo "ulimit -SHn 51200" >>/etc/rc.local
  38. echo "service mysql start" >>/etc/rc.local
  39. echo "/usr/local/apache/bin/apachectl -k start" >>/etc/rc.local
  40. /usr/local/apache/bin/apachectl -k start
  41. service mysql start
  42. echo "============================set service finished======================"


  43. cat >/home/www/default/phpinfo.php<
  44. phpinfo();
  45. ?>
  46. eof
  47. echo "============================phpMyAdmin install================================="
  48. chown www -R  /home/
  49. chown www /usr/local/apache/conf/
  50. chown www /usr/local/php/etc/
  51. yum -y install vsftpd
  52. adduser www
  53. /etc/init.d/vsftpd start
  54. chkconfig --level 345 vsftpd on
  55. cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  56. cp conf/index.php /home/www/default/index.php
  57. cp conf/apc.php /home/www/default/apc.php

  58. tar zxvf phpMyAdmin-3.3.0-all-languages.tar.gz
  59. mv phpMyAdmin-3.3.0-all-languages /home/www/default/phpmyadmin
  60. echo "============================phpMyAdmin install finished================================="

  61. clear
  62. echo "========================================================================="
  63. echo "lamp v0.0.1 for VPS  Written by Licess "
  64. echo "========================================================================="
  65. echo ""
  66. echo "For more information please visit http://blog.licess.cn/lamp/"
  67. echo ""
  68. echo "phpinfo test:http://$domain/phpinfo.php"
  69. echo "phpMyAdmin test:http://$domain/phpmyadmin"
  70. echo "The path of some dirs:"
  71. echo "mysql dir:  /usr/local/mysql"
  72. echo "php dir:  /usr/local/php"
  73. echo "apache dir:  /usr/local/apache"
  74. echo "web dir:  /home/www/default"
  75. echo "ftp username:  www"
  76. echo "mysql username:  root"
  77. echo ""
  78. echo "important:  login http://$domain/phpmyadmin and delete users with no password!"
  79. echo ""
  80. echo "========================================================================="
  81. fi
复制代码

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2010-11-29 10:14:13 | 显示全部楼层

强烈建议,军哥开发一个 LAMP 一键安装包呀.
发表于 2010-11-29 13:00:41 | 显示全部楼层

回复 6# 的帖子


脚本是没问题,可能是因为缺少库吧。你把错误信息发上来。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-11-29 16:19:41 | 显示全部楼层

[root@bogon ~]# /usr/local/apache/bin/apachectl start
Syntax error on line 55 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: _fpm_event_loopbreak
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-11-29 16:55:33 | 显示全部楼层

出现 404 错误

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-11-29 16:57:46 | 显示全部楼层



看到了.是403 ,NND.访问 index.php ,竟然出现代码的?

[ 本帖最后由 liangcq132 于 2010-11-29 17:03 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-18 03:21 , Processed in 0.029702 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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