简体   繁体   中英

Apache - Forbidden You don't have permission

I use "HTTP Server powered by Apache" app on android. I start the server and open 127.0.0.1:8000 on chrome, say: Forbidden You don't have permission to access / on this server. Maybe there is a problem with my Apache config, but httpd.conf is empty.

Make sure the Document Root is specified and that there's a file in there that corresponds to the index file. On a standard install this is something like [ DocumentRoot "/usr/local/www/apache22/data" ] and " DirectoryIndex index.html " ... ensure that index.html exists. If the problem continues after this permissions (either filesystem or httpd document root configuration) is likely the issue.

i was having the same problem too with "HTTP Server powered by Apache" app on Android, however i take a look at ..htdocs/log/errors.log when starting the app, and i found DocumentRoot var was at ..htdocs/public, so the solution was create an index.html file over that directory so:

Put this content:

 <html> <head> <title> My page </title> </head> <body> Hello <b>World!</b> </body> </html> 

In a file called index.html

Copy or edit that file at your Android directory /storage/emulated/0/htdocs/public directory .. or simply .. //sdcard/htdocs/public, directory, which is the same anyway.

Then run you server in other device to test it (default your.ip.address:8000) or your.ip.address:8000/index.html And then it will work smooth and nice as expected. Please check my localhost example webpage , which is working now with the index.html file at public directory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM