LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-31-2014, 01:19 AM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Question Forbidden You don't have permission to access / on this server.


Hey LQ,

So today, for seemingly random reasons my server is not allowing me to view any webpages. It keeps giving me the error as mentioned in my thread title. As far as I know, I didn't change anything to do with Apache that would have caused this and it was working completely fine last night.

Any ideas on where to start?

My server is Ubuntu 12.04LTS. I did not use 'tasksel' to install the LAMP server but followed this guide: http://www.howtoforge.com/ubuntu_lamp_for_newbies
 
Old 03-31-2014, 02:42 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,291

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Something is borked. I presume access to / is forbidden anyhow. A full path name might provoke that. Can you ssh in and check permissions? Can you send a hup to aopache, or even restart? Failing that I'd ask whoever has it to reboot it. If you can't see stuff, nobody else can. Then go in with a rootkit hunter such as rkhunter.
 
Old 03-31-2014, 02:59 AM   #3
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by business_kid View Post
Something is borked. I presume access to / is forbidden anyhow. A full path name might provoke that. Can you ssh in and check permissions? Can you send a hup to aopache, or even restart? Failing that I'd ask whoever has it to reboot it. If you can't see stuff, nobody else can. Then go in with a rootkit hunter such as rkhunter.
Its a xen vps box. I can ssh into it still. Should I give it a restart and see if that helps?
 
Old 03-31-2014, 06:37 AM   #4
bulldozers
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Rep: Reputation: 0
One time the same happened to me because of restarting the Apache as a different user. It caused a big mess in terms of config and log files.
 
Old 03-31-2014, 01:40 PM   #5
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Exclamation

Quote:
Originally Posted by bulldozers View Post
One time the same happened to me because of restarting the Apache as a different user. It caused a big mess in terms of config and log files.
Ok well I updated three updates, then restarted. Still can't access anything in the webroot. What should the permissions be for this to work?

My www-root is set to /var/www and my system is a single user root system with out sudo. So root owns and operates everything.

Code:
root@xxxx:~# ls -l /var/www
-rwxrwxrw- 1 root root    0 Mar 29 05:34 index.php
drwxrwxrw- 7 root root 4096 Mar 29 05:34 projects
-rwxrwxrw- 1 root root   25 Mar 29 05:34 robots.txt
drwxrwxrw- 2 root root 4096 Mar 29 05:35 tmp
 
Old 03-31-2014, 03:58 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by wh33t View Post
What should the permissions be for this to work?

Code:
root@xxxx:~# ls -l /var/www
-rwxrwxrw- 1 root root    0 Mar 29 05:34 index.php
drwxrwxrw- 7 root root 4096 Mar 29 05:34 projects
-rwxrwxrw- 1 root root   25 Mar 29 05:34 robots.txt
drwxrwxrw- 2 root root 4096 Mar 29 05:35 tmp
Not that.
Those are an obvious hack (to me) to force it to work.

See http://askubuntu.com/questions/47521...ocal-webserver

What is your DocumentRoot set to?

Last edited by Habitual; 03-31-2014 at 04:02 PM.
 
Old 03-31-2014, 04:06 PM   #7
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by Habitual View Post
Not that.
Those are an obvious hack (to me) to force it to work.

See http://askubuntu.com/questions/47521...ocal-webserver

What is your DocumentRoot set to?
Document root is set to /var/www
 
Old 03-31-2014, 04:08 PM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
grep -e apache -e www /etc/passwd
output?

Edit: does http://localhost/testphp.php work
from http://www.howtoforge.com/ubuntu_lamp_for_newbies ?

Last edited by Habitual; 03-31-2014 at 04:12 PM.
 
Old 03-31-2014, 04:29 PM   #9
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by Habitual View Post
Code:
grep -e apache -e www /etc/passwd
output?

Edit: does http://localhost/testphp.php work
from http://www.howtoforge.com/ubuntu_lamp_for_newbies ?
Code:
root@xxxx:~# grep -e apache -e www /etc/passwd
www-data:x:33:33:www-data:/var/www:/bin/sh
This whole thing was running completely fine a day ago. I swear I woke up next morning and it started doing this to me.
 
Old 04-01-2014, 08:32 AM   #10
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by wh33t View Post
Code:
root@xxxx:~# ls -l /var/www
-rwxrwxrw- 1 root root    0 Mar 29 05:34 index.php
drwxrwxrw- 7 root root 4096 Mar 29 05:34 projects
-rwxrwxrw- 1 root root   25 Mar 29 05:34 robots.txt
drwxrwxrw- 2 root root 4096 Mar 29 05:35 tmp
as root:
Code:
chown -R www-data:www-data /var/www
Restart apache|httpd, test. Report back.
 
  


Reply



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
PhpMyAdmin : 403 forbidden. You don't have permission to access [...] on this server. User-N@me Linux - Server 7 06-23-2011 07:30 PM
Forbidden You don't have permission to access / on this server. dav_y2k Linux - Server 4 10-25-2010 09:47 AM
[SOLVED] Forbidden You don't have permission to access /moodle on this server. Apache/2.2.16 abdul kadir Linux - Newbie 3 08-27-2010 03:07 AM
Forbidden You don't have permission to access / on this server tekmann33 Linux - Software 4 06-16-2009 03:17 AM
After file oops ? Forbidden You don't have permission to access / on this server. leongoogs Linux - Newbie 3 04-13-2004 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:47 AM.

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
Open Source Consulting | Domain Registration