Apache一直在引用旧的index.html

我只是在Windows上安装了Apache 2.2,无法对我的更改做出反应。 它不断显示“它的作品!” 在默认的index.html文件中。 我更改了DocumentRoot,<Document,并在新的位置有一个index.html。

DocumentRoot "C:/PersonalWebsite" <Directory "C:/PersonalWebsite"> # # 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.2/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 None # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> 

我在URL的末尾没有任何尾部的斜杠,我已经检查了目录和文件的权限,没有问题。 我可以更改位于C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocsindex.html的内容,并且可以在浏览器中查看更改。 所以不知何故,在某个地方,它仍然指的是旧路。 我也重新启动了服务后,进行更改,它不会与我input的url崩溃。 我也确定我正在编辑正确的httpdconfiguration文件,通过开始 – >程序 – > apache->编辑configuration文件

– – – – – – 编辑 – – – – – – –

好吧,所以我没有足够的字符来发布解决这个问题的完整解释,所以我会在这里发布。

好吧,所以我尝试了上述的不成功。 然后我尝试了其他的东西。

  • 我已经通过start menu->apache->control->restart重新启动apache,而我试图通过菜单再次停止它。
  • 然后我再次打开我的浏览器,我试图再次查看页面,它的工作。 我检查了托盘中的apache符号,发现它仍在运行。 然后,我通过托盘中的那个符号停止了服务,而不是从开始菜单,它从green-> red改变,表示停止。
  • 我再次启动它,并通过窗口(在非pipe理员用户帐户)闪烁提示有关httpd文件。 我点击好,并去我的浏览器,它的工作!

所以问题是通过菜单重新启动不是一个“真正的”重新启动? 而这一直没有工作是因为它仍然使用旧的httpd文件? 这是一个Windows问题 – 不是一个pipe理员帐户或其他东西?

感谢您的build议,但!

我不认为你是骑在默认的网站,这将需要它像你所描述的工作。 (我的经验是Linux上的Apache,所以你可能需要翻译原则)

基本上apache的某个地方会有一个默认的httpd.conf文件,通常在conf \ httpd.conf的安装文件夹下,这将指定所有的设置,如DocumentRoot,如果没有在其他地方指定的话,将会使用。

我将首先在你的httpd.conf的底部添加以下内容来声明一个Name VirtualHost用于你的站点;

 NameVirtualHost *:80 <VirtualHost *:80> ServerName myservername.com #what is your home page DirectoryIndex index.html LogLevel warn # CustomLog logs/somelogfile.log # ErrorLog /var/log/httpd/someerror.lgo DocumentRoot "C:/PersonalWebsite" <Directory "C:/PersonalWebsite"> # # 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.2/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 None # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> </VirtualHost> 

并重新加载Apache。