LAMP麻辣網站的搭建

 

麻辣火鍋之——LAMP
 
今天研究了一天,終於把這道菜給弄出鍋了,餓都餓死了嘿嘿。
公司需求:
公司要求花錢少,網站安全,容易維護,數據能夠實時更新。
公司環境:硬件:三臺hp服務器;軟件:linux企業版系統盤一張。
基本要求分析:公司要求儘快網站基本上線,以後再考慮擴展性。
任務規劃:考慮到公司的長遠發展需求,我們給公司計劃三期完成中到大型網站的規劃。
一期基本上線,二期擴展,三期加固網絡節點。
              一期基本上線
首先安裝好企業版linux系統:在此平臺上搭建網站.
 
(1). A pache的安裝: [root@www test]# ls

httpd-2.2.4  httpd-2.2.4.tar.bz2  mysql-5.0.41.tar.gz  php-5.2.4.tar.bz2  zzr.html

1. [root@www test]# tar -jxvf httpd-2.2.4.tar.bz2

2. [root@www test]# cd httpd-2.2.4

3. [root@www test]# ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --with-mysql=/usr/local/mysql --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --enable-static-support --enable-static-htpasswd --enable-static-htdigest --enable-static-rotatelogs --enable-static-logresolve --enable-static-htdbm --enable-static-ab --enable-static-checkgid --disable-cgid --disable-cgi  --enable-ssl --with-ssl=/usr/include/openssl

4. [root@www test]# make

5. [root@www test]# make install

(2). M ysql的安裝:

1. [root@www test]# tar -zxvf mysql-5.0.41.tar.gz

2. [root@www mysql-5.0.41]# cd mysql-5.0.41

3. [root@www mysql-5.0.41]# groupadd mysql  

4. [root@www mysql-5.0.41]# useradd -g mysql mysql

5. [root@www mysql-5.0.41]# ./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=mysql --without-debug --with-big-tables --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler

config.status: ib_config.h is unchanged

config.status: executing depfiles commands

 

MySQL has a Web site at [url]http://www.mysql.com/ which carries details on the[/url]

latest release, upcoming features, and other information to make your

work or play with MySQL more productive. There you can also find

information about mailing lists for MySQL discussion.

 

Remember to check the platform specific part of the reference manual for

hints about installing MySQL on your platform. Also have a look at the

files in the Docs directory.

 Thank you for choosing MySQL!

6. [root@www mysql-5.0.41]# make

make[3]: Leaving directory `/test/mysql-5.0.41/server-tools/instance-manager'

make[3]: Entering directory `/test/mysql-5.0.41/server-tools'

make[3]: Nothing to be done for `all-am'.

make[3]: Leaving directory `/test/mysql-5.0.41/server-tools'

make[2]: Leaving directory `/test/mysql-5.0.41/server-tools'

make[1]: Leaving directory `/test/mysql-5.0.41'

7. [root@www mysql-5.0.41]# make install

make[4]: Nothing to be done for `install-data-am'.

make[4]: Leaving directory `/test/mysql-5.0.41/server-tools/instance-manager'

make[3]: Leaving directory `/test/mysql-5.0.41/server-tools/instance-manager'

make[3]: Entering directory `/test/mysql-5.0.41/server-tools'

make[4]: Entering directory `/test/mysql-5.0.41/server-tools'

make[4]: Nothing to be done for `install-exec-am'.

make[4]: Nothing to be done for `install-data-am'.

make[4]: Leaving directory `/test/mysql-5.0.41/server-tools'

make[3]: Leaving directory `/test/mysql-5.0.41/server-tools'

make[2]: Leaving directory `/test/mysql-5.0.41/server-tools'

make[1]: Leaving directory `/test/mysql-5.0.41'

(3)php的安裝:

  1. [root@www test]# tar -jxvf php-5.2.4.tar.bz2

php-5.2.4/README.UPDATE_5_2

php-5.2.4/README.UNIX-BUILD-SYSTEM

php-5.2.4/buildconf.bat

2.  [root@www test]#   cd php-5.2.4

3.   [root@www php-5.2.4]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/etc --disable-ipv6 --with-openssl

+--------------------------------------------------------------------+

| License:                                                           |

| This software is subject to the PHP License, available in this     |

| distribution in the file LICENSE.  By continuing this installation |

| process, you are bound by the terms of this license agreement.     |

| If you do not agree with the terms of this license, you must abort |

| the installation process at this point.                            |

+--------------------------------------------------------------------+

 

Thank you for using PHP.

4.   [root@www php-5.2.4]# make

Build complete.

Don't forget to run 'make test'.

5.   [root@www php-5.2.4]# make  test

6.   [root@www php-5.2.4]# make install

Installing PEAR environment:      /usr/local/php/lib/php/

[PEAR] Console_Getopt - installed: 1.2.3

[PEAR] Archive_Tar    - installed: 1.3.2

[PEAR] Structures_Graph- installed: 1.0.2

pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)

[PEAR] PEAR           - installed: 1.6.1

Wrote PEAR system config file at: /usr/local/php/etc/pear.conf

You may want to add: /usr/local/php/lib/php to your php.ini include_path

Installing PDO headers:          /usr/local/php/include/php/ext/pdo/

7. [root@www php-5.2.4]# cp php.ini-dist /etc

8.測試安裝是否成功:

                  麻辣火鍋之——LAMP    
(1) [root@www ~]# vi /usr/local/apache2/conf/httpd.conf

LoadModule php5_module        modules/libphp5.so  (若未安裝php時,此行需註釋)

AddType application/x-httpd-php .php

[root@www test]#  make  test.php

[root@www test]# vi test.php

 

<?php

phpinfo();

?>

[root@www test]# /usr/local/apache2/bin/apachectl start

9.測試安裝是否成功:在瀏覽器中訪問php頁面;

注:若網頁不出來時,可更改頁網頁的目錄,若提示權限時,改權限。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章