• 关于

    mod_rewrite

    的搜索结果

回答

 Apache已经安装完毕并投入运行,但是后来却发现部分模块没有加载,当然有两个方法:   1. 一是完全重新编译Apache, 再安装   2. 编译模块为SO文件,使用LoadModule指令加载扩展模块。   apache安装后追加mod_rewrite   1.apache1.3   apache_1.3.34.tar.gz 解压后的目录为 /root/apache_1.3.34 文中简称为“源码目录”   apache安装目录 /usr/local/apache 文中简称为“目标目录”   步骤:   1、Apache安装rewrite模块的时候需要DBM支持,否则无法编译,所以首先要安装一个GDBM   下载地址:ftp://ftp.gnu.org/gnu/gdbm/   安装步骤:   进入安装目录,   ./configure   make   make install   make install-compat (最后行也要执行。否则无法编译出ndbm.h头文件)   如果您不能确定服务器上是否已经装有DBM,那么可以安装一下。否则这步可以跳过。   2、现在到apache源码目录的标准模块目录中(/root/apache_src/src/modules/standard/)中,使用如下指令编译出so文件:   /usr/local/apache/bin/apxs -c mod_rewrite.c -lgdbm   即可得到mod_rewrite.so文件。   备注:"-lgdbm"是用为说明在编译mod_rewrite.c时要把gdbm链接进来。这样在第6步启动apache时就不会报出"dbm fetch"的错误了。   3、现在让apache的apxs来自动向http.conf配置文件中加入LoadModule语句并将mod_rewrite.so文件拷贝到apache/libexec目录    /usr/local/apache/bin/apxs -i -A -n rewrite /root/apache_1.3.34/src/modules/standard/mod_rewrite.so  备注:命令中的rewrite参数是告诉apxs命令mod_rewrite.so文件中的模块名。在命令执行后,apxs会在LoadModule中为 rewrite加上"_module"以标名模块名称。   如果你在启动apache时发现总是给出“不能定位API”之类的错误,那就是说明LoadModule后面的模块名的语法要根据您的apache版本加以改变。   4、停止apache   apache/bin/apachectl stop   5、运行配置文件检查命令   apache/bin/apachectl configtest   如显示Syntax OK,则表示整个操作成功。那么可以到第6步。否则根据提示信息进行调试。但只要按照此文所说进行操作是不会出错的。   6、启动apache。   apache/bin/apachectl start 答案来源于网络

养狐狸的猫 2019-12-02 02:16:50 0 浏览量 回答数 0

回答

在我开时打开模式不一样:apache的.htaccess配置文件是以:RewriteEngine On 将写模式打开。Apache伪静态html(URL Rewrite)设置法phpma一 打开 Apache 的配置文件 httpd.conf 。phpma二 将#LoadModule rewrite_module modules/mod_rewrite前面的#去掉phpma三 在 httpd.conf中添加: RewriteEngine On #RewriteCond %{ENV:SCRIPT_URL} (?:index|dispbbs)[-0-9]+.html RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+).html$ $1.php? __is_apache_rewrite=1&__rewrite_arg=$2iis的httpd.ini配置文件是以:[ISAPI_Rewrite] 将写模式打开。打开你的httpd.ini,找到[ISAPI_Rewrite] 3600 = 1 hour CacheClockRate 3600RepeatLimit 32 Protect httpd.ini and httpd.parse.errors files from accessing through HTTP RewriteRule ^(.*)/archiver/([a-z0-9-]+.html)$ $1/archiver/index.php?$2 RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3 RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3 RewriteRule ^(.*)/profile-(username|uid)-(.+?).html$ $1/viewpro.php?$2=$3

我的中国 2019-12-02 01:33:21 0 浏览量 回答数 0

回答

问题描述 如何开启 Apache 伪静态模块. 解决方案 1.在 Apache 配置中启用 Rewrite,打开配置文件 httpd.conf, 若无法找到此文件,可使用 find / -name httpd.conf 如下图所示: 注意:本文搜索的httpd.conf的路径是 /etc/httpd/conf/httpd.conf 文件,此文对此进行说明。 找到 # LoadModule rewrite_module modules/mod_rewrite.so 去除前面的 #,开启伪静态模块。 注意:Linux 中 # 代表注释信息 修改前: # LoadModule rewrite_module modules/mod_rewrite.so 修改后:  LoadModule rewrite_module modules/mod_rewrite.so 2.启用 .htaccess在系统配置项中找到 Apache 的配置文件 /etc/httpd/conf/httpd.conf 将 AllowOverride None    修改为: AllowOverride All(对于配置文件,建议在修改前做下备份) 到此伪静态已经开启成功。

KB小秘书 2019-12-02 01:27:45 0 浏览量 回答数 0

万券齐发助力企业上云,爆款产品低至2.2折起!

限量神券最高减1000,抢完即止!云服务器ECS新用户首购低至0.95折!

问题

.htaccess无效,应该是rewrite_module没有开启

在下叶良辰 2019-12-01 20:07:34 2047 浏览量 回答数 1

问题

win2003配置ISAPI_Rewrite实现网站伪静态

小柒2012 2019-12-01 21:37:36 6257 浏览量 回答数 5

问题

刚装的WAMP最新的 外网不能访问啊

nieky 2019-12-01 20:58:24 3743 浏览量 回答数 1

问题

云服务器 ECS Apache 如何开启伪静态模块

boxti 2019-12-01 21:54:25 1595 浏览量 回答数 0

回答

首先确定您使用的 Apache 版本,还有是否加载了 mod_rewrite 模块。 Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码: LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c Apache 2.x 的用户请检查 conf/httpd.conf 中是否存在如下一段代码: LoadModule rewrite_module modules/mod_rewrite.so 如果存在,那么在配置文件(通常就是 conf/httpd.conf)中加入如下代码。此时请务必注意,如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置,即 <VirtualHost> 中去,如果加在虚拟主机配置外部将可能无法使用。改好后将 Apache 重启。 <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-] \.html)$ $1/archiver/index.php?$2 RewriteRule ^(.*)/forum-([0-9] )-([0-9] )\.html$ $1/forumdisplay.php?fid=$2&page=$3 RewriteRule ^(.*)/thread-([0-9] )-([0-9] )-([0-9] )\.html$ $1/viewthread.php?tid=$2&extra=page\=$4&page=$3 RewriteRule ^(.*)/space-(username|uid)-(. )\.html$ $1/space.php?$2=$3 RewriteRule ^(.*)/tag-(. )\.html$ $1/tag.php?name=$2 </IfModule> 如果没有安装 mod_rewrite,您可以重新编译 Apache,并在原有 configure 的内容中加入 --enable-rewrite=shared,然后再在 Apache 配置文件中加入上述代码即可。

cuinew 2019-12-02 02:38:41 0 浏览量 回答数 0

回答

