Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-23-2016, 08:45 AM   #1
LQ Newbie
Registered: Feb 2016
Posts: 10

Rep: Reputation: Disabled
Wordpress showing 403 forbidden

I have installed wordpress in my my test domain ! But while accessing it that is i get error as Forbidden

You don't have permission to access /wp-admin/ on this server.
I hsve set up .htaccess file properly and made permissions (755 for dir 644 for files) as well. Can somebody help ??
Old 02-23-2016, 09:08 AM   #2
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147Reputation: 2147

Using Unix Groups

Most users will want to be able to modify their content without being root.
The easiest way to achieve this is through the use of Unix Groups; you create
a group to which you add your content editing user, then you add the httpd 
user to that group.

Note that this doesn't easilly extend to more than one user who needs to
edit the files, since at that point you need to set Group write on the files.
One would need to use ACL's to achive this.

For example, we have a user "alice" who needs to edit our content, stored
in /var/www/html/

First we create the content group, then we add both alice and apache to it.

# groupadd www-content 
# usermod -G www-content <user-name>
# usermod -G www-content apache

Now we need to set the right permissions on our files.

# chown -R alice:web-content /var/www/html
# find /var/www/html -type f -exec chmod 640 {} \;
# find /var/www/html -type d -exec chmod 750 {} \;

What we've done here is to set all files to 640, or rw-r----- and directories
to rwxr-x---. Because the group "web-content" is applied to all the files
and directories, httpd can read these files, but cannot write to them.




Last edited by BW-userx; 02-23-2016 at 09:26 AM.
Old 02-23-2016, 09:42 AM   #3
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
sudo chmod www-data:www-data /var/www/html -R
Unless your DocumentRoot is non-standard, eg: not in, or under /var/www/ ?


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
Forbidden 403 marisac Ubuntu 3 04-19-2014 11:36 AM
403 forbidden kpsajeer General 5 08-24-2011 03:18 PM
403 Forbidden martin1234 Linux - General 1 06-22-2009 02:27 PM
403 Forbidden JanDeMan Linux - Newbie 7 04-12-2004 04:02 PM
403 Forbidden??? morbo Linux - Networking 11 07-04-2002 11:17 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:16 PM.

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