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
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