Nginx.conf : user  oschina; worker_processes  2; #error_log  logs/error.log; #error_log  logs/error.log  notice; #error_log  logs/error.log  info; #pid        logs/nginx.pid; events {     use epoll;     worker_connections  2048; } http {     include       mime.types;     default_type  application/octet-stream;     #log_format  main  '$remote_addr - $remote_user [$time_local] $request '     #                  '"$status" $body_bytes_sent "$http_referer" '     #                  '"$http_user_agent" "$http_x_forwarded_for"';     #access_log  off;     access_log  logs/access.log;     client_header_timeout  3m;     client_body_timeout    3m;     send_timeout           3m;       client_header_buffer_size    1k;     large_client_header_buffers  4 4k;     sendfile        on;     tcp_nopush      on;     tcp_nodelay     on;     #keepalive_timeout  75 20;     include    gzip.conf;         server {     listen 80;     server_name .oschina.net;     location / {         rewrite (.*) http://www.oschina.net$1 permanent;     }     }     server {     listen 80;     server_name www.oschina.net my.oschina.net m.oschina.net;         log_format  oschina_log         '$remote_addr - $remote_user [$time_local] $request '         '"$status" $body_bytes_sent "$http_referer" '         '"$http_user_agent" "$http_x_forwarded_for"';         access_log  logs/oschina.log;     location ~ ^/(WEB-INF)/ {             deny all;         }         location ~ .(apk|torrent|htm|html|asp|php|gif|jpg|jpeg|png|bmp|ico|rar|css|js|zip|java|jar|txt|flv|swf|mid|doc|ppt|xls|pdf|txt|mp3|wma)$ {             root /data/oschina/webapp;         access_log off;             expires 24h;         }             location ~ ^/uploads/ {         access_log off;             root /data/oschina/webapp;         expires 24h;         }     location / {         proxy_pass http://localhost:8080;         include proxy.conf;     }     error_page 502 503 /502.html;         error_page 404 /404.html;     error_page 403 /403.html;     } } gzip.conf: gzip              on; gzip_min_length      1000; gzip_types         text/plain text/css application/x-javascript; proxy.conf: proxy_redirect          off; proxy_set_header        Host $host; proxy_set_header        X-Real-IP $remote_addr; proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size    10m; client_body_buffer_size 128k; proxy_connect_timeout   300; proxy_send_timeout      300; proxy_read_timeout      300; proxy_buffer_size       4k; proxy_buffers           4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k;######rewrite (.*) http://www.oschina.net$1 permanent; 这句的意思,是不是访问 http://localhost:8080/oschina 这样的后端 url ,会重定下到 http://localhost/oschina ?######老大回帖真够快的。。。 感谢,正好配一下######engine X与 Tomcat通讯是用8080端口进行 代理proxy是吗? 正则那里还没怎么看懂,看来还得看看engine x的资料补习补习######我也发扬一下风格,这里是我对apache和tomcat的配置: httpd.conf LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule authn_alias_module modules/mod_authn_alias.so #LoadModule authn_anon_module modules/mod_authn_anon.so #LoadModule authn_dbd_module modules/mod_authn_dbd.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authn_file_module modules/mod_authn_file.so #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_host_module modules/mod_authz_host.so #LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule autoindex_module modules/mod_autoindex.so #LoadModule cache_module modules/mod_cache.so #LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule cgi_module modules/mod_cgi.so #LoadModule charset_lite_module modules/mod_charset_lite.so LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule dav_lock_module modules/mod_dav_lock.so #LoadModule dbd_module modules/mod_dbd.so #LoadModule deflate_module modules/mod_deflate.so LoadModule dir_module modules/mod_dir.so #LoadModule disk_cache_module modules/mod_disk_cache.so #LoadModule dumpio_module modules/mod_dumpio.so LoadModule env_module modules/mod_env.so #LoadModule expires_module modules/mod_expires.so #LoadModule ext_filter_module modules/mod_ext_filter.so #LoadModule file_cache_module modules/mod_file_cache.so #LoadModule filter_module modules/mod_filter.so #LoadModule headers_module modules/mod_headers.so #LoadModule ident_module modules/mod_ident.so #LoadModule imagemap_module modules/mod_imagemap.so LoadModule include_module modules/mod_include.so #LoadModule info_module modules/mod_info.so LoadModule isapi_module modules/mod_isapi.so #LoadModule ldap_module modules/mod_ldap.so #LoadModule logio_module modules/mod_logio.so LoadModule log_config_module modules/mod_log_config.so #LoadModule log_forensic_module modules/mod_log_forensic.so #LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule mime_module modules/mod_mime.so #LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so #LoadModule speling_module modules/mod_speling.so #LoadModule ssl_module modules/mod_ssl.so #LoadModule status_module modules/mod_status.so #LoadModule substitute_module modules/mod_substitute.so #LoadModule unique_id_module modules/mod_unique_id.so   //mod_security 共同打开(下边配置中已经打开) #LoadModule userdir_module modules/mod_userdir.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule version_module modules/mod_version.so #LoadModule vhost_alias_module modules/mod_vhost_alias.so #SVN Module conf LoadModule dav_svn_module "D:/Serv/Subversion/bin/mod_dav_svn.so" LoadModule authz_svn_module "D:/Serv/Subversion/bin/mod_authz_svn.so" #PHP Module conf LoadModule php5_module "D:/Serv/Apache/PHP/php5apache2_2.dll" PHPIniDir "D:/Serv/Apache/PHP/" #mod_security conf 2.5.12 LoadModule security2_module modules/mod_security2/mod_security2.so LoadModule unique_id_module modules/mod_unique_id.so SecRuleEngine On SecDefaultAction log,auditlog,deny,status:403,phase:2,t:lowercase,t:replaceNulls,t:compressWhitespace SecAuditEngine RelevantOnly SecAuditLogType Serial SecAuditLog logs/mod_security2.log #jk Module conf LoadModule jk_module modules/mod_jk.so Where to find workers.properties JkWorkersFile conf/worker.properties JkMountFile conf/uriworkermap.properties Where to put jk logs JkLogFile logs/mod_jk.log Set the jk log level [debug/error/info] JkLogLevel info Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" <IfModule !mpm_netware_module> <IfModule !mpm_winnt_module> ServerName localhost DocumentRoot "D:/Serv/wwwroot/" <Directory "D:/Serv/wwwroot/cache/status">     Order allow,deny     Deny from all     #allow from 127.0.0.1 </Directory> <Location /svn>         DAV svn         SVNPath "D:/Serv/svnroot/" </Location> 后面部分无关紧要的就不贴了。 worker.properties的配置 #--- see following for detail    "http://tomcat.apache.org/connectors-doc/"   "http://tomcat.apache.org/connectors-doc/reference/workers.html"   #========server列表======== worker.list=controller,status #========controller,负载均衡控制器========   load-balance worker, can be "lb, status" worker.controller.type=lb worker.controller.balance_workers=tomcat1,tomcat2 如何选择最优的worker, B[usyness]: 选最不忙的, R[equest]: 缺省 worker.controller.method=B #ticky_session   sticky_session_force             含义     true             false            SESSION会复制,有粘性     true             true             SESSION不复制,有粘性     false            false            SESSION会复制,无粘性     false            true             SESSION会复制,无粘性 注意 worker.controller.sticky_session=1,等同于worker.controller.sticky_session=true.此处指定集群是否需要会话复制, #如果设为true,则表明为会话粘性,不进行会话复制,当某用户的请求第一次分发到哪台Tomcat后,后继的请求会一直分发到此 #Tomcat服务器上处理;如果设为false,则表明需求会话复制。这就是说,如果你要想进行均衡负载,并在192.168.1.5和192.168.1.3 #两台机器的Tomcat实例上实现集群全局session复制,此处值要设置成false。 #sticky_session 1: True, otherwise False, 相同session id一直访问同一服务器    #sticky_session_force session id出错状态不返回500(Server Error), 由另一worker接手    worker.controller.sticky_session=0 worker.controller.sticky_session_force=0 #worker.status.type=status #========tomcat1========    worker.tomcat1.port=8009 worker.tomcat1.host=localhost worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor=1 worker.tomcat1.socket_connect_timeout=3000 #========tomcat2======== #worker.tomcat2.port=8009 #worker.tomcat2.host=localhost #worker.tomcat2.type=ajp13 #worker.tomcat2.lbfactor=1 #worker.tomcat2.socket_connect_timeout=3000 worker.connection_pool_size=10 #默认值(connection_pool_size +1)/ 2 worker.connection_pool_minsize=5 worker.socket_timeout=1 worker.socket_connect_timeout=3000 uriworkermap.properties配置,设置转发规则 /.jsp=controller /.do=controller /blog/=controller /bbs/=controller /site/=controller  !/.html=controller  !/.gif=controller  !/.jpg=controller  !/*.png=controller  extra/httpd-mpm.conf 模块   上边一样的就不贴了,主要是下边的配置,因为我用了mod_security模块,所以要做一些配置,这里不做解释了,写的很详细,我比较喜欢在配置文件里把容易忘记的地方写上文档。毕竟这东西配完了就不再动了,很容易忘记 WinNT MPM ThreadsPerChild: constant number of worker threads in the server process MaxRequestsPerChild: maximum  number of requests a server process serves #注意:ThreadLimit指令应当放在ThreadsPerChild之前,否则ThreadsPerChild指令生效后ThreadLimit会失效,而导致不必要的错误 ThreadLimit必须大于等于ThreadsPerChild #对于mpm_winnt,ThreadLimit的默认值是1920;对于其他MPM这个值是64 #ThreadLimit 这个指令设置了每个子进程可配置的线程数ThreadsPerChild上限。任何在重启期间对这个指令的改变都将被忽略,但对ThreadsPerChild的修改却会生效。 #ThreadLimit 使用这个指令时要特别当心。如果将ThreadLimit设置成一个高出ThreadsPerChild实际需要很多的值,将会有过多的共享内存被分配。 #如果将ThreadLimit和ThreadsPerChild设置成超过系统的处理能力,Apache可能无法启动,或者系统将变得不稳定。该指令的值应当和ThreadsPerChild大致保持一致 #ThreadsPerChild 每个子进程建立的常驻的执行线程数。默认值是25。子进程在启动时建立这些线程后就不再建立新的线程了。 <IfModule mpm_winnt_module>     ThreadLimit            2000     ThreadsPerChild        2000     MaxRequestsPerChild    2000 </IfModule> ######当然由于日常使用windows的原因,因此apache的配置并不一定适合linux 这里是NT架构使用了线程,而linux一般都是使用进程。 以前研究过apache的文档,但老是看过以后就忘记了,用的时候还得继续看,比较恶心。######嘿, 因为 Nginx 就是 http 协议的反向代理, 所以不需要像 apache 那样还得来个 JK 如果是我那,就直接在 Nginx 上分辨, 是 PHP 就给 Apache, 是 jsp 就直接 tomcat 连 apache 的 JK 都省了。 但Session 粘贴问题的话,Nginx 的 第三方 session 功能好像暂时还是在测试阶段...除非只用 cookies 所以应用还得斟酌了.######受教了

kun坤 2020-06-04 11:06:34 0 浏览量 回答数 0

回答

