LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-20-2010, 03:42 PM   #1
shifter
Member
 
Registered: May 2006
Distribution: Slackware, DragonFly
Posts: 233

Rep: Reputation: 30
403 forbidden error with apache2


I have the following message with apache:

Quote:
Forbidden

You don't have permission to access /site/home.html on this server.
Apache/2.2.12 (Ubuntu) Server at localhost Port 80
home.html isn't in /var/www but in my /home/myname/site/
How can visualize my site in my local directory?

[I mistaked topic]

Last edited by shifter; 01-20-2010 at 03:48 PM.
 
Old 01-20-2010, 09:19 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
You may want consider moving the content to /var/www/

Or you may need to give the apache user permissions to browse your home directory.
 
Old 01-21-2010, 10:48 AM   #3
shifter
Member
 
Registered: May 2006
Distribution: Slackware, DragonFly
Posts: 233

Original Poster
Rep: Reputation: 30
Quote:
Or you may need to give the apache user permissions to browse your home directory.
How can I to do apache permissions to browse my home directory?
 
Old 01-21-2010, 07:44 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Does your home directory contain web documents? If so, and if you really wanted to, you could make /var/www/index.php something like this:
Code:
<?php
  page=$_GET["page"];
  if (preg_match("/^[^/].*\.htm(l|)$/", $page) && !preg_match("/\.\./", $page))
    readfile("/home/shifter/$page");
?>
Then type http://localhost/?page=mypage.htm in your browser.

Chances are you have other things that aren't HTML in your home directory. HTTP is a text protocol and not much else; therefore, something would have to create a page listing the contents of your home directory with the proper logic to navigate to the next location. Maybe you just need to run an FTP server.
Kevin Barry

Last edited by ta0kira; 01-21-2010 at 07:46 PM.
 
Old 01-22-2010, 06:22 AM   #5
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by shifter View Post
How can I to do apache permissions to browse my home directory?
You first need to find out what user is running apache. ps -AF might help you there, look for the httpd process.

Once you have the user you will need to make you home directory readable by that user check out chmod. This will require you to make all the nested directories readable.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2: Access forbidden! Error 403 vous Linux - Server 4 10-11-2011 05:46 AM
403 forbidden in Alias on apache2 TruthSeeker Linux - Server 2 06-17-2008 01:35 PM
Apache: 403 Forbidden Error daemonkl Linux - Newbie 4 10-14-2007 01:15 PM
Apache2 virtual host cgi 403 Forbidden / mossy Linux - Software 15 07-27-2005 05:56 PM
apache error, 403 forbidden afrodocter Linux - Software 6 08-09-2004 09:35 PM


All times are GMT -5. The time now is 06:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration