顯示具有 Apache 標籤的文章。 顯示所有文章
顯示具有 Apache 標籤的文章。 顯示所有文章

2009年10月5日 星期一

Apache讀php基本組態設定

1.選"yast > 軟體管理 > http伺服器 >伺服器模組" php5勾選啟動
2.主要的組目態目錄路徑:/etc/apache2
3.相關主要設定檔如下:
    • /etc/apache2/httpd.conf  
      • 設定預設讀取網頁 DirectoryIndex --->加上index.php (注意排列的順序,排在前面的優先實體檔案index.php請放在/srv/www/htdocs下) 
    • /etc/apache2/default-server.conf
      • 其中有一行設定:Include /etc/apache2/conf.d/*.conf,表示其他設定可參考其他的conf檔
      • 其中/etc/apache2/conf.d/php5.conf 設定表示如果讀取到php的檔案,轉交php模組.(檔案中語法DirectoryIndex index.php)
    • /etc/apache2/listen.conf --->設定listen的ip以及port
        • Listen 80  --->也可以再新增網站IP:8080
      4.設定完後 /etc/init.d/apache2 restart --->重啟apache2

      2009年10月4日 星期日

      Apache網頁伺服器架設

      官方網站 : http://httpd.apache.org/

      Apache有以下的版本
      • Version 2.2
      • Version 2.0
      • Version 1.3

      Apache V2.x的特點:
      • 支持Thread多執行緒 (Linux kernel 加上了pthread,所以Apache也加上了支援)
      • 適用於windows上

      安裝相關套件:
      安裝完畢後,選"yast > 軟體管理 > http伺服器"中設定
      • 將php5,perl,python啟用(外掛在apache2)
      • apache2 service勾選啟動
      User_Directory 

      #su - max --->apache 啟動後,切換到一般使用者
      max ~> cd  public_html --->apache自動在使用者家目錄下建立了public_html目錄 (注意owner讀取的權限)
      max ~/public_html> vi test.html --->建立一個html測試檔


      Firefox中輸入http://網站IP/~max/test.html   --->會看到測試網頁出現了