把配置贴全 <aclass="referer"target="_blank">@皮总 <preclass="brush:java;toolbar:true;auto-links:false;">##ThisisthemainApacheHTTPserverconfigurationfile.Itcontainsthe#configurationdirectivesthatgivetheserveritsinstructions.#See<URL:http://httpd.apache.org/docs/2.4/>fordetailedinformation.#Inparticular,see#<URL:http://httpd.apache.org/docs/2.4/mod/directives.html>#foradiscussionofeachconfigurationdirective.##DoNOTsimplyreadtheinstructionsinherewithoutunderstanding#whattheydo.They'rehereonlyashintsorreminders.Ifyouareunsure#consulttheonlinedocs.Youhavebeenwarned.##Configurationandlogfilenames:Ifthefilenamesyouspecifyformany#oftheserver'scontrolfilesbeginwith"/"(or"drive:/"forWin32),the#serverwillusethatexplicitpath.Ifthefilenamesdo notbegin#with"/",thevalueofServerRootisprepended--so"logs/access_log"#withServerRootsetto"/usr/local/apache2"willbeinterpretedbythe#serveras"/usr/local/apache2/logs/access_log",whereas"/logs/access_log"#willbeinterpretedas'/logs/access_log'.##ServerRoot:Thetopofthedirectorytreeunderwhichtheserver's#configuration,error,andlogfilesarekept.##Donotaddaslashattheendofthedirectorypath.Ifyoupoint#ServerRootatanon-localdisk,besuretospecifyalocaldiskonthe#Mutexdirective,iffile-basedmutexesareused.Ifyouwishtosharethe#sameServerRootformultiplehttpddaemons,youwillneedtochangeat#leastPidFile.#ServerRoot"/site01/program/apache"##Mutex:Allowsyoutosetthemutexmechanismandmutexfiledirectory#forindividualmutexes,orchangetheglobaldefaults##Uncommentandchangethedirectoryifmutexesarefile-basedandthedefault#mutexfiledirectoryisnotonalocaldiskorisnotappropriateforsome#otherreason.##Mutexdefault:logs##Listen:AllowsyoutobindApachetospecificIPaddressesand/or#ports,insteadofthedefault.Seealsothe<VirtualHost>#directive.##ChangethistoListenonspecificIPaddressesasshownbelowto#preventApachefromglommingontoallboundIPaddresses.##Listen12.34.56.78:80Listen80##DynamicSharedObject(DSO)Support##TobeabletousethefunctionalityofamodulewhichwasbuiltasaDSOyou#havetoplacecorresponding LoadModule'linesatthislocationsothe#directivescontainedinitareactuallyavailable_before_theyareused.#Staticallycompiledmodules(thoselistedbyhttpd-l')donotneed#tobeloadedhere.##Example:#LoadModulefoo_modulemodules/mod_foo.so#LoadModuleauthn_file_modulemodules/mod_authn_file.so#LoadModuleauthn_dbm_modulemodules/mod_authn_dbm.so#LoadModuleauthn_anon_modulemodules/mod_authn_anon.so#LoadModuleauthn_dbd_modulemodules/mod_authn_dbd.so#LoadModuleauthn_socache_modulemodules/mod_authn_socache.soLoadModuleauthn_core_modulemodules/mod_authn_core.soLoadModuleauthz_host_modulemodules/mod_authz_host.soLoadModuleauthz_groupfile_modulemodules/mod_authz_groupfile.soLoadModuleauthz_user_modulemodules/mod_authz_user.so#LoadModuleauthz_dbm_modulemodules/mod_authz_dbm.so#LoadModuleauthz_owner_modulemodules/mod_authz_owner.so#LoadModuleauthz_dbd_modulemodules/mod_authz_dbd.soLoadModuleauthz_core_modulemodules/mod_authz_core.soLoadModuleaccess_compat_modulemodules/mod_access_compat.soLoadModuleauth_basic_modulemodules/mod_auth_basic.so#LoadModuleauth_form_modulemodules/mod_auth_form.so#LoadModuleauth_digest_modulemodules/mod_auth_digest.so#LoadModuleallowmethods_modulemodules/mod_allowmethods.so#LoadModulefile_cache_modulemodules/mod_file_cache.so#LoadModulecache_modulemodules/mod_cache.so#LoadModulecache_disk_modulemodules/mod_cache_disk.so#LoadModulesocache_shmcb_modulemodules/mod_socache_shmcb.so#LoadModulesocache_dbm_modulemodules/mod_socache_dbm.so#LoadModulesocache_memcache_modulemodules/mod_socache_memcache.so#LoadModuledbd_modulemodules/mod_dbd.so#LoadModuledumpio_modulemodules/mod_dumpio.so#LoadModulebuffer_modulemodules/mod_buffer.so#LoadModuleratelimit_modulemodules/mod_ratelimit.soLoadModulereqtimeout_modulemodules/mod_reqtimeout.so#LoadModuleext_filter_modulemodules/mod_ext_filter.so#LoadModulerequest_modulemodules/mod_request.soLoadModuleinclude_modulemodules/mod_include.soLoadModulefilter_modulemodules/mod_filter.so#LoadModulesubstitute_modulemodules/mod_substitute.so#LoadModulesed_modulemodules/mod_sed.so#LoadModuledeflate_modulemodules/mod_deflate.soLoadModulemime_modulemodules/mod_mime.soLoadModulelog_config_modulemodules/mod_log_config.so#LoadModulelog_debug_modulemodules/mod_log_debug.so#LoadModulelogio_modulemodules/mod_logio.soLoadModuleenv_modulemodules/mod_env.so#LoadModuleexpires_modulemodules/mod_expires.soLoadModuleheaders_modulemodules/mod_headers.so#LoadModuleunique_id_modulemodules/mod_unique_id.soLoadModulesetenvif_modulemodules/mod_setenvif.soLoadModuleversion_modulemodules/mod_version.so#LoadModuleremoteip_modulemodules/mod_remoteip.so#LoadModuleproxy_modulemodules/mod_proxy.so#LoadModuleproxy_connect_modulemodules/mod_proxy_connect.so#LoadModuleproxy_ftp_modulemodules/mod_proxy_ftp.so#LoadModuleproxy_http_modulemodules/mod_proxy_http.so#LoadModuleproxy_fcgi_modulemodules/mod_proxy_fcgi.so#LoadModuleproxy_scgi_modulemodules/mod_proxy_scgi.so#LoadModuleproxy_ajp_modulemodules/mod_proxy_ajp.so#LoadModuleproxy_balancer_modulemodules/mod_proxy_balancer.so#LoadModuleproxy_express_modulemodules/mod_proxy_express.so#LoadModulesession_modulemodules/mod_session.so#LoadModulesession_cookie_modulemodules/mod_session_cookie.so#LoadModulesession_dbd_modulemodules/mod_session_dbd.so#LoadModuleslotmem_shm_modulemodules/mod_slotmem_shm.so#LoadModulessl_modulemodules/mod_ssl.so#LoadModulelbmethod_byrequests_modulemodules/mod_lbmethod_byrequests.so#LoadModulelbmethod_bytraffic_modulemodules/mod_lbmethod_bytraffic.so#LoadModulelbmethod_bybusyness_modulemodules/mod_lbmethod_bybusyness.so#LoadModulelbmethod_heartbeat_modulemodules/mod_lbmethod_heartbeat.soLoadModuleunixd_modulemodules/mod_unixd.so#LoadModuledav_modulemodules/mod_dav.soLoadModulestatus_modulemodules/mod_status.soLoadModuleautoindex_modulemodules/mod_autoindex.so#LoadModuleinfo_modulemodules/mod_info.so#LoadModulecgid_modulemodules/mod_cgid.so#LoadModuledav_fs_modulemodules/mod_dav_fs.so#LoadModulevhost_alias_modulemodules/mod_vhost_alias.so#LoadModulenegotiation_modulemodules/mod_negotiation.soLoadModuledir_modulemodules/mod_dir.so#LoadModuleactions_modulemodules/mod_actions.so#LoadModulespeling_modulemodules/mod_speling.so#LoadModuleuserdir_modulemodules/mod_userdir.soLoadModulealias_modulemodules/mod_alias.soLoadModulerewrite_modulemodules/mod_rewrite.so<IfModuleunixd_module>##Ifyouwishhttpdtorunasadifferentuserorgroup,youmustrun#httpdasrootinitiallyanditwillswitch.##User/Group:Thename(or#number)oftheuser/grouptorunhttpdas.#Itisusuallygoodpracticetocreateadedicateduserandgroupfor#runninghttpd,aswithmostsystemservices.#UserdaemonGroupdaemon</IfModule>#'Main'serverconfiguration##Thedirectivesinthissectionsetupthevaluesusedbythe'main'#server,whichrespondstoanyrequeststhataren'thandledbya#<VirtualHost>definition.Thesevaluesalsoprovidedefaultsfor#any<VirtualHost>containersyoumaydefinelaterinthefile.##Allofthesedirectivesmayappearinside<VirtualHost>containers,#inwhichcasethesedefaultsettingswillbeoverriddenforthe#virtualhostbeingdefined.###ServerAdmin:Youraddress,whereproblemswiththeservershouldbe#e-mailed.Thisaddressappearsonsomeserver-generatedpages,such#aserrordocuments.e.g.admin@your-domain.com#ServerAdminyou@example.com##ServerNamegivesthenameandportthattheserverusestoidentifyitself.#Thiscanoftenbedeterminedautomatically,butwerecommendyouspecify#itexplicitlytopreventproblemsduringstartup.##Ifyourhostdoesn'thavearegisteredDNSname,enteritsIPaddresshere.##ServerNamewww.example.com:80##Denyaccesstotheentiretyofyourserver'sfilesystem.Youmust#explicitlypermitaccesstowebcontentdirectoriesinother#<Directory>blocksbelow.#<Directory/>OptionsIndexesFollowSymLinksIncludesAllowOverrideNoneOrderallow,denyAllowfromallSatisfyall</Directory>##Notethatfromthispointforwardyoumustspecificallyallow#particularfeaturestobeenabled-soifsomething'snotworkingas#youmightexpect,makesurethatyouhavespecificallyenabledit#below.###DocumentRoot:Thedirectoryoutofwhichyouwillserveyour#documents.Bydefault,allrequestsaretakenfromthisdirectory,but#symboliclinksandaliasesmaybeusedtopointtootherlocations.#DocumentRoot"/site01/program/apache/htdocs"<Directory"/site01/program/apache/htdocs">##PossiblevaluesfortheOptionsdirectiveare"None","All",#oranycombinationof:#IndexesIncludesFollowSymLinksSymLinksifOwnerMatchExecCGIMultiViews##Notethat"MultiViews"mustbenamed explicitly---"OptionsAll"#doesn'tgiveittoyou.##TheOptionsdirectiveisbothcomplicatedandimportant.Pleasesee#http://httpd.apache.org/docs/2.4/mod/core.html#options#formoreinformation.#OptionsIndexesFollowSymLinks##AllowOverridecontrolswhatdirectivesmaybeplacedin.htaccessfiles.#Itcanbe"All","None",oranycombinationofthekeywords:#AllowOverrideFileInfoAuthConfigLimit#AllowOverrideNone##Controlswhocangetstufffromthisserver.#Requireallgranted</Directory>##DirectoryIndex:setsthefilethatApachewillserveifadirectory#isrequested.#<IfModuledir_module>DirectoryIndexindex.htmlindex.jsp</IfModule>##Thefollowinglinesprevent.htaccessand.htpasswdfilesfrombeing#viewedbyWebclients.#<Files".ht*">Requirealldenied</Files>##ErrorLog:Thelocationoftheerrorlogfile.#IfyoudonotspecifyanErrorLogdirectivewithina<VirtualHost>#container,errormessagesrelatingtothatvirtualhostwillbe#loggedhere.Ifyou dodefineanerrorlogfilefora<VirtualHost>#container,thathost'serrorswillbeloggedthereandnothere.#ErrorLog"logs/error_log"##LogLevel:Controlthenumberofmessagesloggedtotheerror_log.#Possiblevaluesinclude:debug,info,notice,warn,error,crit,#alert,emerg.#LogLevelwarn<IfModulelog_config_module>##Thefollowingdirectivesdefinesomeformatnicknamesforusewith#aCustomLogdirective(seebelow).#LogFormat"%h%l%u%t"%r"%>s%b"%{Referer}i""%{User-Agent}i""combinedLogFormat"%h%l%u%t"%r"%>s%b"common<IfModulelogio_module>#Youneedtoenablemod_logio.ctouse%Iand%OLogFormat"%h%l%u%t"%r"%>s%b"%{Referer}i""%{User-Agent}i"%I%O"combinedio</IfModule>##Thelocationandformatoftheaccesslogfile(CommonLogfileFormat).#Ifyoudonotdefineanyaccesslogfileswithina<VirtualHost>#container,theywillbeloggedhere.Contrariwise,ifyou do#defineper-<VirtualHost>accesslogfiles,transactionswillbe#loggedthereinand notinthisfile.#CustomLog"logs/access_log"common##Ifyoupreferalogfilewithaccess,agent,andrefererinformation#(CombinedLogfileFormat)youcanusethefollowingdirective.##CustomLog"logs/access_log"combined</IfModule><IfModulealias_module>##Redirect:Allowsyoutotellclientsaboutdocumentsthatusedto#existinyourserver'snamespace,butdonotanymore.Theclient#willmakeanewrequestforthedocumentatitsnewlocation.#Example:#Redirectpermanent/foohttp://www.example.com/bar##Alias:Mapswebpathsintofilesystempathsandisusedto#accesscontentthatdoesnotliveundertheDocumentRoot.#Example:#Alias/webpath/full/filesystem/path##Ifyouincludeatrailing/on/webpaththentheserverwill#requireittobepresentintheURL.Youwillalsolikely#needtoprovidea<Directory>sectiontoallowaccessto#thefilesystempath.##ScriptAlias:Thiscontrolswhichdirectoriescontainserverscripts.#ScriptAliasesareessentiallythesameasAliases,exceptthat#documentsinthetargetdirectoryaretreatedasapplicationsand#runbytheserverwhenrequestedratherthanasdocumentssenttothe#client.Thesamerulesabouttrailing"/"applytoScriptAlias#directivesastoAlias.#ScriptAlias/cgi-bin/"/site01/program/apache/cgi-bin/"</IfModule><IfModulecgid_module>##ScriptSock:Onthreadedservers,designatethepathtotheUNIX#socketusedtocommunicatewiththeCGIdaemonofmod_cgid.##Scriptsockcgisock</IfModule>##"/site01/program/apache/cgi-bin"shouldbechangedtowhateveryourScriptAliased#CGIdirectoryexists,ifyouhavethatconfigured.#<Directory"/site01/program/apache/cgi-bin">AllowOverrideNoneOptionsNoneRequireallgranted</Directory><IfModulemime_module>##TypesConfigpointstothefilecontainingthelistofmappingsfrom#filenameextensiontoMIME-type.#TypesConfigconf/mime.types##AddTypeallowsyoutoaddtooroverridetheMIMEconfiguration#filespecifiedinTypesConfigforspecificfiletypes.##AddTypeapplication/x-gzip.tgz##AddEncodingallowsyoutohavecertainbrowsersuncompress#informationonthefly.Note:Notallbrowserssupportthis.##AddEncodingx-compress.Z#AddEncodingx-gzip.gz.tgz##IftheAddEncodingdirectivesabovearecommented-out,thenyou#probablyshoulddefinethoseextensionstoindicatemediatypes:#AddTypeapplication/x-compress.ZAddTypeapplication/x-gzip.gz.tgz##AddHandlerallowsyoutomapcertainfileextensionsto"handlers":#actionsunrelatedtofiletype.Thesecanbeeitherbuiltintotheserver#oraddedwiththeActiondirective(seebelow)##TouseCGIscriptsoutsideofScriptAliaseddirectories:#(Youwillalsoneedtoadd"ExecCGI"tothe"Options"directive.)##AddHandlercgi-script.cgi#Fortypemaps(negotiatedresources):#AddHandlertype-mapvar##Filtersallowyoutoprocesscontentbeforeitissenttotheclient.##Toparse.shtmlfilesforserver-sideincludes(SSI):#(Youwillalsoneedtoadd"Includes"tothe"Options"directive.)#AddTypetext/html.htm.html.shtmAddOutputFilterINCLUDES.htm.html.shtm</IfModule>##Themod_mime_magicmoduleallowstheservertousevarioushintsfromthe#contentsofthefileitselftodetermineitstype.TheMIMEMagicFile#directivetellsthemodulewherethehintdefinitionsarelocated.##MIMEMagicFileconf/magic##Customizableerrorresponsescomeinthreeflavors:#1)plaintext2)localredirects3)externalredirects##Someexamples:#ErrorDocument500"Theservermadeabooboo."#ErrorDocument404/missing.html#ErrorDocument404"/cgi-bin/missing_handler.pl"#ErrorDocument402http://www.example.com/subscription_info.html###MaxRanges:MaximumnumberofRangesinarequestbefore#returningtheentireresource,oroneofthespecial#values'default','none'or'unlimited'.#Defaultsettingistoaccept200Ranges.#MaxRangesunlimited##EnableMMAPandEnableSendfile:Onsystemsthatsupportit,#memory-mappingorthesendfilesyscallmaybeusedtodeliver#files.Thisusuallyimprovesserverperformance,butmust#beturnedoffwhenservingfromnetworked-mounted#filesystemsorifsupportforthesefunctionsisotherwise#brokenonyoursystem.#Defaults:EnableMMAPOn,EnableSendfileOff##EnableMMAPoff#EnableSendfileon#Supplementalconfiguration##Theconfigurationfilesintheconf/extra/directorycanbe#includedtoaddextrafeaturesortomodifythedefaultconfigurationof#theserver,oryoumaysimplycopytheircontentshereandchangeas#necessary.#Server-poolmanagement(MPMspecific)#Includeconf/extra/httpd-mpm.conf#Multi-languageerrormessages#Includeconf/extra/httpd-multilang-errordoc.conf#Fancydirectorylistings#Includeconf/extra/httpd-autoindex.conf#Languagesettings#Includeconf/extra/httpd-languages.conf#Userhomedirectories#Includeconf/extra/httpd-userdir.conf#Real-timeinfoonrequestsandconfiguration#Includeconf/extra/httpd-info.conf#VirtualhostsIncludeconf/extra/httpd-vhosts.conf#LocalaccesstotheApacheHTTPServerManual#Includeconf/extra/httpd-manual.conf#Distributedauthoringandversioning(WebDAV)#Includeconf/extra/httpd-dav.conf#Variousdefaultsettings#Includeconf/extra/httpd-default.conf#Configuremod_proxy_htmltounderstandHTML4/XHTML1<IfModuleproxy_html_module>Includeconf/extra/proxy-html.conf</IfModule>#Secure(SSL/TLS)connections#Includeconf/extra/httpd-ssl.conf##Note:Thefollowingmustmustbepresenttosupport#startingwithoutSSLonplatformswithno/dev/randomequivalent#butastaticallycompiled-inmod_ssl.#<IfModulessl_module>SSLRandomSeedstartupbuiltinSSLRandomSeedconnectbuiltin</IfModule>##uncommentoutthebelowtodealwithuseragentsthatdeliberately#violateopenstandardsbymisusingDNT(DNT mustbeaspecific#end-userchoice)##<IfModulesetenvif_module>#BrowserMatch"MSIE10.0;"bad_DNT#</IfModule>#<IfModuleheaders_module>#RequestHeaderunsetDNTenv=bad_DNT#</IfModule>includeconf/mod_jk.conf 你apache2.4下面的那个重写咋写的啊http://www.oschina.net/question/77331_2143982--帮忙看看,啥地方没写好啊,我也是在原来IIS里面,可以使用,可是换了服务器就不行了回复<aclass='referer'target='_blank'>@皮总:谢谢皮总,搞定了,我正则在windows下好用,linux不好用,换了个方式就好了还不够全啊,你的Rewrite相关的没有出来

爱吃鱼的程序员 2020-06-22 19:46:06 0 浏览量 回答数 0

问题

伪静态规则301重定向求助

奇特美 2019-12-01 21:54:08 5173 浏览量 回答数 2

问题

没有子域名

tyche.d 2019-12-01 18:50:49 185 浏览量 回答数 1

回答

你的规则有问题。RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] 行不通的,正确的应该是 RewriteRule ^(.*)$ index.php?$1 [QSA,PT,L]。? 才会吧后面的 $1 传给 index.php,而 / 告诉 apache 查找 index.php/ 目录下的 index 文件,自然是 404。你可以添加如下配置到 httpd.conf,调试 mod_rewrite,通过查看 rewrite.log 文件可以知道通过 rewrite 得到的路径到底是什么,完成调试后移除这个配置,否则会有些性能安全方面的影响。 # 输出调试信息到 rewrite.log <IfModule mod_rewrite.c> RewriteLog "/var/log/apache2/rewrite.log" RewriteLogLevel 3 </IfModule> http://httpd.apache.org/docs/2.2/mod/... 另外,rewrite 规则完全没有必要写道 httpd.conf 里面,使用 .htaccess 比较好。httpd.conf DocumentRoot /home/www <Directory /> Options FollowSymLinks AllowOverride None #AllowOverride All </Directory> <Directory /home/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None #AllowOverride All Order allow,deny allow from all DirectoryIndex index.php index.html index.htm </Directory> /home/www/.htaccess <IfModule mod_rewrite.c> RewriteEngine on #不显示index.php RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?$1 [QSA,PT,L] </IfModule>

落地花开啦 2019-12-02 02:44:15 0 浏览量 回答数 0

回答

1.在配置文件将URL模式改成'URL_MODEL' => '2', //REWRITE模式2.Apache服务器的话,将下面的内容保存为.htaccess文件放到入口文件的同级目录<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>Nginx.conf中配置location / { // …..省略部分代码 if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } }

落地花开啦 2019-12-02 02:43:18 0 浏览量 回答数 0

回答

你必须先打开重写模块 LoadModule rewrite_module modules/mod_rewrite.so 找到AllowOverride None 改成 AllowOverride All 类似如下方式,写到WEB目录.htaccess 文件里 <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.)-(.)-1.html$ ?参数=$1&参数=$2 </IfModule>

爱吃鱼的程序员 2020-05-30 23:49:28 0 浏览量 回答数 0

回答

回 1楼魔咒626的帖子 ECS没用过啊,我小白,不懂哦 ------------------------- Re虚拟主机可以建几个站点? 搞定了,参考链接 https://yq.aliyun.com/articles/225402 代码: #一对一绑定域名方法          <IfModule mod_rewrite.c>      RewriteEngine On      RewriteBase /      # 绑定www.blooo.cn 到子目录bloo      RewriteCond %{HTTP_HOST} ^blooo\.cn$ [NC]      RewriteCond %{REQUEST_URI} !^/blmo/      RewriteRule ^(.*)$ blmo/$1?Rewrite [L,QSA]      # 绑定www.blooo.cn 到子目录blmo      RewriteCond %{HTTP_HOST} ^www\.blooo\.cn$ [NC]      RewriteCond %{REQUEST_URI} !^/blmo/      RewriteRule ^(.*)$ blmo/$1?Rewrite [L,QSA]      # 绑定music.blooo.cn 到子目录blmu      RewriteCond %{HTTP_HOST} ^music\.blooo\.cn$ [NC]      RewriteCond %{REQUEST_URI} !^/blmu/      RewriteRule ^(.*)$ blmu/$1?Rewrite [L,QSA]           # 绑定www.zhoujiahua.cn 到子目录jiahua      RewriteCond %{HTTP_HOST} ^zhoujiahua\.cn$ [NC]      RewriteCond %{REQUEST_URI} !^/jiahua/      RewriteRule ^(.*)$ jiahua/$1?Rewrite [L,QSA]      RewriteCond %{HTTP_HOST} ^www\.zhoujiahua\.cn$ [NC]      RewriteCond %{REQUEST_URI} !^/jiahua/      RewriteRule ^(.*)$ jiahua/$1?Rewrite [L,QSA]      #可以绑定多个, 只需重复上三行代码并更改一下域名、目录名 就OK了      </IfModule>

