Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1783365
  • 博文数量: 293
  • 博客积分: 10127
  • 博客等级: 上将
  • 技术积分: 3029
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-12 19:05
文章分类

全部博文(293)

文章存档

2011年(11)

2010年(282)

我的朋友

分类: BSD

2010-08-12 19:20:38

以最简便的ports的方式来进行安装

步骤:

Apache安装

#cd /usr/ports/www/apache22

#make install clean

在选择模块中,选取常用的模块或者选择默认模块。

PHP安装

#cd /usr/ports/lang/php5

#make install clean

选择常用模块,把apache模块也选上

#cd /usr/ports/lang/php5-extensions

#make install clean

选择常用模块,记得添加mysql模块,以对mysql数据库的支持。

安装完成以后,配置httpd.conf文件,修改其中内容。

httpd.conf

Listen 80改为Listen IP:80

ServerAdmin you@example.com  改为常用联系邮箱 ServerAdmin 285602235@qq.com

ServerName server.com:80 改为网站域名  ServerName  

查找Directory,DirectoryIndex 行后面添加 index.php

之间添加

AddType application/x-httpd-php .php

添加注释: #CustomLog "/usr/log/httpd-access.log" combined

添加

MaxKeepAliveRequests 300

StartServers       50  

MinSpareServers    50

MaxSpareServers    100

ServerLimit      8000

MaxClients       8000

MaxRequestsPerChild  100

忽略大小写 ,编辑 # vi /usr/local/etc/apache22/Includes/ignoreCase.conf

添加如下内容 CheckSpelling On

禁止列目录---编辑 # vi /usr/local/etc/apache22/httpd.conf

     找到    

添加  Options -Indexes 

Apache的启动与关闭:

    #/usr/local/etc/rc.d/apache22 start

  #/usr/local/etc/rc.d/apache22 stop

阅读(791) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~