本文发表在 rolia.net 枫下论坛原先的apache是打包在一个应用软件myapp中的,安装后其httpd.conf放在/usr/local/myapp/apache/conf下,内容见后,其使用8000端口.我重新编译安装的apache使用缺省配置80端口.
现在我执行/usr/local/myapp/apache_new/bin/apachectl start后apache打开的竟然是8000端口,奇怪.为什么不启动这个全新的apache环境呢?
-------------------------
老的/usr/local/myapp/apache/conf/httpd.conf
ServerRoot "/usr/local/myapp/apache"
PidFile logs/httpd.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 1
MinSpareServers 2
MaxSpareServers 2
MaxClients 150
MaxRequestsPerChild 200
</IfModule>
<IfModule worker.c>
StartServers 1
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 200
</IfModule>
<IfModule perchild.c>
NumServers 1
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 200
</IfModule>
ServerAdmin support@myapp.com
ServerName 127.0.0.1
UseCanonicalName Off
DocumentRoot "/usr/local/myapp/apache/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/usr/local/myapp/apache/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DirectoryIndex /cgi-bin/myapp.exe
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog /dev/null
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /dev/null common
ServerSignature On
ScriptAlias /cgi-bin/ "/usr/local/myapp/apache/cgi-bin/"
<Directory "/usr/local/myapp/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
<IfDefine SSL>
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache dbm:logs/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:logs/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
<VirtualHost _default_:443>
DocumentRoot "/usr/local/myapp/apache/htdocs"
ServerName 127.0.0.1:443
ErrorLog logs/error_log
TransferLog /dev/null
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/myapp/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/myapp/apache/conf/ssl.key/server.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/myapp/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /dev/null_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
</IfDefine>
Listen 8000
User mike
Group mike
-------------------------更多精彩文章及讨论,请光临枫下论坛 rolia.net
现在我执行/usr/local/myapp/apache_new/bin/apachectl start后apache打开的竟然是8000端口,奇怪.为什么不启动这个全新的apache环境呢?
-------------------------
老的/usr/local/myapp/apache/conf/httpd.conf
ServerRoot "/usr/local/myapp/apache"
PidFile logs/httpd.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 1
MinSpareServers 2
MaxSpareServers 2
MaxClients 150
MaxRequestsPerChild 200
</IfModule>
<IfModule worker.c>
StartServers 1
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 200
</IfModule>
<IfModule perchild.c>
NumServers 1
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 200
</IfModule>
ServerAdmin support@myapp.com
ServerName 127.0.0.1
UseCanonicalName Off
DocumentRoot "/usr/local/myapp/apache/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/usr/local/myapp/apache/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DirectoryIndex /cgi-bin/myapp.exe
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog /dev/null
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /dev/null common
ServerSignature On
ScriptAlias /cgi-bin/ "/usr/local/myapp/apache/cgi-bin/"
<Directory "/usr/local/myapp/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
<IfDefine SSL>
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache dbm:logs/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:logs/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
<VirtualHost _default_:443>
DocumentRoot "/usr/local/myapp/apache/htdocs"
ServerName 127.0.0.1:443
ErrorLog logs/error_log
TransferLog /dev/null
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/myapp/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/myapp/apache/conf/ssl.key/server.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/myapp/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /dev/null_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
</IfDefine>
Listen 8000
User mike
Group mike
-------------------------更多精彩文章及讨论,请光临枫下论坛 rolia.net