豆瓣不小心 2019-12-01 23:41:15 0 浏览量 回答数 0

问题

.htaccess转换成nginx伪静态规则

启技艺 2019-12-01 21:11:01 4413 浏览量 回答数 1

问题

.htaccess转换成nginx伪静态规则问题

启技艺 2019-12-01 21:11:02 4623 浏览量 回答数 2

问题

阿里云服务器伪静态问题,放.htaccess出现500错误

wtwei2013 2019-12-01 21:19:40 20187 浏览量 回答数 15

问题

用 apache rewrite 和 php 实现单一入口出现的问题,求助。

落地花开啦 2019-12-01 19:54:16 1091 浏览量 回答数 1

问题

apache报错therequestedoperationhasfailed

失望 2019-12-01 21:00:00 14097 浏览量 回答数 2

回答

回1楼dllex的帖子 伪静态模块是啥,我刚开始搭建dz,是个新手,还有很多不懂,还望指教,不是把后台的伪静态功能打开和apache代码加载进去就可以了么? ------------------------- 回3楼dllex的帖子 LoadModule rewrite_module modules/mod_rewrite.so  这个模块前面没有加注释 ------------------------- 回5楼dllex的帖子 不知道咋加载  0.0 CentOS 6.3 64位  +   LAMP   这个镜像自带的apache的httpd.conf里面LoadModule rewrite_module modules/mod_rewrite.so模块没有加注释 之前我没上传.htaccess文件开伪静态就不能打开页面    上传.htaccess文件后还是打不开页面  重启了apache服务也打不开 ------------------------- 回7楼dllex的帖子 感谢提供帮助,问题已解决,终于搞清楚了。 CentOS 6.3 64位  +   LAMP   这个镜像开伪静态加载的是httpd.conf文件   我这个文件里面没有<IfModule mod_rewrite.c>  </IfModule>这两句, 我手动在httpd.conf里面添加了规则, <IfModule mod_rewrite.c>  # 将 RewriteEngine 模式打开RewriteEngine On# 修改以下语句中的 /discuz 为您的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /RewriteBase /# Rewrite 系统规则请勿修改RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1</IfModule> 我自己加上去解决了,再次感谢。 ------------------------- 回7楼dllex的帖子 看来是<IfModule mod_rewrite.c>  </IfModule>这两句的问题   刚刚把服务器重启了一遍网站伪静态就挂了  然后进去把这两句删了就好了

氷刀 2019-12-02 01:43:44 0 浏览量 回答数 0

回答

回1楼梦丫头的帖子 apache  弄了一天了  没弄明白,各种问题....................才想换 不知道那个好! ------------------------- 回3楼梦丫头的帖子 配置好后,访问很慢,很慢,导致打不开,不知道什么问题, 以下是配置文件 # # This is the main Apache HTTP server configuration file.  It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do.  They're here only as hints or reminders.  If you are unsure # consult the online docs. You have been warned.   # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path.  If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/access_log" # with ServerRoot set to "/usr/local/apache2" will be interpreted by the # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" # will be interpreted as '/logs/access_log'. # # NOTE: Where filenames are specified, you must use forward slashes # instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). # If a drive letter is omitted, the drive on which httpd.exe is located # will be used by default.  It is recommended that you always supply # an explicit drive letter in absolute paths to avoid confusion. # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path.  If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used.  If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # Define SRVROOT "/Apache24" ServerRoot "D:/HJ/Apache24" # # Mutex: Allows you to set the mutex mechanism and mutex file directory # for individual mutexes, or change the global defaults # # Uncomment and change the directory if mutexes are file-based and the default # mutex file directory is not on a local disk or is not appropriate for some # other reason. # # Mutex default:logs # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # #LoadModule access_compat_module modules/mod_access_compat.so LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule allowmethods_module modules/mod_allowmethods.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule auth_form_module modules/mod_auth_form.so #LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_core_module modules/mod_authn_core.so #LoadModule authn_dbd_module modules/mod_authn_dbd.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_file_module modules/mod_authn_file.so #LoadModule authn_socache_module modules/mod_authn_socache.so #LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule authz_core_module modules/mod_authz_core.so #LoadModule authz_dbd_module modules/mod_authz_dbd.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_host_module modules/mod_authz_host.so #LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule autoindex_module modules/mod_autoindex.so #LoadModule buffer_module modules/mod_buffer.so #LoadModule cache_module modules/mod_cache.so #LoadModule cache_disk_module modules/mod_cache_disk.so #LoadModule cache_socache_module modules/mod_cache_socache.so #LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule cgi_module modules/mod_cgi.so #LoadModule charset_lite_module modules/mod_charset_lite.so #LoadModule data_module modules/mod_data.so #LoadModule dav_module modules/mod_dav.so #LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule dav_lock_module modules/mod_dav_lock.so #LoadModule dbd_module modules/mod_dbd.so #LoadModule deflate_module modules/mod_deflate.so LoadModule dir_module modules/mod_dir.so #LoadModule dumpio_module modules/mod_dumpio.so LoadModule env_module modules/mod_env.so #LoadModule expires_module modules/mod_expires.so #LoadModule ext_filter_module modules/mod_ext_filter.so #LoadModule file_cache_module modules/mod_file_cache.so #LoadModule filter_module modules/mod_filter.so #LoadModule headers_module modules/mod_headers.so #LoadModule heartbeat_module modules/mod_heartbeat.so #LoadModule heartmonitor_module modules/mod_heartmonitor.so #LoadModule ident_module modules/mod_ident.so #LoadModule imagemap_module modules/mod_imagemap.so LoadModule include_module modules/mod_include.so LoadModule info_module modules/mod_info.so LoadModule isapi_module modules/mod_isapi.so #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so #LoadModule ldap_module modules/mod_ldap.so #LoadModule logio_module modules/mod_logio.so LoadModule log_config_module modules/mod_log_config.so #LoadModule log_debug_module modules/mod_log_debug.so #LoadModule log_forensic_module modules/mod_log_forensic.so #LoadModule lua_module modules/mod_lua.so #LoadModule macro_module modules/mod_macro.so LoadModule mime_module modules/mod_mime.so #LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule negotiation_module modules/mod_negotiation.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_express_module modules/mod_proxy_express.so #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so #LoadModule proxy_html_module modules/mod_proxy_html.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so #LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so #LoadModule ratelimit_module modules/mod_ratelimit.so #LoadModule reflector_module modules/mod_reflector.so #LoadModule remoteip_module modules/mod_remoteip.so #LoadModule request_module modules/mod_request.so #LoadModule reqtimeout_module modules/mod_reqtimeout.so #LoadModule rewrite_module modules/mod_rewrite.so #LoadModule sed_module modules/mod_sed.so #LoadModule session_module modules/mod_session.so #LoadModule session_cookie_module modules/mod_session_cookie.so #LoadModule session_crypto_module modules/mod_session_crypto.so #LoadModule session_dbd_module modules/mod_session_dbd.so LoadModule setenvif_module modules/mod_setenvif.so #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so #LoadModule socache_dbm_module modules/mod_socache_dbm.so #LoadModule socache_memcache_module modules/mod_socache_memcache.so LoadModule socache_shmcb_module modules/mod_socache_shmcb.so #LoadModule speling_module modules/mod_speling.so LoadModule ssl_module modules/mod_ssl.so LoadModule status_module modules/mod_status.so #LoadModule substitute_module modules/mod_substitute.so #LoadModule unique_id_module modules/mod_unique_id.so #LoadModule userdir_module modules/mod_userdir.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule version_module modules/mod_version.so LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule watchdog_module modules/mod_watchdog.so #LoadModule xml2enc_module modules/mod_xml2enc.so <IfModule unixd_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch.   # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User daemon Group daemon </IfModule> # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition.  These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed.  This address appears on some server-generated pages, such # as error documents.  e.g. admin@your-domain.com # ServerAdmin admin@example.com # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # ServerName localhost:80 # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory />     AllowOverride none     Require all denied </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "d:/wed" <Directory "d:/wed">     #     # Possible values for the Options directive are "None", "All",     # or any combination of:     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews     #     # Note that "MultiViews" must be named *explicitly* --- "Options All"     # doesn't give it to you.     #     # The Options directive is both complicated and important.  Please see     # http://httpd.apache.org/docs/2.4/mod/core.html#options     # for more information.     #     Options Indexes FollowSymLinks     #     # AllowOverride controls what directives may be placed in .htaccess files.     # It can be "All", "None", or any combination of the keywords:     #   Options FileInfo AuthConfig Limit     #     AllowOverride FileInfo     #     # Controls who can get stuff from this server.     #     Require all granted </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module>     DirectoryIndex index.php index.htm index.html </IfModule> # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ".ht*">     Require all denied </Files> # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here.  If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog "logs/error.log" # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn <IfModule log_config_module>     #     # The following directives define some format nicknames for use with     # a CustomLog directive (see below).     #     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>       # You need to enable mod_logio.c to use %I and %O       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio     </IfModule>     #     # The location and format of the access logfile (Common Logfile Format).     # If you do not define any access logfiles within a <VirtualHost>     # container, they will be logged here.  Contrariwise, if you *do*     # define per-<VirtualHost> access logfiles, transactions will be     # logged therein and *not* in this file.     #     CustomLog "logs/access.log" common     #     # If you prefer a logfile with access, agent, and referer information     # (Combined Logfile Format) you can use the following directive.     #     #CustomLog "logs/access.log" combined </IfModule> <IfModule alias_module>     #     # Redirect: Allows you to tell clients about documents that used to     # exist in your server's namespace, but do not anymore. The client     # will make a new request for the document at its new location.     # Example:     # Redirect permanent /foo http://www.example.com/bar     #     # Alias: Maps web paths into filesystem paths and is used to     # access content that does not live under the DocumentRoot.     # Example:     # Alias /webpath /full/filesystem/path     #     # If you include a trailing / on /webpath then the server will     # require it to be present in the URL.  You will also likely     # need to provide a <Directory> section to allow access to     # the filesystem path.     #     # ScriptAlias: This controls which directories contain server scripts.     # ScriptAliases are essentially the same as Aliases, except that     # documents in the target directory are treated as applications and     # run by the server when requested rather than as documents sent to the     # client.  The same rules about trailing "/" apply to ScriptAlias     # directives as to Alias.     #     ScriptAlias /cgi-bin/ "d:/Apache24/cgi-bin/" </IfModule> <IfModule cgid_module>     #     # ScriptSock: On threaded servers, designate the path to the UNIX     # socket used to communicate with the CGI daemon of mod_cgid.     #     #Scriptsock logs/cgisock </IfModule> # # "${SRVROOT}/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "d:/HJ/Apache24/cgi-bin">     AllowOverride None     Options None     Require all granted </Directory> <IfModule mime_module>     #     # TypesConfig points to the file containing the list of mappings from     # filename extension to MIME-type.     #     TypesConfig conf/mime.types     #     # AddType allows you to add to or override the MIME configuration     # file specified in TypesConfig for specific file types.     #     #AddType application/x-gzip .tgz     #     # AddEncoding allows you to have certain browsers uncompress     # information on the fly. Note: Not all browsers support this.     #     #AddEncoding x-compress .Z     #AddEncoding x-gzip .gz .tgz     #     # If the AddEncoding directives above are commented-out, then you     # probably should define those extensions to indicate media types:     #     AddType application/x-compress .Z     AddType application/x-gzip .gz .tgz     #     # AddHandler allows you to map certain file extensions to "handlers":     # actions unrelated to filetype. These can be either built into the server     # or added with the Action directive (see below)     #     # To use CGI scripts outside of ScriptAliased directories:     # (You will also need to add "ExecCGI" to the "Options" directive.)     #     #AddHandler cgi-script .cgi .pl     # For type maps (negotiated resources):     #AddHandler type-map var     #     # Filters allow you to process content before it is sent to the client.     #     # To parse .shtml files for server-side includes (SSI):     # (You will also need to add "Includes" to the "Options" directive.)     #     #AddType text/html .shtml     #AddOutputFilter INCLUDES .shtml </IfModule> # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type.  The MIMEMagicFile # directive tells the module where the hint definitions are located. # #MIMEMagicFile conf/magic # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # MaxRanges: Maximum number of Ranges in a request before # returning the entire resource, or one of the special # values 'default', 'none' or 'unlimited'. # Default setting is to accept 200 Ranges. #MaxRanges unlimited # # EnableMMAP and EnableSendfile: On systems that support it, # memory-mapping or the sendfile syscall may be used to deliver # files.  This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise # broken on your system. # Defaults: EnableMMAP On, EnableSendfile Off # #EnableMMAP off #EnableSendfile on #AcceptFilter http none #AcceptFilter https none # Supplemental configuration # # The configuration files in the conf/extra/ directory can be # included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as # necessary. # Server-pool management (MPM specific) #Include conf/extra/httpd-mpm.conf # Multi-language error messages #Include conf/extra/httpd-multilang-errordoc.conf # Fancy directory listings Include conf/extra/httpd-autoindex.conf # Language settings #Include conf/extra/httpd-languages.conf # User home directories #Include conf/extra/httpd-userdir.conf # Real-time info on requests and configuration Include conf/extra/httpd-info.conf # Virtual hosts Include conf/extra/httpd-vhosts.conf # Local access to the Apache HTTP Server Manual #Include conf/extra/httpd-manual.conf # Distributed authoring and versioning (WebDAV) #Include conf/extra/httpd-dav.conf # Various default settings #Include conf/extra/httpd-default.conf # Configure mod_proxy_html to understand HTML4/XHTML1 <IfModule proxy_html_module> Include conf/extra/httpd-proxy-html.conf </IfModule> # Secure (SSL/TLS) connections # Note: The following must must be present to support #       starting without SSL on platforms with no /dev/random equivalent #       but a statically compiled-in mod_ssl. # <IfModule ssl_module> #Include conf/extra/httpd-ssl.conf Include conf/extra/httpd-ahssl.conf SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> LoadModule php5_module "d:/HJ/php/php5apache2_4.dll" AddHandler application/x-httpd-php .php PHPIniDir "d:/HJ/php" ------------------------- 回5楼梦丫头的帖子 这个是apache的配置文件 httpd.conf

