CentOS5.2配置LAMP全過程(第二版)

來源:本站原創 Linux 超過28,255 views圍觀 0條評論

這個文檔是參考版主的文章,學習了2個多月總結出來的啊,請大家多多指教
參考文檔
參考了網上不少文檔,下面的3篇是重點,不少代碼都是從下面復制過來的。
RHEL4上安裝基于postfix的全功能郵件服務器(全部使用目前最新源碼包構建) (http://bbs.chinaunix.net/thread-987344-1-1.html
Nginx 0.7.x + PHP 5.2.6(FastCGI)搭建勝過Apache十倍的Web服務器(第4版)(http://blog.s135.com/read.php/366.htm
基于CentOS構建高性能的LAMP平臺.(http://bbs.linuxtone.org/thread-122-1-1.html
文章內容分為7部分
一:系統約定
二:系統基本設置
三:下載軟件
四:安裝必須的軟件
五:編譯安裝軟件
六:配置apache PHP
七:測試 (通過phpinfo,phpmyadmin,sugarcrm的安裝來測試)
一:系統約定
    采用Centos5.2光盤,
    軟件源代碼包存放位置        /usr/local/src
    源碼包編譯安裝位置(prefix)        /usr/local/software_name
    MySQL 數據庫位置        /data/mysql/data
    Apache 網站根目錄        /data/www/wwwroot(虛擬主機在這個目錄下)
    Apache 虛擬主機日志根目錄        /data/www/logs
    Apache 運行賬戶        www:www
    創建兩個虛擬主機    test.com linux.com
所有的配置的文件修改,都做備份,備份的名字為 文件名.save
下面的實驗是用vmware station 6 創建一個 redhat AS5的vm,安裝centos5.2,安裝的時候,選擇安裝語言是英文,采用文本方式來安裝,選擇最小化的安裝。
yum的更新,采用本地光盤的方式,這樣比較快捷。
我的機器基本設置
IP:192.168.1.200/255.255.255.0
網關:192.16.1.1
DNS:192.168.1.1
hostname:ns1
二:系統基本設置
我已經把所有需要配置的內容,做一個一個腳本,只需要運行一次就可以。

  1. cd /usr/local/src
  2. vi /usr/local/src/init.sh

復制代碼

  1. #####################
  2. #Diabe IPV6
  3. cp /etc/modprobe.conf /etc/modprobe.conf.save
  4. echo "alias net-pf-10 off" >> /etc/modprobe.conf
  5. echo "alias ipv6 off" >> /etc/modprobe.conf
  6. #SSH
  7. cp /etc/ssh/sshd_config /etc/ssh/sshd_config.save
  8. sed -i ‘/#PermitRootLogin/s/#PermitRootLogin/PermitRootLogin/’ /etc/ssh/sshd_config
  9. sed -i -e ’74 s/^/#/’ -i -e ’76 s/^/#/’ /etc/ssh/sshd_config
  10. sed -i "s/#UseDNS yes/UseDNS no/" /etc/ssh/sshd_config
  11. sed -i -e ’44 s/^/#/’ -i -e ’48 s/^/#/’ /etc/ssh/sshd_config
  12. /etc/init.d/sshd restart
  13. #停止 the “beep"
  14. cp /etc/inputrc /etc/inputrc.save
  15. sed -i ‘/#set bell-style none/s/#set bell-style none/set bell-style none/’ /etc/inputrc
  16. #關閉SElinux
  17. cp /etc/sysconfig/selinux /etc/sysconfig/selinux.save
  18. sed -i ‘/SELINUX=enforcing/s/SELINUX=enforcing/SELINUX=disabled/’ /etc/sysconfig/selinux
  19. #加載光驅
  20. mkdir /mnt/cdrom
  21. mount /dev/cdrom /mnt/cdrom
  22. echo "mount /dev/cdrom /mnt/cdrom" >> /etc/rc.local
  23. #設置yum使用本地光盤
  24. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.save
  25. mv /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/CentOS-Media.repo.save
  26. echo "[DVDISO]" >> /etc/yum.repos.d/dvdiso.repo
  27. echo "name=DVD ISO" >> /etc/yum.repos.d/dvdiso.repo
  28. echo "baseurl=file:///mnt/cdrom/" >> /etc/yum.repos.d/dvdiso.repo
  29. echo "enabled=1" >> /etc/yum.repos.d/dvdiso.repo
  30. echo "gpgcheck=0" >> /etc/yum.repos.d/dvdiso.repo
  31. #vim設置
  32. yum -y install vim-enhanced
  33. mv /bin/vi /bin/vi.save
  34. ln -s /usr/bin/vim /bin/vi
  35. cp /etc/vimrc /etc/vimrc.save
  36. sed -i "39 s/^/ set number \n filetype on\n set history=1000\n syntax on\n set tabstop=4\n set showmatch\n set vb t_vb=\n set mouse=a\n set ignorecase\n set autowrite\n /" /etc/vimrc
  37. #時間的設置
  38. yum -y install ntp
  39. ntpdate 210.72.145.44 && clock -w
  40. #安裝常用軟件
  41. yum -y install wget unzip
  42. #停止沒有必要的服務
  43. chkconfig –list |grep 3:on |awk ‘{print $1}’ |egrep -v ‘sshd|network|syslog’ |xargs -i{} chkconfig –level 3 {} off
  44. chkconfig –list | grep 3:on | cut -f1
  45. #重新啟動
  46. init 6
  47. ####################

復制代碼

  1. sh init.sh

復制代碼

三:下載軟件

  1. cd /usr/local/src
  2. vi list

復制代碼

  1. http://download.filehat.com/apache/httpd/httpd-2.2.8.tar.gz
  2. http://opensource.nchc.org.tw/COSA/CNS4/cronolog-1.6.2.tar.gz
  3. http://www.libgd.org/releases/gd-2.0.35.tar.bz2
  4. http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.12.tar.gz
  5. http://mirror.optus.net/sourceforge/m/mc/mcrypt/libmcrypt-2.5.8.tar.gz
  6. http://jaist.dl.sourceforge.net/sourceforge/mcrypt/mcrypt-2.6.7.tar.gz
  7. http://www.openssl.org/source/openssl-0.9.8h.tar.gz
  8. http://openbsd.md5.com.ar/pub/OpenBSD/OpenSSH/portable/openssh-5.0p1.tar.gz
  9. http://mysql.byungsoo.net/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz
  10. http://cn2.php.net/get/php-5.2.6.tar.bz2/from/this/mirror
  11. http://downloads.phpchina.com/zend/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
  12. ftp://ftp.cac.washington.edu/mail/imap.tar.Z
  13. http://puzzle.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.8.1-all-languages-utf-8-only.tar.gz
  14. http://dl.sugarforge.org/sugarcrm/Latest-SugarCE5.1/SugarCE5.1.0/SugarCE-5.1.0.zip
  15. http://mirror.optus.net/sourceforge/m/mh/mhash/mhash-0.9.9.tar.gz

復制代碼

  1. wget -i list

復制代碼

四:安裝必須的軟件
采用yum的方式安裝

  1. yum -y install gcc make patch gcc-c++ gcc-g77 flex bison autoconf automake \
  2. 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 libtiff-devel fontconfig-devel libXpm-devel gettext-devel   pam-devel pcre-devel libtool libtool-ltdl

復制代碼

五:編譯安裝軟件
下面的內容,其實你可以復制到一個文本,比如 install.sh 運行這個腳本,我已經測試過了,整整運行了快1個小時,估計是我在vm上跑道原因。前提是你下載的軟件和我是一樣的,也就是軟件都是通過上面的下載的。

  1. cd /usr/local/src
  2. vi install.sh

復制代碼

 

  1. ###############################################
  2. #安裝openssl
  3. cd /usr/local/src
  4. tar zxvf openssl-0.9.8h.tar.gz
  5. cd openssl-0.9.8h
  6. ./config shared zlib
  7. make
  8. make test
  9. make install
  10. mv /usr/bin/openssl /usr/bin/openssl.save
  11. mv /usr/include/openssl /usr/include/openssl.save
  12. mv /usr/lib/libssl.so /usr/lib/libssl.so.save
  13. ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
  14. ln -s /usr/local/ssl/include/openssl /usr/include/openssl
  15. ln -sv /usr/local/ssl/lib/libssl.so.0.9.8 /usr/lib/libssl.so
  16. cd ..
  17. #配置庫文件搜索路徑
  18. echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
  19. ldconfig -v
  20. #檢測安裝結果
  21. openssl version
  22. #安裝openssh
  23. tar xvf openssh-5.0p1.tar.gz
  24. cd openssh-5.0p1
  25. ./configure \
  26.       "–prefix=/usr" \
  27.       "–with-pam" \
  28.       "–with-zlib" \
  29.       "–sysconfdir=/etc/ssh" \
  30.       "–with-ssl-dir=/usr/local/ssl" \
  31.       "–with-md5-passwords"
  32. make
  33. make install
  34. cd ..
  35. service sshd restart
  36. ssh -v
  37. #安裝GD
  38. tar jxvf gd-2.0.35.tar.bz2
  39. cd gd-2.0.35
  40. aclocal
  41. ./configure –prefix=/usr/local/gd2
  42. make && make install
  43. cd ..
  44. #安裝 libmcrypt
  45. tar zxvf libmcrypt-2.5.8.tar.gz
  46. cd libmcrypt-2.5.8/
  47. ./configure
  48. make
  49. make install
  50. /sbin/ldconfig
  51. cd libltdl/
  52. ./configure –enable-ltdl-install
  53. make
  54. make install
  55. cd ../../
  56. cp /usr/local/lib/libmcrypt.* /usr/lib
  57. #安裝libiconv
  58. tar zxvf libiconv-1.12.tar.gz
  59. cd libiconv-1.12/
  60. ./configure –prefix=/usr/local
  61. make
  62. make install
  63. cd ../
  64. ln -s /usr/local/lib/libiconv.so.2 /usr/lib/
  65. #安裝mhash
  66. tar zxvf mhash-0.9.9.tar.gz
  67. cd mhash-0.9.9/
  68. ./configure
  69. make
  70. make install
  71. cd ../
  72. ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
  73. #安裝mcrypt
  74. tar zxvf mcrypt-2.6.7.tar.gz
  75. cd mcrypt-2.6.7/
  76. ./configure
  77. make
  78. make install
  79. cd ../
  80. #安裝cronolog
  81. tar xvf cronolog-1.6.2.tar.gz
  82. cd cronolog-1.6.2
  83. ./configure –prefix=/usr/local/cronolog
  84. make && make install
  85. cd ..
  86. #安裝imap
  87. tar zxf imap.tar.Z
  88. cd imap-2007b
  89. make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4
  90. echo "set disable-plaintext nil" > /etc/c-client.cf
  91. mkdir /usr/local/imap-2007b
  92. mkdir /usr/local/imap-2007b/include/
  93. mkdir /usr/local/imap-2007b/lib/
  94. chmod -R 077 /usr/local/imap-2007b
  95. rm -rf /usr/local/imap-2007b/include/*
  96. rm -rf /usr/local/imap-2007b/lib/*
  97. rm -rf /usr/sbin/imapd
  98. cp imapd/imapd /usr/sbin/
  99. cp c-client/*.h /usr/local/imap-2007b/include/
  100. cp c-client/*.c /usr/local/imap-2007b/lib/
  101. cp c-client/c-client.a /usr/local/imap-2007b/lib/libc-client.a
  102. cd ..
  103. #安裝MYSQL
  104. tar zxvf mysql-5.0.51b.tar.gz
  105. cd mysql-5.0.51b
  106. ./configure \
  107.        "–prefix=/usr/local/mysql" \
  108.        "–localstatedir=/data/mysql/data" \
  109.        "–with-comment=Source" \
  110.        "–with-server-suffix=-test.com" \
  111.        "–with-mysqld-user=mysql" \
  112.        "–without-debug" \
  113.        "–with-big-tables" \
  114.        "–with-charset=utf8" \
  115.        "–with-collation=utf8_chinese_ci" \
  116.        "–with-extra-charsets=all" \
  117.        "–with-pthread" \
  118.        "–enable-static" \
  119.        "–enable-thread-safe-client" \
  120.        "–with-client-ldflags=-all-static" \
  121.        "–with-mysqld-ldflags=-all-static" \
  122.        "–enable-assembler" \
  123.        "–without-isam" \
  124.        "–without-innodb" \
  125.        "–without-ndb-debug"
  126. make && make install
  127. useradd mysql -d /data/mysql -s /sbin/nologin
  128. /usr/local/mysql/bin/mysql_install_db –user=mysql
  129. cd /usr/local/mysql
  130. chown -R root:mysql .
  131. chown -R mysql /data/mysql/data
  132. cp share/mysql/my-huge.cnf /etc/my.cnf
  133. cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
  134. chmod 755 /etc/rc.d/init.d/mysqld
  135. chkconfig –add mysqld
  136. /etc/rc.d/init.d/mysqld start
  137. cd /usr/local/mysql/bin
  138. for i in *; do ln -s /usr/local/mysql/bin/$i /usr/bin/$i; done
  139. cd /usr/local/src
  140. mysqladmin -u root password chenshake
  141. #安裝Apache
  142. tar zxvf httpd-2.2.8.tar.gz 
  143. cd httpd-2.2.8
  144. ./configure \
  145.        "–prefix=/usr/local/apache2" \
  146. "–with-included-apr" \
  147.        "–enable-so" \
  148.        "–enable-deflate=shared" \
  149.        "–enable-expires=shared" \
  150.        "–enable-rewrite=shared" \
  151.        "–enable-static-support" \
  152.        "–disable-userdir"
  153. make
  154. make install
  155. cd ..
  156. #安裝PHP
  157. tar jxvf php-5.2.6.tar.bz2
  158. cd php-5.2.6
  159. ./configure \
  160. "–prefix=/usr/local/php" \
  161. "–with-apxs2=/usr/local/apache2/bin/apxs" \
  162. "–with-config-file-path=/usr/local/php/etc" \
  163. "–with-mysql=/usr/local/mysql" \
  164. "–with-gd=/usr/local/gd2" \
  165. "–with-libxml-dir=/usr" \
  166. "–with-jpeg-dir" \
  167. "–with-png-dir" \
  168. "–with-freetype-dir" \
  169. "–with-zlib " \
  170. –with-iconv-dir=/usr/local \
  171. "–with-openssl=/usr/local/ssl" \
  172. "–with-curl " \
  173. "–with-curlwrappers " \
  174. "–with-mcrypt" \
  175. "–with-imap=/usr/local/imap-2007b" \
  176. "–with-kerberos" \
  177. "–with-bz2" \
  178. "–enable-soap" \
  179. "–enable-gd-native-ttf" \
  180. "–enable-ftp" \
  181. "–enable-mbstring" \
  182. "–enable-exif" \
  183. "–disable-ipv6" \
  184. "–disable-cgi" \
  185. "–disable-cli"   
  186. make
  187. make install
  188. mkdir /usr/local/php/etc
  189. cp php.ini-dist /usr/local/php/etc/php.ini
  190. cd ..
  191. #安裝Zend Optimizer (安裝Zend Optimizer過程的最后不要選擇重啟Apache。)
  192. tar xzvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
  193. cd ZendOptimizer-3.3.3-linux-glibc23-i386
  194. ./install.sh
  195. ##########################################################################

復制代碼

  1. sh install.sh

復制代碼

腳本到這里為止,因為zend的設置,我沒法自動完成,只能你手動設置,如果誰知道怎么做,麻煩指導指導,注意php.ini 的位置 /usr/local/php/etc/
#設置session的存放位置和修改php上次文件的大小,最大文件25m

  1. cp /usr/local/Zend/etc/php.ini /usr/local/Zend/etc/php.ini.save
  2. sed -i -e ‘991 s/;//’ /usr/local/Zend/etc/php.ini
  3. sed -i ‘s/post_max_size = 8M/ post_max_size = 30M/g’ /usr/local/Zend/etc/php.ini
  4. sed -i ‘s/upload_max_filesize = 2M/ upload_max_filesize = 25M/g’ /usr/local/Zend/etc/php.ini
  5. cd /usr/local/src

復制代碼

 

 

六:配置apache PHP
創建apache的啟動腳本,apache編譯包里帶的那個啟動腳本,有一個缺點,啟動和停止沒有任何提示,所以就用下面這個,比較方便。

  1. vi /etc/init.d/httpd

復制代碼

  1. ###################################
  2. #!/bin/bash
  3. #
  4. # Startup script for the Apache Web Server
  5. #
  6. # chkconfig: – 85 15
  7. # description: Apache is a World Wide Web server.   It is used to serve \
  8. #               HTML files and CGI.
  9. # processname: httpd
  10. # pidfile: /usr/local/apache2/logs/httpd.pid
  11. # config: /usr/local/apache2/conf/httpd.conf
  12. # Source function library.
  13. . /etc/rc.d/init.d/functions
  14. if [ -f /etc/sysconfig/httpd ]; then
  15.         . /etc/sysconfig/httpd
  16. fi
  17. # This will prevent initlog from swallowing up a pass-phrase prompt if
  18. # mod_ssl needs a pass-phrase from the user.
  19. INITLOG_ARGS=""
  20. # Path to the apachectl script, server binary, and short-form for messages.
  21. apachectl=/usr/local/apache2/bin/apachectl
  22. httpd=/usr/local/apache2/bin/httpd
  23. pid=/usr/local/apache2/logs/httpd.pid
  24. prog=httpd
  25. RETVAL=0
  26. # The semantics of these two functions differ from the way apachectl does
  27. # things — attempting to start while running is a failure, and shutdown
  28. # when not running is also a failure.   So we just do it the way init scripts
  29. # are expected to behave here.
  30. start() {
  31.          echo -n $"Starting $prog: "
  32.         daemon $httpd $OPTIONS
  33.          RETVAL=$?
  34.          echo
  35.          [ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
  36.         return $RETVAL
  37. }
  38. stop() {
  39.          echo -n $"Stopping $prog: "
  40.         killproc $httpd
  41.          RETVAL=$?
  42.          echo
  43.          [ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd $pid
  44. }
  45. reload() {
  46.          echo -n $"Reloading $prog: "
  47.         killproc $httpd -HUP
  48.          RETVAL=$?
  49.          echo
  50. }
  51. # See how we were called.
  52. case "$1" in
  53.    start)
  54.         start
  55.         ;;
  56.   stop)
  57.         stop
  58.         ;;
  59.   status)
  60.         status $httpd
  61.          RETVAL=$?
  62.          ;;
  63.   restart)
  64.         stop
  65.          start
  66.         ;;
  67.   condrestart)
  68.          if [ -f $pid ] ; then
  69.                  stop
  70.                  start
  71.          fi
  72.         ;;
  73.   reload)
  74.         reload
  75.         ;;
  76.   graceful|help|configtest|fullstatus)
  77.         $apachectl [email protected]
  78.         RETVAL=$?
  79.          ;;
  80.    *)
  81.          echo $"Usage: $prog {start|stop|restart|condrestart|reload|status"
  82.         echo $"|fullstatus|graceful|help|configtest}"
  83.         exit 1
  84. esac
  85. exit $RETVAL
  86. ###########################

復制代碼

設置可運行和開機啟動

  1. chmod +x /etc/rc.d/init.d/httpd
  2. chkconfig –add httpd
  3. chkconfig –level 3 httpd on

復制代碼

配置apache

  1. groupadd www -g 48
  2. useradd -u 48 -g www www
  3. mkdir -p /data/www/wwwroot/linux.com
  4. mkdir -p /data/www/wwwroot/test.com
  5. mkdir -p /data/logs
  6. chmod +w /data/www/wwwroot
  7. chown -R www:www /data/www/wwwroot
  8. cp /usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf.save

復制代碼

編輯httpd.conf

  1. sed -i -e ‘121 s/^/#/’ -i -e ‘122 s/^/#/’ /usr/local/apache2/conf/httpd.conf
  2. sed -i -e "s/User daemon/User www/" -i -e "s/Group daemon/Group www/" /usr/local/apache2/conf/httpd.conf
  3. sed -i ‘s/DirectoryIndex index.html/ DirectoryIndex index.php index.html index.htm/g’ /usr/local/apache2/conf/httpd.conf
  4. sed -i -e ‘101 s/^#//g’ -i -e ‘374 s/^#//g’ -i -e ‘389 s/^#//g’ -i -e ‘392 s/^#//g’ -i -e ‘401 s/^#//g’ /usr/local/apache2/conf/httpd.conf
  5. sed -i "58 s/^/AddType application\/x-httpd-php .php/" /usr/local/apache2/conf/httpd.conf

復制代碼

編輯php.ini

  1. cp /usr/local/php/etc/php.ini /usr/local/php/etc/php.ini.save
  2. sed -i ‘205 s#;open_basedir =#open_basedir = /data/www/wwwroot:/tmp#g’ /usr/local/php/etc/php.ini
  3. sed -i ‘/expose_php/s/On/Off/’ /usr/local/php/etc/php.ini
  4. sed -i ‘/display_errors/s/On/Off/’ /usr/local/php/etc/php.ini

復制代碼

 

 

配置虛擬主機
備份相關配置文件

  1. mv /usr/local/apache2/conf/extra/httpd-vhosts.conf /usr/local/apache2/conf/extra/httpd-vhosts.conf.save
  2. mv /usr/local/apache2/conf/extra/httpd-default.conf /usr/local/apache2/conf/extra/httpd-default.conf.save
  3. mv /usr/local/apache2/conf/extra/httpd-mpm.conf /usr/local/apache2/conf/extra/httpd-mpm.conf.save

復制代碼

創建3個apache相關的文件

  1. vi /usr/local/apache2/conf/extra/httpd-vhosts.conf

復制代碼

  1. NameVirtualHost *:80
  2. <VirtualHost *:80>
  3.     ServerAdmin [email protected]
  4.     DocumentRoot "/data/www/wwwroot/test.com"
  5.     ServerName test.com
  6.     ServerAlias bbs.test.com
  7.     ErrorLog "logs/test.com-error_log"
  8.     CustomLog "|/usr/local/cronolog/sbin/cronolog /data/logs/access_www.test.com.%Y%m%d" combined
  9. </VirtualHost>
  10. <VirtualHost *:80>
  11.     ServerAdmin [email protected]
  12.     DocumentRoot "/data/www/wwwroot/linux.com"
  13.     ServerName linux.com
  14.     ServerAlias bbs.linux.com
  15.     ErrorLog "logs/linux.com-error_log"
  16.     CustomLog "|/usr/local/cronolog/sbin/cronolog /data/logs/access_www.linux.com.%Y%m%d" combined
  17. </VirtualHost>

復制代碼

  1. vi /usr/local/apache2/conf/extra/httpd-default.conf

復制代碼

  1. Timeout 15
  2. KeepAlive Off
  3. MaxKeepAliveRequests 50
  4. KeepAliveTimeout 5
  5. UseCanonicalName Off
  6. AccessFileName .htaccess
  7. ServerTokens Prod
  8. ServerSignature Off
  9. HostnameLookups Off

復制代碼

  1. vi /usr/local/apache2/conf/extra/httpd-mpm.conf

復制代碼

  1. <IfModule mpm_prefork_module>
  2.     ServerLimit         2000
  3.     StartServers          10
  4.     MinSpareServers       10
  5.     MaxSpareServers      15
  6.     MaxClients          2000
  7.     MaxRequestsPerChild   10000
  8. </IfModule>

復制代碼

 

七:測試
修改本地hosts文件
192.168.1.200    www.test.com
啟動Apache

  1. service httpd start

復制代碼

測試php

  1. cd /data/www/wwwroot/test.com
  2. vi info.php

復制代碼

  1. <?
  2. phpinfo()
  3. ?>

復制代碼

這個時候 http://192.168.1.200/info.php 或者 http://www.test.com/info.php 就可以看到php的信息。
安裝phpadmin

  1. cd /usr/local/src
  2. tar zxvf phpMyAdmin-2.11.8.1-all-languages-utf-8-only.tar.gz
  3. cp -rf phpMyAdmin-2.11.8.1-all-languages-utf-8-only /data/www/wwwroot/test.com/phpmyadmin
  4. cd /data/www/wwwroot/test.com/phpmyadmin
  5. cp config.sample.inc.php config.inc.php
  6. sed -i -e "/^\$cfg\[‘blowfish_secret’\]/{ [email protected]”;@’88888888888888888’;@; }" config.inc.php

復制代碼

這個時候,你就可以通過 http://192.168.1.200/phpmyadmin 或者http://www.test.com/phpmyadmin 來進行數據庫管理, 我上面已經給mysql設置的密碼。
user:root
password:chenshake
安裝sugarcrm
sugarcrm的郵件模塊需要用到imap,ssl,所以我編譯的時候,需要吧imap,curl模塊編譯進去.

  1. cd /usr/local/src
  2. unzip SugarCE-5.1.0.zip
  3. mv SugarCE-Full-5.1.0/ /data/www/wwwroot/test.com/sugarcrm
  4. chmod -R 777 /data/www/wwwroot/test.com/sugarcrm/

復制代碼

文章出自:CCIE那點事 http://www.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文鏈接:http://www.qdxgqk.live/?p=3066轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
?
?
萌宠夺宝游戏