SVN 安裝 mod_auth_mysql實現MySQL認證

來源:互聯網
上載者:User

需要提前安裝好的軟體:svn;apache2.2.x;mysql5.1

目標:通過mod_auth_mysql模組實現apache的mysql 認證

需要下載軟體:mod_auth_mysql,:http://www.heuer.org/mod_auth_mysql/

這裡邊有已經編譯好的mod_auth_mysql.so for apache2.2.x,需要 libmysqlclient.so.15

也有原始碼,可以編譯安裝,本文選擇原始碼安裝方式

按照他的install說明進行安裝,因為我的apache不是裝在預設路徑下,所以可以兩種方式編譯檔案

修改mod_auth_mysql.c 檔案,將#include<mysql/mysql.h> 改為 #include </mysql_install_path/include/mysql/mysql.h>
在 apxs -cia -lmysqlclient mod_auth_mysql.c 基礎上加上-I /mysql_install_path/include -L /mysql_install_path/lib
無論使用哪種方式都可以正常編譯,這裡使用第一種方式,執行apxs -cia -lmysqlclient mod_auth_mysql.c,如果沒有將apache安裝目錄設定成環境變數的話,需要制定apxs的路徑/apache_install_path/bin/apxs -cia -lmysqlclient mod_auth_mysql.c。

編譯執行通過。會提示安裝成功。

如果編譯提示錯誤,/usr/bin/ld: cannot find -lmysqlclient

解決方案: apt-get install libmysqlclient15-dev

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.