失望 2019-12-02 03:07:31 0 浏览量 回答数 0

回答

回 17楼dongshan8的帖子 我在使用弹性web托管服务也遇到同样的问题。php缓存模式正常,但启用mod_rewrite模式就出现楼主同样的问题。网上资料说apache2.4下自动生成的伪静态会有这样的情况。请问下有办法解决吗?谢谢 ------------------------- Rewordpress安装wp super cache不成功 mod_rewrite模式性能比php缓存模式性能要翻一倍,这也是一直纠结怎么开启mod_rewrite模式的原因。 ------------------------- 回 27楼dongshan8的帖子 不是。 是安装wp super cache后,启用mod_rewrite模式会导致网站无法访问。测试缓存会出现“页面不相符!时间戳有差异或者不存在!”错误。 版本号为WordPress 4.5.7+WP Super Cache1.4.9 ------------------------- 回 27楼dongshan8的帖子 wp super cache里面在这打开mod_rewrite模式。 版主大大能否帮忙基于您现有的版本验证下?谢谢! ------------------------- 回 30楼dongshan8的帖子 好的,非常感谢。

javenzy 2019-12-02 01:55:36 0 浏览量 回答数 0

回答

在Apache文件夹下的conf文件夹中找到httpd.conf,记事本或者类似的编辑工具打开后Ctrl+F查找“LoadModule rewrite_module”,找到“LoadModule rewrite_module modules/mod_rewrite.so”所在的那一行,确定这一行前面没有#,就说明已经加载了伪静态模块,假如这一行前面有#,去掉,然后重新启动就可以了。

我的中国 2019-12-02 01:33:24 0 浏览量 回答数 0

回答

