apache2安装配置

apache的编译安装主要是要选择怎样编译模块,需要哪些模块,是编译成shared呢还是static.这个需要一定的经验,最保险的就是选择大部分shared,有这个configure选项.

apache的运行停止
$APACHE_HOME/bin/apachectl -k start|stop

apache的配置文件httpd.conf
apache有一个AddDefaultCharset选项,可以强制将网页内容编码为指定格式
这样容易产生乱码,可以注释掉,由网页的编码设置来决定编码

ServerRoot "/home/outer/opt/apache2"
Listen 8080
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User outer
Group outer
</IfModule>
</IfModule>
ServerAdmin you@example.com
ServerName 127.0.0.1:8080
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/home/linvar/dev/jobs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "logs/error_log"
LogLevel warn

<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" common
</IfModule>

DefaultType text/plain

<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "/home/linvar/dev/jobs/HelloPhp"
ServerName testing.com
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/home/linvar/dev/jobs/zhoubiantao_php"
ServerName taobao.chunge.com
</VirtualHost>

LoadModule php5_module modules/libphp5.so
AddHandler application/x-httpd-php .php
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值