I have installed WAMP version 2.1 on my windows 7 machine. When i browse to localhost in my browser, the WAMP server page is visible.
我在我的windows 7机器上安装了WAMP版本2.1。当我在浏览器中浏览localhost时,可以看到WAMP服务器页面。
But when I browse to my IP in my browser, I get the message
但是当我在浏览器中浏览我的IP时,我得到了消息。
403 Forbidden: You don't have permission to access / on this server.
禁用:您没有权限访问/在此服务器上。
Any suggestions?
有什么建议吗?
25 个解决方案
#1
126
The access to your Apache server is forbidden from addresses other than 127.0.0.1
in httpd.conf
(Apache's config file) :
在httpd中,访问Apache服务器的地址是127.0.0.1以外的地址。conf (Apache配置文件):
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf
:
对于PHPMyAdmin访问,配置文件是PHPMyAdmin。配置:
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
You can set them to allow connections from all IP addresses like follows :
您可以设置它们允许来自所有IP地址的连接如下:
AllowOverride All
Order allow,deny
Allow from all
#2
60
I found a simpler fix...
我找到了一个更简单的方法……
Although the icon was green WAMP still needs to be "Put Online" (last item of menu when left-clicking icon).
虽然这个图标是绿色的,但仍然需要“放到网上”(当鼠标左键点击图标时,菜单上的最后一项)。
After that I had access as normal.
在那之后,我可以正常地进入。
#3
25
For me the inclusion of "Require local" helped to solve Error 403. The alias config file looks like this:
对我来说,包含“需要本地”帮助解决了错误403。别名配置文件如下所示:
Alias /mytest/ "C:/mytest/"
<Directory "C:/mytest/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
Require local
</Directory>
#4
10
The solution for changing the permissions in the httpd.conf will work if you are OK with providing access to the WAMP server from outside.
更改httpd中的权限的解决方案。如果您可以从外部提供对WAMP服务器的访问,那么conf将起作用。
If you do not want to do that then all you have to do is tell windows that the "localhost" domain points to 127.0.0.1. You can do that by editing the hosts file in your system directory.
如果您不想这样做,那么您所要做的就是告诉windows“localhost”域指向127.0.0.1。您可以通过编辑系统目录中的主机文件来实现这一点。
The file is placed at : C:\Windows\System32\drivers\etc\hosts
该文件被放置在:c:) windowssystem32 etchost。
by default windows 7 ships with :
默认windows 7船舶:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
You have to un-comment the mapping for localhost:
您必须取消对本地主机的映射的注释:
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
Note: you will not be able to edit the hosts file as its a read-only file. To edit, you have to be the administrator, copy the file to some other location, edit it and then copy it back to the etc directory.
注意:您将无法编辑主机文件作为它的只读文件。要编辑,您必须是管理员,将文件复制到其他位置,编辑它,然后将其复制到etc目录。
I do not recommend the change of the hosts file. Use the permissions of httpd.conf file. use the hosts file approach only if you do not want the server accessed from outside.
我不建议更改主机文件。使用httpd的权限。conf文件。只有在不希望从外部访问服务器时,才使用主机文件方法。
#5
7
Another thing I found out is that if your network adapter uses IPV6, it will not show as 127.0.0.1 but ::1
我发现的另一件事是,如果您的网络适配器使用了IPV6,它将不会显示为127.0.0.1,而是::1。
What I ended up doing is this:
我最后做的是
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :
对于PHPMyAdmin访问,配置文件是PHPMyAdmin。配置:
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
#6
7
Try adding the following lines of code to the file httpd-vhosts.conf:
尝试将以下代码行添加到文件httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin serveradmin@host.com
DocumentRoot "C:\wamp\www"
ServerName localhost
</VirtualHost>
#7
4
if you have used localhost/phpmyadmin/
如果您使用了localhost/phpmyadmin/。
simply use
简单地使用
127.0.0.1/phpmyadmin/ for PHPMyAdmin
phpmyadmin 127.0.0.1 phpmyadmin /
127.0.0.1/sqlbuddy/ for SQLBuddy
127.0.0.1 sqlbuddy sqlbuddy /
or if you have used localhost:8080/phpmyadmin/ then
或者,如果您使用了localhost:8080/phpmyadmin/ then。
127.0.0.1:8080/phpmyadmin/ for PHPMyAdmin
phpmyadmin 127.0.0.1:8080 phpmyadmin /
127.0.0.1:8080/sqlbuddy/ for SQLBuddy
127.0.0.1:8080 sqlbuddy sqlbuddy /
#8
4
Remember to remove dummy elements in httpd-vhosts.conf
记住在httpd-vhosts.conf中删除虚拟元素。
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
#9
3
For Apache version 2.4.x simply replace Require local
with Require all granted
in httpd.conf file inside <Directory "c:/wamp/www/">
tag then Restart all services
Apache 2.4版。简单地用httpd中的所有请求替换本地的需要。conf文件在 <目录“c: wamp www ”> 标签,然后重新启动所有服务。
#10
2
There could many causes to this problems
这个问题有很多原因。
What I have experienced are:
1) 127.0.0.1 localhost
entry was duplicated in hosts file
2) Apache mod_rewrite
was not enabled
我所经历的是:1)127.0.0.1 localhost条目被复制在主机文件2)Apache mod_rewrite没有启用!
Regardless of the cause, backing up your www
folder, vhost configuration file (and httpd configuration file) will help. And such process takes a few minutes.
不管原因是什么,备份您的www文件夹,vhost配置文件(和httpd配置文件)将会有所帮助。这样的过程需要几分钟。
Good luck
祝你好运
#11
2
I read & tried All Fixes But Not one worked. At last i Found that the Wamp Server Logo Is Green But Need to Be "PUT ONLINE". So simple & a Quick Fix After Checking Your PHPMyAdmin.Cofg
& HttPD.cofg
Just Click on PUT ONLINE
我阅读并尝试了所有的修正,但没有一个成功。最后,我发现Wamp服务器的标志是绿色的,但需要“放到网上”。检查你的PHPMyAdmin后,简单快速的修复。Cofg & HttPD。cofg只需在网上点击即可。
#12
1
I tried the configs above and only this worked for my WAMP Apache 2.4.2 config. For multiple root site without named domains in your Windows hosts file, use http://locahost:8080, http://localhost:8081, http://localhost:8082
and this configuration:
我尝试了上面的configs,只对我的WAMP Apache 2.4.2配置进行了操作。对于在您的Windows主机文件中没有命名域的多个根站点,请使用http://locahost:8080, http://localhost:8081http://localhost:8082和这个配置:
#ServerName localhost:80
ServerName localhost
Listen 8080
Listen 8081
Listen 8082
#.....
<VirtualHost *:8080>
DocumentRoot "c:\www"
ServerName localhost
<Directory "c:/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8081>
DocumentRoot "C:\www\directory abc\svn_abc\trunk\httpdocs"
ServerName localhost
<Directory "C:\www\directory abc\svn_abc\trunk\httpdocs">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
#<VirtualHost *:8082></VirtualHost>.......
#13
1
I faced this issue with wamp on windows 7. Adding following code to httpd-vhosts.conf solved the issue for me.
我在windows 7上遇到了这个问题。将以下代码添加到httpd-vhosts。conf帮我解决了这个问题。
<VirtualHost *:80>
DocumentRoot "F:/wamp_server/www/"
ServerName localhost
</VirtualHost>
#14
1
It took me forever to figure this out.
我花了很长时间才弄明白。
C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
C:\ wamp \ bin \ apache \ apache2.4.9 \ conf \额外\ httpd-vhosts.conf
In this file you will notice several example virtual host files, that look like:
在这个文件中,您将注意到几个示例虚拟主机文件,如下所示:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
Simply delete these entries and replace with:
简单地删除这些条目并替换为:
<VirtualHost *:80>
ServerAdmin serveradmin@host.com
DocumentRoot "C:\wamp\www"
ServerName localhost
</VirtualHost>
You definitely need to make sure your other ducks are in a row but this for me with the solution that worked.
你一定要确保你的其他鸭子都是在一排,但这对我来说是有效的解决方案。
#15
0
hi there are 2 solutions :
你好,有两种解决方案:
-
change the port 80 to 81 in the text file (httpd.conf) and click 127.0.0.1:81
在文本文件(httpd.conf)中更改端口80到81,然后单击127.0.0.1:81。
-
change setting the network go to control panel--network and internet--network and sharing center
改变设置网络到控制面板——网络和互联网——网络和共享中心。
click-->local area connection select-->propertis check true in the -allow other ..... and --- allo other .....
点击->本地连接选择->propertis在-允许其他的…--- allo还有其他的…
#16
0
I had this problem too. The route of my problem was I had made a mistake in my vhosts.conf file. If you are using vhosts this is another thing to check
我也有这个问题。我的问题的路径是我在我的虚拟主机上犯了一个错误。conf文件。如果您正在使用vhosts,这是另一个要检查的东西。
#17
0
This configuration in httpd.conf work fine for me.
这在httpd配置。conf对我来说没问题。
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
</Directory>
#18
0
Make sure you aren't using a Windows' directory separator character (backslash) in your path names in your .conf file, even if you are on Windows. Apache doesn't understand them but will still start up and then output a 403 Forbidden Message
.
确保在.conf文件的路径名中没有使用Windows的目录分隔符(反斜杠),即使是在Windows上。Apache不理解它们,但是仍然会启动,然后输出一个403的禁止消息。
wrong:
错误的:
<Directory "c:\websites\my-website\">
right:
正确的:
<Directory "c:/websites/my-website/">
#19
0
Surprisingly, square brackets in DocumentRoot (and related, like <Directory>) paths can also cause error 403:
令人惊讶的是,DocumentRoot中的方括号(以及相关的,比如
-
DocumentRoot "P:/TRY/web/fatfree/from_github/fatfree-master[bang]"
failed with 403, while - 文件根“P:/尝试/web/fatfree/from_github/fatfree-master[bang]”失败了403,while。
-
DocumentRoot "P:/TRY/web/fatfree/from_github/fatfree-master"
worked fine. - DocumentRoot“P:/ / web / fatfree / from_github / fatfree-master”工作得很好。
(I didn't bother figuring out the Apache path escaping, if any, just renamed the path instead. If anyone knows, comments are welcome.)
(如果有的话,我并没有费心去计算Apache路径,只是重新命名了路径。如果有人知道,欢迎评论。
#20
0
My solution was to disable encoding for encoded files (these files are green in windows). Ive got these files from MAC computer and it was encrypted by default.
我的解决方案是禁用编码文件的编码(这些文件在windows中是绿色的)。我从MAC电脑上得到这些文件,默认是加密的。
Ive select these files > right click > properities > general tab > andvanced > uncheck encrypt files...
我选择了这些文件>右击> properities > general tab >,然后是> uncheck加密文件…
And voila it works.
瞧它的工作原理。
#21
0
I have tried all the stuff except clearing the mess in .htaccess file.
我已经尝试了所有的东西,除了清除。htaccess文件中的混乱。
Go to www/ directory and make a copy of .htaccess file in another folder. Then clear all the lines in .htaccess original file. And add this line,
进入www/目录并在另一个文件夹中复制.htaccess文件。然后清除.htaccess原始文件中的所有行。并添加这条线,
RewriteEngine On
RewriteEngine上
Then restart the server. This has solved my problem and got access to all my localhost sites. Hope it would solve yours too.
然后重新启动服务器。这解决了我的问题,并访问了所有本地主机站点。希望它也能解决你的问题。
#22
0
Also on Apache 2,4 you may need to add this to the directory directive in conf, in case you decided to include httpd-vhosts.conf.
同样在Apache 2、4中,您可能需要将其添加到conf中的目录指令,以防您决定包含httpd-vhosts.conf。
By default you can install wamp in C:\ but still choose to deploy your web development in another location.
默认情况下,您可以在C中安装wamp:\但仍然选择在另一个位置部署web开发。
To do this inside the vhosts.conf you can add this directive:
在vhost中做这个。你可以添加这个指令:
<Directory "e:/websites">
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
AllowOverride All
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Allow from all
Allow from localhost ::1 127.0.0.1
</IfDefine>
</Directory>
#23
0
Thanks for your question. I'am using wamp 3 now. And I find an simple answer to do this under your question. But that answer should change a little on wamp 3. The steps are as following:
谢谢你的问题。我现在用的是wamp 3。在你的问题下我找到了一个简单的答案。但是这个答案应该在wamp 3上有所改变。步骤如下:
- Right click wamp icon
- 右键点击里面的图标
- Choose Wamp Setting
- 选择里面设置
- Click the Menu item:online/offline
- 单击菜单项:在线/离线
- Left click wamp icon
- 左键点击里面的图标
- You will find there is a new item called "Put online"
- 你会发现有一个新项目叫做“上线”
#24
0
make sure that, the name of the file in the directory c:/wamp/apps/phpmyadmin3.1.3.1/
, match the name (or version) in the phpMyAdmin.conf (Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.1.3.1/"
)
请确保在目录c:/wamp/apps/phpmyadmin3.1.3.1/中文件的名称与phpMyAdmin中的名称(或版本)匹配。conf(别名/phpmyadmin“c:/wamp/apps/phpmyadmin3.1.3.1/”)
#25
0
I have found that if you are using ammps that for some reason its always forbidden when its in your root folder so i put it in the directory above my root folder and made a alias in the httpd.conf
using this
我发现,如果你使用ammps,由于某些原因,它在你的根文件夹中总是被禁止,所以我把它放在根文件夹上面的目录中,并在httpd中做了一个别名。配置使用此
Alias /phpmyadmin "C:/Program Files (x86)/Ampps/phpMyAdmin"
别名/phpmyadmin“C:/程序文件(x86)/Ampps/ phpmyadmin”
please note i am using ammps and i dont know for sure if it will work for others but its worth a try ;)
请注意,我正在使用ammps,我不确定它是否会为别人工作,但它值得一试;
#1
126
The access to your Apache server is forbidden from addresses other than 127.0.0.1
in httpd.conf
(Apache's config file) :
在httpd中,访问Apache服务器的地址是127.0.0.1以外的地址。conf (Apache配置文件):
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf
:
对于PHPMyAdmin访问,配置文件是PHPMyAdmin。配置:
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
You can set them to allow connections from all IP addresses like follows :
您可以设置它们允许来自所有IP地址的连接如下:
AllowOverride All
Order allow,deny
Allow from all
#2
60
I found a simpler fix...
我找到了一个更简单的方法……
Although the icon was green WAMP still needs to be "Put Online" (last item of menu when left-clicking icon).
虽然这个图标是绿色的,但仍然需要“放到网上”(当鼠标左键点击图标时,菜单上的最后一项)。
After that I had access as normal.
在那之后,我可以正常地进入。
#3
25
For me the inclusion of "Require local" helped to solve Error 403. The alias config file looks like this:
对我来说,包含“需要本地”帮助解决了错误403。别名配置文件如下所示:
Alias /mytest/ "C:/mytest/"
<Directory "C:/mytest/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
Require local
</Directory>
#4
10
The solution for changing the permissions in the httpd.conf will work if you are OK with providing access to the WAMP server from outside.
更改httpd中的权限的解决方案。如果您可以从外部提供对WAMP服务器的访问,那么conf将起作用。
If you do not want to do that then all you have to do is tell windows that the "localhost" domain points to 127.0.0.1. You can do that by editing the hosts file in your system directory.
如果您不想这样做,那么您所要做的就是告诉windows“localhost”域指向127.0.0.1。您可以通过编辑系统目录中的主机文件来实现这一点。
The file is placed at : C:\Windows\System32\drivers\etc\hosts
该文件被放置在:c:) windowssystem32 etchost。
by default windows 7 ships with :
默认windows 7船舶:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
You have to un-comment the mapping for localhost:
您必须取消对本地主机的映射的注释:
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
Note: you will not be able to edit the hosts file as its a read-only file. To edit, you have to be the administrator, copy the file to some other location, edit it and then copy it back to the etc directory.
注意:您将无法编辑主机文件作为它的只读文件。要编辑,您必须是管理员,将文件复制到其他位置,编辑它,然后将其复制到etc目录。
I do not recommend the change of the hosts file. Use the permissions of httpd.conf file. use the hosts file approach only if you do not want the server accessed from outside.
我不建议更改主机文件。使用httpd的权限。conf文件。只有在不希望从外部访问服务器时,才使用主机文件方法。
#5
7
Another thing I found out is that if your network adapter uses IPV6, it will not show as 127.0.0.1 but ::1
我发现的另一件事是,如果您的网络适配器使用了IPV6,它将不会显示为127.0.0.1,而是::1。
What I ended up doing is this:
我最后做的是
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :
对于PHPMyAdmin访问,配置文件是PHPMyAdmin。配置:
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
#6
7
Try adding the following lines of code to the file httpd-vhosts.conf:
尝试将以下代码行添加到文件httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin serveradmin@host.com
DocumentRoot "C:\wamp\www"
ServerName localhost
</VirtualHost>
#7
4
if you have used localhost/phpmyadmin/
如果您使用了localhost/phpmyadmin/。
simply use
简单地使用
127.0.0.1/phpmyadmin/ for PHPMyAdmin
phpmyadmin 127.0.0.1 phpmyadmin /
127.0.0.1/sqlbuddy/ for SQLBuddy
127.0.0.1 sqlbuddy sqlbuddy /
or if you have used localhost:8080/phpmyadmin/ then
或者,如果您使用了localhost:8080/phpmyadmin/ then。
127.0.0.1:8080/phpmyadmin/ for PHPMyAdmin
phpmyadmin 127.0.0.1:8080 phpmyadmin /
127.0.0.1:8080/sqlbuddy/ for SQLBuddy
127.0.0.1:8080 sqlbuddy sqlbuddy /
#8
4
Remember to remove dummy elements in httpd-vhosts.conf
记住在httpd-vhosts.conf中删除虚拟元素。
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
#9
3
For Apache version 2.4.x simply replace Require local
with Require all granted
in httpd.conf file inside <Directory "c:/wamp/www/">
tag then Restart all services
Apache 2.4版。简单地用httpd中的所有请求替换本地的需要。conf文件在 <目录“c: wamp www ”> 标签,然后重新启动所有服务。
#10
2
There could many causes to this problems
这个问题有很多原因。
What I have experienced are:
1) 127.0.0.1 localhost
entry was duplicated in hosts file
2) Apache mod_rewrite
was not enabled
我所经历的是:1)127.0.0.1 localhost条目被复制在主机文件2)Apache mod_rewrite没有启用!
Regardless of the cause, backing up your www
folder, vhost configuration file (and httpd configuration file) will help. And such process takes a few minutes.
不管原因是什么,备份您的www文件夹,vhost配置文件(和httpd配置文件)将会有所帮助。这样的过程需要几分钟。
Good luck
祝你好运
#11
2
I read & tried All Fixes But Not one worked. At last i Found that the Wamp Server Logo Is Green But Need to Be "PUT ONLINE". So simple & a Quick Fix After Checking Your PHPMyAdmin.Cofg
& HttPD.cofg
Just Click on PUT ONLINE
我阅读并尝试了所有的修正,但没有一个成功。最后,我发现Wamp服务器的标志是绿色的,但需要“放到网上”。检查你的PHPMyAdmin后,简单快速的修复。Cofg & HttPD。cofg只需在网上点击即可。
#12
1
I tried the configs above and only this worked for my WAMP Apache 2.4.2 config. For multiple root site without named domains in your Windows hosts file, use http://locahost:8080, http://localhost:8081, http://localhost:8082
and this configuration:
我尝试了上面的configs,只对我的WAMP Apache 2.4.2配置进行了操作。对于在您的Windows主机文件中没有命名域的多个根站点,请使用http://locahost:8080, http://localhost:8081http://localhost:8082和这个配置:
#ServerName localhost:80
ServerName localhost
Listen 8080
Listen 8081
Listen 8082
#.....
<VirtualHost *:8080>
DocumentRoot "c:\www"
ServerName localhost
<Directory "c:/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8081>
DocumentRoot "C:\www\directory abc\svn_abc\trunk\httpdocs"
ServerName localhost
<Directory "C:\www\directory abc\svn_abc\trunk\httpdocs">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
#<VirtualHost *:8082></VirtualHost>.......
#13
1
I faced this issue with wamp on windows 7. Adding following code to httpd-vhosts.conf solved the issue for me.
我在windows 7上遇到了这个问题。将以下代码添加到httpd-vhosts。conf帮我解决了这个问题。
<VirtualHost *:80>
DocumentRoot "F:/wamp_server/www/"
ServerName localhost
</VirtualHost>
#14
1
It took me forever to figure this out.
我花了很长时间才弄明白。
C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
C:\ wamp \ bin \ apache \ apache2.4.9 \ conf \额外\ httpd-vhosts.conf
In this file you will notice several example virtual host files, that look like:
在这个文件中,您将注意到几个示例虚拟主机文件,如下所示:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
Simply delete these entries and replace with:
简单地删除这些条目并替换为:
<VirtualHost *:80>
ServerAdmin serveradmin@host.com
DocumentRoot "C:\wamp\www"
ServerName localhost
</VirtualHost>
You definitely need to make sure your other ducks are in a row but this for me with the solution that worked.
你一定要确保你的其他鸭子都是在一排,但这对我来说是有效的解决方案。
#15
0
hi there are 2 solutions :
你好,有两种解决方案:
-
change the port 80 to 81 in the text file (httpd.conf) and click 127.0.0.1:81
在文本文件(httpd.conf)中更改端口80到81,然后单击127.0.0.1:81。
-
change setting the network go to control panel--network and internet--network and sharing center
改变设置网络到控制面板——网络和互联网——网络和共享中心。
click-->local area connection select-->propertis check true in the -allow other ..... and --- allo other .....
点击->本地连接选择->propertis在-允许其他的…--- allo还有其他的…
#16
0
I had this problem too. The route of my problem was I had made a mistake in my vhosts.conf file. If you are using vhosts this is another thing to check
我也有这个问题。我的问题的路径是我在我的虚拟主机上犯了一个错误。conf文件。如果您正在使用vhosts,这是另一个要检查的东西。
#17
0
This configuration in httpd.conf work fine for me.
这在httpd配置。conf对我来说没问题。
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
</Directory>
#18
0
Make sure you aren't using a Windows' directory separator character (backslash) in your path names in your .conf file, even if you are on Windows. Apache doesn't understand them but will still start up and then output a 403 Forbidden Message
.
确保在.conf文件的路径名中没有使用Windows的目录分隔符(反斜杠),即使是在Windows上。Apache不理解它们,但是仍然会启动,然后输出一个403的禁止消息。
wrong:
错误的:
<Directory "c:\websites\my-website\">
right:
正确的:
<Directory "c:/websites/my-website/">
#19
0
Surprisingly, square brackets in DocumentRoot (and related, like <Directory>) paths can also cause error 403:
令人惊讶的是,DocumentRoot中的方括号(以及相关的,比如
-
DocumentRoot "P:/TRY/web/fatfree/from_github/fatfree-master[bang]"
failed with 403, while - 文件根“P:/尝试/web/fatfree/from_github/fatfree-master[bang]”失败了403,while。
-
DocumentRoot "P:/TRY/web/fatfree/from_github/fatfree-master"
worked fine. - DocumentRoot“P:/ / web / fatfree / from_github / fatfree-master”工作得很好。
(I didn't bother figuring out the Apache path escaping, if any, just renamed the path instead. If anyone knows, comments are welcome.)
(如果有的话,我并没有费心去计算Apache路径,只是重新命名了路径。如果有人知道,欢迎评论。
#20
0
My solution was to disable encoding for encoded files (these files are green in windows). Ive got these files from MAC computer and it was encrypted by default.
我的解决方案是禁用编码文件的编码(这些文件在windows中是绿色的)。我从MAC电脑上得到这些文件,默认是加密的。
Ive select these files > right click > properities > general tab > andvanced > uncheck encrypt files...
我选择了这些文件>右击> properities > general tab >,然后是> uncheck加密文件…
And voila it works.
瞧它的工作原理。
#21
0
I have tried all the stuff except clearing the mess in .htaccess file.
我已经尝试了所有的东西,除了清除。htaccess文件中的混乱。
Go to www/ directory and make a copy of .htaccess file in another folder. Then clear all the lines in .htaccess original file. And add this line,
进入www/目录并在另一个文件夹中复制.htaccess文件。然后清除.htaccess原始文件中的所有行。并添加这条线,
RewriteEngine On
RewriteEngine上
Then restart the server. This has solved my problem and got access to all my localhost sites. Hope it would solve yours too.
然后重新启动服务器。这解决了我的问题,并访问了所有本地主机站点。希望它也能解决你的问题。
#22
0
Also on Apache 2,4 you may need to add this to the directory directive in conf, in case you decided to include httpd-vhosts.conf.
同样在Apache 2、4中,您可能需要将其添加到conf中的目录指令,以防您决定包含httpd-vhosts.conf。
By default you can install wamp in C:\ but still choose to deploy your web development in another location.
默认情况下,您可以在C中安装wamp:\但仍然选择在另一个位置部署web开发。
To do this inside the vhosts.conf you can add this directive:
在vhost中做这个。你可以添加这个指令:
<Directory "e:/websites">
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
AllowOverride All
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Allow from all
Allow from localhost ::1 127.0.0.1
</IfDefine>
</Directory>
#23
0
Thanks for your question. I'am using wamp 3 now. And I find an simple answer to do this under your question. But that answer should change a little on wamp 3. The steps are as following:
谢谢你的问题。我现在用的是wamp 3。在你的问题下我找到了一个简单的答案。但是这个答案应该在wamp 3上有所改变。步骤如下:
- Right click wamp icon
- 右键点击里面的图标
- Choose Wamp Setting
- 选择里面设置
- Click the Menu item:online/offline
- 单击菜单项:在线/离线
- Left click wamp icon
- 左键点击里面的图标
- You will find there is a new item called "Put online"
- 你会发现有一个新项目叫做“上线”
#24
0
make sure that, the name of the file in the directory c:/wamp/apps/phpmyadmin3.1.3.1/
, match the name (or version) in the phpMyAdmin.conf (Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.1.3.1/"
)
请确保在目录c:/wamp/apps/phpmyadmin3.1.3.1/中文件的名称与phpMyAdmin中的名称(或版本)匹配。conf(别名/phpmyadmin“c:/wamp/apps/phpmyadmin3.1.3.1/”)
#25
0
I have found that if you are using ammps that for some reason its always forbidden when its in your root folder so i put it in the directory above my root folder and made a alias in the httpd.conf
using this
我发现,如果你使用ammps,由于某些原因,它在你的根文件夹中总是被禁止,所以我把它放在根文件夹上面的目录中,并在httpd中做了一个别名。配置使用此
Alias /phpmyadmin "C:/Program Files (x86)/Ampps/phpMyAdmin"
别名/phpmyadmin“C:/程序文件(x86)/Ampps/ phpmyadmin”
please note i am using ammps and i dont know for sure if it will work for others but its worth a try ;)
请注意,我正在使用ammps,我不确定它是否会为别人工作,但它值得一试;