回 1楼dongshan8的帖子 Apache我重装成2.4的版本  这个问题已经没有了    但是现在配置好以后用https访问却显示"此网站无法提供安全连接"  "使用了不受支持的协议" "ERR_SSL_VERSION_OR_CIPHER_MISMATCH"        安全组配置了443端口     ------------------------- 回 3楼dongshan8的帖子 现在只能通过SSL2.0访问       但是配置里面协议我已经这 样子设置了"SSLProtocol all -SSLv2 -SSLv3"       怎么改都没效果      是一直使用的SSL2.0 ------------------------- 回 6楼dongshan8的帖子 openssl的版本是1.0.1u   我在服务器上wget了一下https的地址   结果显示 sslv3 alert handshake failure   用openssl s_client -connect 测试了一下地址     怎么最后说Verify return code: 20 (unable to get local issuer certificate) ------------------------- Re回 8楼dongshan8的帖子 # # This is the main Apache HTTP server configuration file.  It contains the # configuration directives that give the server its instructions. # In particular, see # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do.  They're here only as hints or reminders.  If you are unsure # consult the online docs. You have been warned.   # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path.  If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/access_log" # with ServerRoot set to "/usr/local/apache2" will be interpreted by the # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" # will be interpreted as '/logs/access_log'. # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path.  If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used.  If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # ServerRoot "/usr/local/http-2.4.23" # # Mutex: Allows you to set the mutex mechanism and mutex file directory # for individual mutexes, or change the global defaults # # Uncomment and change the directory if mutexes are file-based and the default # mutex file directory is not on a local disk or is not appropriate for some # other reason. # # Mutex default:logs # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule authn_file_module modules/mod_authn_file.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so #LoadModule authn_anon_module modules/mod_authn_anon.so #LoadModule authn_dbd_module modules/mod_authn_dbd.so #LoadModule authn_socache_module modules/mod_authn_socache.so LoadModule authn_core_module modules/mod_authn_core.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_user_module modules/mod_authz_user.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so #LoadModule authz_owner_module modules/mod_authz_owner.so #LoadModule authz_dbd_module modules/mod_authz_dbd.so LoadModule authz_core_module modules/mod_authz_core.so LoadModule access_compat_module modules/mod_access_compat.so LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_form_module modules/mod_auth_form.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule allowmethods_module modules/mod_allowmethods.so #LoadModule file_cache_module modules/mod_file_cache.so #LoadModule cache_module modules/mod_cache.so #LoadModule cache_disk_module modules/mod_cache_disk.so #LoadModule cache_socache_module modules/mod_cache_socache.so LoadModule socache_shmcb_module modules/mod_socache_shmcb.so #LoadModule socache_dbm_module modules/mod_socache_dbm.so #LoadModule socache_memcache_module modules/mod_socache_memcache.so #LoadModule watchdog_module modules/mod_watchdog.so #LoadModule macro_module modules/mod_macro.so #LoadModule dbd_module modules/mod_dbd.so #LoadModule dumpio_module modules/mod_dumpio.so #LoadModule buffer_module modules/mod_buffer.so #LoadModule ratelimit_module modules/mod_ratelimit.so LoadModule reqtimeout_module modules/mod_reqtimeout.so #LoadModule ext_filter_module modules/mod_ext_filter.so #LoadModule request_module modules/mod_request.so #LoadModule include_module modules/mod_include.so LoadModule filter_module modules/mod_filter.so #LoadModule substitute_module modules/mod_substitute.so #LoadModule sed_module modules/mod_sed.so #LoadModule deflate_module modules/mod_deflate.so LoadModule mime_module modules/mod_mime.so LoadModule log_config_module modules/mod_log_config.so #LoadModule log_debug_module modules/mod_log_debug.so #LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so #LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so #LoadModule unique_id_module modules/mod_unique_id.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule version_module modules/mod_version.so #LoadModule remoteip_module modules/mod_remoteip.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so #LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_express_module modules/mod_proxy_express.so #LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so #LoadModule session_module modules/mod_session.so #LoadModule session_cookie_module modules/mod_session_cookie.so #LoadModule session_dbd_module modules/mod_session_dbd.so #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so LoadModule ssl_module modules/mod_ssl.so #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so LoadModule mpm_event_module modules/mod_mpm_event.so #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so #LoadModule mpm_worker_module modules/mod_mpm_worker.so LoadModule unixd_module modules/mod_unixd.so #LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so #LoadModule info_module modules/mod_info.so <IfModule !mpm_prefork_module>     #LoadModule cgid_module modules/mod_cgid.so </IfModule> <IfModule mpm_prefork_module>     #LoadModule cgi_module modules/mod_cgi.so </IfModule> #LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so #LoadModule actions_module modules/mod_actions.so #LoadModule speling_module modules/mod_speling.so #LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule php5_module        modules/libphp5.so <IfModule unixd_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch.   # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User daemon Group daemon </IfModule> # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition.  These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed.  This address appears on some server-generated pages, such # as error documents.  e.g. admin@your-domain.com # ServerAdmin root@localhost # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # ServerName localhost # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory />     AllowOverride All     Require all denied </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # #DocumentRoot "/var/www/" <Directory "/var/www/">     #     # Possible values for the Options directive are "None", "All",     # or any combination of:     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews     #     # Note that "MultiViews" must be named *explicitly* --- "Options All"     # doesn't give it to you.     #     # The Options directive is both complicated and important.  Please see     # for more information.     #     Options Indexes FollowSymLinks     #     # AllowOverride controls what directives may be placed in .htaccess files.     # It can be "All", "None", or any combination of the keywords:     #   AllowOverride FileInfo AuthConfig Limit     #     AllowOverride All     #     # Controls who can get stuff from this server.     #     Require all granted </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module>     DirectoryIndex index.html index.php </IfModule> # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ".ht*">     Require all denied </Files> # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here.  If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog "logs/error_log" # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn <IfModule log_config_module>     #     # The following directives define some format nicknames for use with     # a CustomLog directive (see below).     #     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>       # You need to enable mod_logio.c to use %I and %O       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio     </IfModule>     #     # The location and format of the access logfile (Common Logfile Format).     # If you do not define any access logfiles within a <VirtualHost>     # container, they will be logged here.  Contrariwise, if you *do*     # define per-<VirtualHost> access logfiles, transactions will be     # logged therein and *not* in this file.     #     CustomLog "logs/access_log" common     #     # If you prefer a logfile with access, agent, and referer information     # (Combined Logfile Format) you can use the following directive.     #     #CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module>     #     # Redirect: Allows you to tell clients about documents that used to     # exist in your server's namespace, but do not anymore. The client     # will make a new request for the document at its new location.     # Example:     # Redirect permanent /foo http://www.example.com/bar     #     # Alias: Maps web paths into filesystem paths and is used to     # access content that does not live under the DocumentRoot.     # Example:     # Alias /webpath /full/filesystem/path     #     # If you include a trailing / on /webpath then the server will     # require it to be present in the URL.  You will also likely     # need to provide a <Directory> section to allow access to     # the filesystem path.     #     # ScriptAlias: This controls which directories contain server scripts.     # ScriptAliases are essentially the same as Aliases, except that     # documents in the target directory are treated as applications and     # run by the server when requested rather than as documents sent to the     # client.  The same rules about trailing "/" apply to ScriptAlias     # directives as to Alias.     #     ScriptAlias /cgi-bin/ "/usr/local/http-2.4.23/cgi-bin/" </IfModule> <IfModule mod_php5.c>     AddType application/x-httpd-php .php     AddType application/x-httpd-php .php5     AddType application/x-httpd-php-source .phps     AddType application/x-httpd-php-source .php5s     DirectoryIndex index.php     DirectoryIndex index.php5     PHPIniDir "/usr/local/php/etc/" </IfModule> <IfModule cgid_module>     #     # ScriptSock: On threaded servers, designate the path to the UNIX     # socket used to communicate with the CGI daemon of mod_cgid.     #     #Scriptsock cgisock </IfModule> # # "/usr/local/http-2.4.23/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "/usr/local/http-2.4.23/cgi-bin">     AllowOverride None     Options None     Require all granted </Directory> <IfModule mime_module>     #     # TypesConfig points to the file containing the list of mappings from     # filename extension to MIME-type.     #     TypesConfig conf/mime.types     #     # AddType allows you to add to or override the MIME configuration     # file specified in TypesConfig for specific file types.     #     #AddType application/x-gzip .tgz     #     # AddEncoding allows you to have certain browsers uncompress     # information on the fly. Note: Not all browsers support this.     #     #AddEncoding x-compress .Z     #AddEncoding x-gzip .gz .tgz     #     # If the AddEncoding directives above are commented-out, then you     # probably should define those extensions to indicate media types:     #     AddType application/x-compress .Z     AddType application/x-gzip .gz .tgz     #     # AddHandler allows you to map certain file extensions to "handlers":     # actions unrelated to filetype. These can be either built into the server     # or added with the Action directive (see below)     #     # To use CGI scripts outside of ScriptAliased directories:     # (You will also need to add "ExecCGI" to the "Options" directive.)     #     #AddHandler cgi-script .cgi     # For type maps (negotiated resources):     #AddHandler type-map var     #     # Filters allow you to process content before it is sent to the client.     #     # To parse .shtml files for server-side includes (SSI):     # (You will also need to add "Includes" to the "Options" directive.)     #     #AddType text/html .shtml     #AddOutputFilter INCLUDES .shtml </IfModule> # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type.  The MIMEMagicFile # directive tells the module where the hint definitions are located. # #MIMEMagicFile conf/magic # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" # # # MaxRanges: Maximum number of Ranges in a request before # returning the entire resource, or one of the special # values 'default', 'none' or 'unlimited'. # Default setting is to accept 200 Ranges. #MaxRanges unlimited # # EnableMMAP and EnableSendfile: On systems that support it, # memory-mapping or the sendfile syscall may be used to deliver # files.  This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise # broken on your system. # Defaults: EnableMMAP On, EnableSendfile Off # #EnableMMAP off #EnableSendfile on # Supplemental configuration # # The configuration files in the conf/extra/ directory can be # included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as # necessary. # Server-pool management (MPM specific) #Include conf/extra/httpd-mpm.conf # Multi-language error messages #Include conf/extra/httpd-multilang-errordoc.conf # Fancy directory listings #Include conf/extra/httpd-autoindex.conf # Language settings #Include conf/extra/httpd-languages.conf # User home directories #Include conf/extra/httpd-userdir.conf # Real-time info on requests and configuration #Include conf/extra/httpd-info.conf # Virtual hosts Include conf/extra/httpd-vhosts.conf # Local access to the Apache HTTP Server Manual #Include conf/extra/httpd-manual.conf # Distributed authoring and versioning (WebDAV) #Include conf/extra/httpd-dav.conf # Various default settings #Include conf/extra/httpd-default.conf # Configure mod_proxy_html to understand HTML4/XHTML1 <IfModule proxy_html_module> Include conf/extra/proxy-html.conf </IfModule> # Secure (SSL/TLS) connections Include conf/extra/httpd-ssl.conf # # Note: The following must must be present to support #       starting without SSL on platforms with no /dev/random equivalent #       but a statically compiled-in mod_ssl. # <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> ------------------------- Re回 8楼dongshan8的帖子 # Virtual Hosts # # Required modules: mod_log_config # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.4/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin www.qipaifan.com DocumentRoot " ServerName www.qipaifan.com <Directory /> AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin bbs.qipaifan.com DocumentRoot "/ ServerName bbs.qipaifan.com <Directory /> AllowOverride all Require all granted </Directory> </VirtualHost> ------------------------- Re回 8楼dongshan8的帖子 ssl配置文件发不上来      发图片吧        我没发现有什么异常啊...

淘乐网络 2019-12-02 00:26:30 0 浏览量 回答数 0

回答

