linux+apache+mysql+php

來源:互聯網
上載者:User

1.安裝環境
作業系統:Red Hat Linux Enterprise AS 4.0
資料庫:MySQL 5.0.24
Web伺服器:Apache 2.2.3
指令碼語言:PHP 5.1.6

2.安裝MySQL 5.0.24
-------------下載軟體包mysql-5.0.24.tar.gz,地址http://www.mysql.com-------------
# tar zvxf mysql-5.0.24.tar.gz //解壓縮
# cd mysql-5.0.24 //進入解壓縮後的檔案目錄
# ./configure --prefix=/usr/local/mysql \ //設定安裝目錄
--enable-thread-safe-client \ //編譯安全執行緒版的用戶端庫
--without-debug \ //關閉debug功能
--localstatedir=/data/mysqldata \ //設定資料庫檔案目錄
# make //編譯
# make install //安裝
# /usr/local/mysql/bin/mysql_install_db //初始化授權
# chown –R root:root /usr/local/mysql //檔案屬性改為root使用者
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf //複製設定檔
----------------------------------啟動MySQL服務----------------------------------
# /usr/local/mysql/bin/mysqld_safe --user=root & //啟動MySQL
----------------------------------修改MySQL密碼----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot password mysqlsecret //修改密碼
----------------------------------關閉MySQL服務----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot -pmysqlsecret shutdown//關閉MySQL

3.安裝Apache 2.2.3
-------------下載軟體包httpd-2.2.3.tar.gz,地址http://www.apache.org-------------
# tar zvxf httpd-2.2.3.tar.gz
# cd httpd-2.2.3
# ./configure --prefix=/usr/local/apache \
--enable-module=most \
--enable-shared=max
# make
# make install
----------------------------------啟動Apache服務----------------------------------
# /usr/local/apache/bin/apachectl start
----------------------------------關閉Apache服務----------------------------------
# /usr/local/apache/bin/apachectl stop
----------------------------------重啟Apache服務----------------------------------
# /usr/local/apache/bin/apachectl restart

4.安裝PHP 5.1.6
-------------------下載軟體包php-5.1.6.tar.gz,地址www.php.net--------------------
# tar zvxf php-5.1.6.tar.gz
# cd php-5.1.6
# ./configure --prefix=/usr/local/php \
--with-mysqld=/usr/local/mysql \
--with-apxs2=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini

5.配置Apache服務的httpd.conf檔案
*在LoadModule處添加 LoadModule php5_module module/libphp5.so
*在DirectoryIndex處添加 index.php
*在AddType application處添加
AddType application/x-httpd-php .php .phtml
AddType applicatoin/x-httpd-php-source .phps

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.