试图用apache阻止直接IP访问

试图用apache阻止直接IP访问,apache,xampp,Apache,Xampp,我在Windows计算机上使用XAMPP,我已将此代码添加到httpd.conf文件中: <VirtualHost *:80> ServerName 23.23.23.23.23 Redirect 403 / ErrorDocument 403 "No" DocumentRoot C:/xampp/htdocs UseCanonicalName Off UserDir disabled </VirtualHost> 如果我

我在Windows计算机上使用XAMPP,我已将此代码添加到
httpd.conf
文件中:

<VirtualHost *:80>
    ServerName 23.23.23.23.23
    Redirect 403 /
    ErrorDocument 403 "No"
    DocumentRoot C:/xampp/htdocs
    UseCanonicalName Off
    UserDir disabled
</VirtualHost>

如果我从
httpd.conf
文件中删除代码,它将启动。这里发生了什么?

从配置中删除禁用的
UserDir
将解决您的问题。

如有任何帮助,将不胜感激。
11:15:02 AM  [Apache]   Error: Apache shutdown unexpectedly.
11:15:02 AM  [Apache]   This may be due to a blocked port, missing dependencies, 
11:15:02 AM  [Apache]   improper privileges, a crash, or a shutdown by another method.
11:15:02 AM  [Apache]   Press the Logs button to view error logs and check
11:15:02 AM  [Apache]   the Windows Event Viewer for more clues
11:15:02 AM  [Apache]   If you need more help, copy and post this
11:15:02 AM  [Apache]   entire log window on the forums