Apache:Web服务供应者。官网:www.apache.org
PHP:官网:www.php.net
Mysql:官网:www.mysql.com
Apache下载地点:http://download.csdn.net/detail/lxq_xsyu/7057423
PHP下载地点:http://download.csdn.net/detail/lxq_xsyu/7057401
Mysql下载地点:http://download.csdn.net/detail/lxq_xsyu/6468461
(1)Apache安装
安装乐成
(2)解压PHP5.4
(3)设置Apache的httpd.conf文件
Apache安装目次
监听端口
- ServerRoot"D:/ApacheSoftwareFoundation"
- #Listen12.34.56.78:80
- Listen80
载进PHP组件
服务器称号
- LoadModulephp5_module"D:/php54/php5apache2_2.dll"
文件根目次
- #ServerNamewww.meritit.com:80
权限文件夹
- DocumentRoot"D:/ApacheSoftwareFoundation/htdocs"
- <Directory"D:/ApacheSoftwareFoundation/htdocs">
索引(默许会见主页)毛病日记
- <IfModuledir_module>
- DirectoryIndexindex.html
- </IfModule>
- ErrorLog"logs/error.log"
会见日记
- CustomLog"logs/access.log"common
设置剖析php
- AddTypeapplication/x-compress.Z
- AddTypeapplication/x-gzip.gz.tgz
- AddTypeapplication/x-httpd-php.php
毛病范例
- #ErrorDocument500"Theservermadeabooboo."
- #ErrorDocument404/missing.html
- #ErrorDocument404"/cgi-bin/missing_handler.pl"
- #ErrorDocument402http://www.meritit.com/subscription_
新建a.php
- <?php
- phpinfo();
- ?>
能够看到找不到php的设置文件,我们在apache设置文件中指定一下php的设置文件目次
- PHPIniDir"D:/php54"
往失落下面正文(翻开假造主机设置文件)在httpd-vhosts.conf中设置了两个站点以下
- #Virtualhosts
- Includeconf/extra/httpd-vhosts.conf
- <VirtualHost*:80>
- DocumentRoot"D:/ApacheSoftwareFoundation/a_com"
- ServerName127.0.0.2
- ServerAliaswww.dummy-host.meritit.com
- ErrorLog"logs/dummy-host.meritit.com-error.log"
- CustomLog"logs/dummy-host.meritit.com-access.log"common
- </VirtualHost>
- <VirtualHost*:80>
- DocumentRoot"D:/ApacheSoftwareFoundation/b_com"
- ServerName127.0.0.3
- ErrorLog"logs/dummy-host2.meritit.com-error.log"
- CustomLog"logs/dummy-host2.meritit.com-access.log"common
- </VirtualHost>
注重:一旦设置了假造主机,后面设置的DocumentRoot就有效了。
D:ApacheSoftwareFoundationa_coma.php
D:ApacheSoftwareFoundation_com.php
- <?php
- echo"aaaaaa";
- ?>
注重:要修正权限文件夹目次
- <?php
- echo"bbbbbb";
- ?>
会见了局:
欢迎光临 仓酷云 (http://ckuyun.com/) | Powered by Discuz! X3.2 |