[PowerShell] 自动搭建LAMP环境 →→→→→进入此内容的聊天室

来自 , 2019-02-07, 写在 PowerShell, 查看 162 次.
URL http://www.code666.cn/view/b11c3e3a
  1. #!/bin/bash
  2. echo "1.please input the mysql's path where will installed [default:/web/mysql]"
  3. read sqlread
  4. if [ "$sqlread" != "" ];then
  5. sql=$sqlread
  6. else
  7. sql="/web/mysql"
  8. fi
  9.  
  10. echo "2.please input the httpd's path where will installed [default:/web/httpd]"
  11. read httpdread
  12. if [ "$httpdread" != "" ];then
  13. httpd=$httpdread
  14. else
  15. httpd="/web/httpd"
  16. fi
  17.  
  18. echo "3.please input the php's path where will installed [default:/web/php]"
  19. read phpread
  20. if [ "$phpread" != "" ];then
  21. php=$phpread
  22. else
  23. php="/web/php"
  24. fi
  25.  
  26.  
  27. mkdir -p $sql
  28. mkdir -p $httpd
  29. mkdir -p $php
  30. useradd mysql
  31. tar zxvf `ls | grep mysql | grep tar`
  32. cd `ls -d */ | grep mysql`
  33. ./configure --prefix=$sql --enable-thread-safe-client --with-extra-charsets=gbk && make && make install
  34. cp ./support-files/my-medium.cnf /etc/my.cnf
  35. ${sql}/bin/mysql_install_db --user=mysql
  36. cd ..
  37.  
  38. tar zxvf `ls | grep http | grep tar`
  39. cd `ls -d */ | grep http`
  40. ./configure --prefix=$httpd --enable-so --enable-rewrite && make && make install
  41. cd ..
  42.  
  43. tar zxvf `ls | grep php | grep tar`
  44. cd `ls -d */ | grep php`
  45. ./configure --prefix=$php --with-mysql=$sql --with-apxs2=${httpd}/bin/apxs --with-config-file-path=/usr/local/lib/ && make && make install
  46. cp -f `ls | grep php.ini | head -1` /usr/local/lib/php.ini
  47. cd ..
  48.  
  49. ln -s ${sql}/bin/* /usr/bin/
  50. ln -s ${httpd}/bin/* /usr/bin/
  51. ln -s ${php}/bin/* /usr/bin/
  52. echo "${httpd}/bin/apachectl start" >> /etc/rc.d/rc.local
  53. echo "${sql}/bin/mysqld_safe --user=mysql &" >> /etc/rc.d/rc.local
  54. echo "AddType application/x-httpd-php .php" >> ${httpd}/conf/httpd.conf
  55.  
  56. //shell/1297

回复 "自动搭建LAMP环境"

这儿你可以回复上面这条便签

captcha