回 1楼dongshan8的帖子 Apache我重装成2.4的版本  这个问题已经没有了    但是现在配置好以后用https访问却显示"此网站无法提供安全连接"  "使用了不受支持的协议" "ERR_SSL_VERSION_OR_CIPHER_MISMATCH"        安全组配置了443端口     ------------------------- 回 3楼dongshan8的帖子 现在只能通过SSL2.0访问       但是配置里面协议我已经这 样子设置了"SSLProtocol all -SSLv2 -SSLv3"       怎么改都没效果      是一直使用的SSL2.0 ------------------------- 回 6楼dongshan8的帖子 openssl的版本是1.0.1u   我在服务器上wget了一下https的地址   结果显示 sslv3 alert handshake failure   用openssl s_client -connect 测试了一下地址     怎么最后说Verify return code: 20 (unable to get local issuer certificate) ------------------------- Re回 8楼dongshan8的帖子 # # This is the main Apache HTTP server configuration file.  It contains the # configuration directives that give the server its instructions. # In particular, see # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do.  They're here only as hints or reminders.  If you are unsure # consult the online docs. You have been warned.   # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path.  If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/access_log" # with ServerRoot set to "/usr/local/apache2" will be interpreted by the # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" # will be interpreted as '/logs/access_log'. # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path.  If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used.  If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # ServerRoot "/usr/local/http-2.4.23" # # Mutex: Allows you to set the mutex mechanism and mutex file directory # for individual mutexes, or change the global defaults # # Uncomment and change the directory if mutexes are file-based and the default # mutex file directory is not on a local disk or is not appropriate for some # other reason. # # Mutex default:logs # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule authn_file_module modules/mod_authn_file.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so #LoadModule authn_anon_module modules/mod_authn_anon.so #LoadModule authn_dbd_module modules/mod_authn_dbd.so #LoadModule authn_socache_module modules/mod_authn_socache.so LoadModule authn_core_module modules/mod_authn_core.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_user_module modules/mod_authz_user.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so #LoadModule authz_owner_module modules/mod_authz_owner.so #LoadModule authz_dbd_module modules/mod_authz_dbd.so LoadModule authz_core_module modules/mod_authz_core.so LoadModule access_compat_module modules/mod_access_compat.so LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_form_module modules/mod_auth_form.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule allowmethods_module modules/mod_allowmethods.so #LoadModule file_cache_module modules/mod_file_cache.so #LoadModule cache_module modules/mod_cache.so #LoadModule cache_disk_module modules/mod_cache_disk.so #LoadModule cache_socache_module modules/mod_cache_socache.so LoadModule socache_shmcb_module modules/mod_socache_shmcb.so #LoadModule socache_dbm_module modules/mod_socache_dbm.so #LoadModule socache_memcache_module modules/mod_socache_memcache.so #LoadModule watchdog_module modules/mod_watchdog.so #LoadModule macro_module modules/mod_macro.so #LoadModule dbd_module modules/mod_dbd.so #LoadModule dumpio_module modules/mod_dumpio.so #LoadModule buffer_module modules/mod_buffer.so #LoadModule ratelimit_module modules/mod_ratelimit.so LoadModule reqtimeout_module modules/mod_reqtimeout.so #LoadModule ext_filter_module modules/mod_ext_filter.so #LoadModule request_module modules/mod_request.so #LoadModule include_module modules/mod_include.so LoadModule filter_module modules/mod_filter.so #LoadModule substitute_module modules/mod_substitute.so #LoadModule sed_module modules/mod_sed.so #LoadModule deflate_module modules/mod_deflate.so LoadModule mime_module modules/mod_mime.so LoadModule log_config_module modules/mod_log_config.so #LoadModule log_debug_module modules/mod_log_debug.so #LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so #LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so #LoadModule unique_id_module modules/mod_unique_id.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule version_module modules/mod_version.so #LoadModule remoteip_module modules/mod_remoteip.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so #LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_express_module modules/mod_proxy_express.so #LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so #LoadModule session_module modules/mod_session.so #LoadModule session_cookie_module modules/mod_session_cookie.so #LoadModule session_dbd_module modules/mod_session_dbd.so #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so LoadModule ssl_module modules/mod_ssl.so #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so LoadModule mpm_event_module modules/mod_mpm_event.so #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so #LoadModule mpm_worker_module modules/mod_mpm_worker.so LoadModule unixd_module modules/mod_unixd.so #LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so #LoadModule info_module modules/mod_info.so <IfModule !mpm_prefork_module>     #LoadModule cgid_module modules/mod_cgid.so </IfModule> <IfModule mpm_prefork_module>     #LoadModule cgi_module modules/mod_cgi.so </IfModule> #LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so #LoadModule actions_module modules/mod_actions.so #LoadModule speling_module modules/mod_speling.so #LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule php5_module        modules/libphp5.so <IfModule unixd_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch.   # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User daemon Group daemon </IfModule> # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition.  These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed.  This address appears on some server-generated pages, such # as error documents.  e.g. admin@your-domain.com # ServerAdmin root@localhost # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # ServerName localhost # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory />     AllowOverride All     Require all denied </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # #DocumentRoot "/var/www/" <Directory "/var/www/">     #     # Possible values for the Options directive are "None", "All",     # or any combination of:     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews     #     # Note that "MultiViews" must be named *explicitly* --- "Options All"     # doesn't give it to you.     #     # The Options directive is both complicated and important.  Please see     # for more information.     #     Options Indexes FollowSymLinks     #     # AllowOverride controls what directives may be placed in .htaccess files.     # It can be "All", "None", or any combination of the keywords:     #   AllowOverride FileInfo AuthConfig Limit     #     AllowOverride All     #     # Controls who can get stuff from this server.     #     Require all granted </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module>     DirectoryIndex index.html index.php </IfModule> # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ".ht*">     Require all denied </Files> # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here.  If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog "logs/error_log" # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn <IfModule log_config_module>     #     # The following directives define some format nicknames for use with     # a CustomLog directive (see below).     #     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>       # You need to enable mod_logio.c to use %I and %O       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio     </IfModule>     #     # The location and format of the access logfile (Common Logfile Format).     # If you do not define any access logfiles within a <VirtualHost>     # container, they will be logged here.  Contrariwise, if you *do*     # define per-<VirtualHost> access logfiles, transactions will be     # logged therein and *not* in this file.     #     CustomLog "logs/access_log" common     #     # If you prefer a logfile with access, agent, and referer information     # (Combined Logfile Format) you can use the following directive.     #     #CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module>     #     # Redirect: Allows you to tell clients about documents that used to     # exist in your server's namespace, but do not anymore. The client     # will make a new request for the document at its new location.     # Example:     # Redirect permanent /foo http://www.example.com/bar     #     # Alias: Maps web paths into filesystem paths and is used to     # access content that does not live under the DocumentRoot.     # Example:     # Alias /webpath /full/filesystem/path     #     # If you include a trailing / on /webpath then the server will     # require it to be present in the URL.  You will also likely     # need to provide a <Directory> section to allow access to     # the filesystem path.     #     # ScriptAlias: This controls which directories contain server scripts.     # ScriptAliases are essentially the same as Aliases, except that     # documents in the target directory are treated as applications and     # run by the server when requested rather than as documents sent to the     # client.  The same rules about trailing "/" apply to ScriptAlias     # directives as to Alias.     #     ScriptAlias /cgi-bin/ "/usr/local/http-2.4.23/cgi-bin/" </IfModule> <IfModule mod_php5.c>     AddType application/x-httpd-php .php     AddType application/x-httpd-php .php5     AddType application/x-httpd-php-source .phps     AddType application/x-httpd-php-source .php5s     DirectoryIndex index.php     DirectoryIndex index.php5     PHPIniDir "/usr/local/php/etc/" </IfModule> <IfModule cgid_module>     #     # ScriptSock: On threaded servers, designate the path to the UNIX     # socket used to communicate with the CGI daemon of mod_cgid.     #     #Scriptsock cgisock </IfModule> # # "/usr/local/http-2.4.23/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "/usr/local/http-2.4.23/cgi-bin">     AllowOverride None     Options None     Require all granted </Directory> <IfModule mime_module>     #     # TypesConfig points to the file containing the list of mappings from     # filename extension to MIME-type.     #     TypesConfig conf/mime.types     #     # AddType allows you to add to or override the MIME configuration     # file specified in TypesConfig for specific file types.     #     #AddType application/x-gzip .tgz     #     # AddEncoding allows you to have certain browsers uncompress     # information on the fly. Note: Not all browsers support this.     #     #AddEncoding x-compress .Z     #AddEncoding x-gzip .gz .tgz     #     # If the AddEncoding directives above are commented-out, then you     # probably should define those extensions to indicate media types:     #     AddType application/x-compress .Z     AddType application/x-gzip .gz .tgz     #     # AddHandler allows you to map certain file extensions to "handlers":     # actions unrelated to filetype. These can be either built into the server     # or added with the Action directive (see below)     #     # To use CGI scripts outside of ScriptAliased directories:     # (You will also need to add "ExecCGI" to the "Options" directive.)     #     #AddHandler cgi-script .cgi     # For type maps (negotiated resources):     #AddHandler type-map var     #     # Filters allow you to process content before it is sent to the client.     #     # To parse .shtml files for server-side includes (SSI):     # (You will also need to add "Includes" to the "Options" directive.)     #     #AddType text/html .shtml     #AddOutputFilter INCLUDES .shtml </IfModule> # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type.  The MIMEMagicFile # directive tells the module where the hint definitions are located. # #MIMEMagicFile conf/magic # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" # # # MaxRanges: Maximum number of Ranges in a request before # returning the entire resource, or one of the special # values 'default', 'none' or 'unlimited'. # Default setting is to accept 200 Ranges. #MaxRanges unlimited # # EnableMMAP and EnableSendfile: On systems that support it, # memory-mapping or the sendfile syscall may be used to deliver # files.  This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise # broken on your system. # Defaults: EnableMMAP On, EnableSendfile Off # #EnableMMAP off #EnableSendfile on # Supplemental configuration # # The configuration files in the conf/extra/ directory can be # included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as # necessary. # Server-pool management (MPM specific) #Include conf/extra/httpd-mpm.conf # Multi-language error messages #Include conf/extra/httpd-multilang-errordoc.conf # Fancy directory listings #Include conf/extra/httpd-autoindex.conf # Language settings #Include conf/extra/httpd-languages.conf # User home directories #Include conf/extra/httpd-userdir.conf # Real-time info on requests and configuration #Include conf/extra/httpd-info.conf # Virtual hosts Include conf/extra/httpd-vhosts.conf # Local access to the Apache HTTP Server Manual #Include conf/extra/httpd-manual.conf # Distributed authoring and versioning (WebDAV) #Include conf/extra/httpd-dav.conf # Various default settings #Include conf/extra/httpd-default.conf # Configure mod_proxy_html to understand HTML4/XHTML1 <IfModule proxy_html_module> Include conf/extra/proxy-html.conf </IfModule> # Secure (SSL/TLS) connections Include conf/extra/httpd-ssl.conf # # Note: The following must must be present to support #       starting without SSL on platforms with no /dev/random equivalent #       but a statically compiled-in mod_ssl. # <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> ------------------------- Re回 8楼dongshan8的帖子 # Virtual Hosts # # Required modules: mod_log_config # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.4/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin www.qipaifan.com DocumentRoot " ServerName www.qipaifan.com <Directory /> AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin bbs.qipaifan.com DocumentRoot "/ ServerName bbs.qipaifan.com <Directory /> AllowOverride all Require all granted </Directory> </VirtualHost> ------------------------- Re回 8楼dongshan8的帖子 ssl配置文件发不上来      发图片吧        我没发现有什么异常啊...

淘乐网络 2019-12-02 00:26:29 0 浏览量 回答数 0

问题

Apache mod_rewrite模块未开启

得運電子 2019-12-01 18:53:28 357 浏览量 回答数 1

回答

今天我在自己本地想测试利用.htaccess来支持一些规则,但是怎么搞都.htaccess都不起作用了,后来搜索了很久得到了解决办法,下面分享给大家。 找到apache的配置文件httpd.conf文件,找到: LoadModule rewrite_module modules/mod_rewrite.so 去掉前面的#号。LoadModule rewrite_module modules/mod_rewrite.so然后在AccessFileName htaccess (windows里面这样设置)如果还是不行我们可以对要设置的站点进行 DocumentRoot "D:/xxx/bb/" ServerName 127.0.0.1:80 DirectoryIndexindex.php <Directory "D:/xxx/bb"> Options Indexes FollowSymLinks AllowOverride ALL //有就改没有加入这句 Order allow,deny Allow from all </Directory> 最后重启apache应该是可以了哦, 下面测试一段简单的URL重写规则示例: 将 RewriteEngine 模式打开 RewriteEngine On Rewrite 系统规则请勿修改 RewriteRule ^p/([0-9]+).html$ index.php?post_id=$1RewriteRule ^u-(username|uid)-(.+).html$ space.php?$1=$2其中,RewriteEngine 表示开启URL重写,RewriteRule是重写规则KO没有问题了,如果你要配置一些错误页面信息可如下 custom error documents ErrorDocument 401 /err/401.phpErrorDocument 403 /err/403.phpErrorDocument 404 /err/404.phpErrorDocument 500 /err/500.php

我的中国 2019-12-02 01:33:21 0 浏览量 回答数 0

问题

nginx伪静态求助

奇特美 2019-12-01 21:54:03 4658 浏览量 回答数 2
阿里云大学 云服务器ECS com域名 网站域名whois查询 开发者平台 小程序定制 小程序开发 国内短信套餐包 开发者技术与产品 云数据库 图像识别 开发者问答 阿里云建站 阿里云备案 云市场 万网 阿里云帮助文档 免费套餐 开发者工具 企业信息查询 小程序开发制作 视频内容分析 企业网站制作 视频集锦 代理记账服务 2020阿里巴巴研发效能峰会 企业建站模板 云效成长地图 高端建站 阿里云双十一主会场 阿里云双十一新人会场 1024程序员加油包 阿里云双十一拼团会场 场景化解决方案 阿里云双十一直播大厅