zoukankan      html  css  js  c++  java
  • PHP-MYSQL-APACHE配置

      1 PHP-MYSQL-APACHE配置
      2 1.在Apache的配置文件下
      3 http.conf 
      4 LoadModule php_module "$:/filename/php5apache2_2.dll" 
      5 //要的是绝对路径
      6  
      7 //指定php后缀
      8 <FilesMatch ".php$">
      9 setHandler application/x-httpd-php
     10 </FilesMatch>
     11  
     12 tips:Apache每次修改配置文件 必须重新启动
     13  
     14 检测Apache配置是否有语法错误
     15 ./bin/httpd.exe
     16 httpd.exe -t 如果没有语法错误 return syntax OK 
     17  
     18 系统环境变量配置:添加httpd.exe 到系统path路径下。
     19 2.时区配置
     20 php.ini配置
     21 php.ini-development 开发用
     22 php.ini-production  产品阶段
     23  
     24 修改php.ini 
     25 查找关键字:timeone
     26 date.timeone=PRC//PRC代表中国时区
     27 在Apache配置文件httpd.conf设置php.ini
     28 PHPIniDir "$:/----/php"
     29  
     30 配置mysql模块
     31 extension=php_mysql.dll   //开启
     32 extension_dir="$:/----/php/ext"
     33 3.主机配置
     34 主机名 :ServerName 服务器名
     35 站点名 :DocumentRoot "实际物理位置"
     36 单站点配置:
     37 #Listen 12.34.56.78:80
     38 Listen 80
     39 设置主机名字:
     40 ServerName localhost
     41 主机物理地址:
     42 DocumentRoot "实际物理路径"
     43 DoucmentRoot "原配置/htdocs/"
     44 DocumentRoot "$:/--/doc"
     45  
     46 更改之后:
     47 <Directory "个人配置路径">
     48 Options Indexes
     49 Order Deny,Allow
     50 Allow from all
     51 DirectoryIndex index.html index.php default.php
     52 </Directory>
     53  
     54 .htaccess 配置
     55 4.多站点配置
     56    在Apache配置文件httpd.conf 
     57    修改
     58    #Virtual hosts
     59    #Include conf/extra/httpd-vhosts.conf
     60    修改为:
     61    Include conf/extra/httpd-vhosts.conftips:去掉#
     62    NameVirtualHost *:80 //默认
     63    
     64    配置一个站点:
     65    <VirtualHost *:80>
     66    ServerName www.example.com
     67    DocumentRoot "$:/--/"  //实际路径
     68    <Directory "$:/--/">
     69    Options Indexes
     70    Order Deny,Allow
     71    Allow From All
     72    </Directory>
     73    </VirtualHost>
     74  
     75    站点别名:
     76    <VirtualHost *:80>
     77    ServerName www.example.com
     78    ServerAlias aa.example.com bb.example.com
     79    DocumentRoot "$:/--/"  //实际路径
     80    <Directory "$:/--/">
     81    Options Indexes
     82    Order Deny,Allow
     83    Allow From All
     84    </Directory>
     85   </VirtualHost>
     86  
     87    目录别名:
     88    Alias /abc "$:/--/" //实际路径
     89     <VirtualHost *:80>
     90    ServerName www.example.com
     91    ServerAlias aa.example.com bb.example.com
     92    DocumentRoot "$:/--/"  //实际路径
     93    <Directory "$:/--/">
     94    Options Indexes
     95    Order Deny,Allow
     96    Allow From All
     97    </Directory>
     98   </VirtualHost>
     99    
    100  
    Never try,never know
  • 相关阅读:
    Celery
    windows笔记目录
    Linux笔记目录
    python笔记目录
    rsa
    c#目录
    webpack3.x配置
    RabbitMQ服务安装(Linux)
    JavaScript验证用户输入
    IP地址检测工具
  • 原文地址:https://www.cnblogs.com/sharecorner/p/sharecorner.html
Copyright © 2011-2022 走看看