LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-11-2015, 10:31 AM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 486

Rep: Reputation: 36
after installing xampp, I got Access forbidden!


I've installed xampp 5.6.14 / PHP 5.6.14 x64 on centos 7.1.
After creating "var/www/html" directory and make test site under "var/www/html/test", I opened this url, but this error comes.

Quote:
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
test.com
Apache/2.4.17 (Unix) OpenSSL/1.0.1p PHP/5.6.14 mod_perl/2.0.8-dev Perl/v5.16.3
1. I logged in as root
2.
Quote:
[root@localhost ~]# chown -R windstory:cowebworker /var/www/html/*
[root@localhost ~]# chmod -R 755 /var/www/html
[root@localhost ~]# chmod -R 755 /var/www/html/*
3. at /opt/lampp/etc/extra/httpd-vhosts.conf
Code:
<VirtualHost *:80>
	ServerAdmin webmaster@server2.net
	DocumentRoot /var/www/html/goldenpen
	ServerName localhost.goldenpen
	ServerAlias www.localhost.goldenpen
    <Directory /var/www/html/goldenpen>  
		Require all granted
    </Directory>
	CustomLog "logs/localhost.goldenpen_access_log.%Y-%m-%d 86400 +540" common
	ErrorLog "logs/localhost.goldenpen_error_log.%Y-%m-%d 86400 +540" 
</VirtualHost>
Please let me know what I am wrong.
Thanks in advance.

Last edited by windstory; 11-11-2015 at 10:36 AM.
 
Old 11-11-2015, 11:45 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
I'm not familiar with CentOS but I am surprised you would need to create the /var/www/html directory. Most Linux distributions would have it by default. So what were the owner:group and permissions on this directory before you changed them? Generally, this directory is user:group apache:apache although different distributions have different names for apache in this instance. Your user would then need to be in the apache group.
 
1 members found this post helpful.
Old 11-11-2015, 11:55 AM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,163
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
centos 7.1 --> SELinux?
 
1 members found this post helpful.
Old 11-11-2015, 12:02 PM   #4
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
yancek/

I also thought something strange about "/var/ww/html", and I put user:coworker for this directory - after reading your reply I sould correct this.


Habitual/

Please understand I am a Linux begginer, check "centos.org" for this distribution.
 
Old 11-11-2015, 12:12 PM   #5
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by windstory View Post
Please understand I am a Linux begginer, check "centos.org" for this distribution.
Centos ships with SELinux, a framework that ensures services like the httpd can only access certain files. This is controlled by so-called file labels. If you created /var/www/html manually, it needs to be relabeled. I think this command will work:
Code:
restorecon -R /var/www/html
But I also wonder why the directory needed to be created manually; there must be another problem. A better solution might be uninstalling httpd, then removing whatever remains in /var/www, then reinstalling it again.
 
1 members found this post helpful.
Old 11-11-2015, 12:23 PM   #6
windstory
Member
 
Registered: Nov 2008
Posts: 486

Original Poster
Rep: Reputation: 36
berndbausch/

Thanks a lot for your kind explanation and guide.

Last edited by windstory; 11-11-2015 at 07:00 PM.
 
  


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
why xampp "Access Forbidden" ananurdiana Linux - Software 6 07-09-2014 01:31 AM
apache access forbidden qwertyjjj Linux - Newbie 28 10-08-2009 07:38 PM
How to access XAMPP from the network? panyero2003 Programming 1 07-21-2006 01:03 AM
Access permission problems in XAMPP in SuSE 9.1 ClarkNG Linux - Newbie 1 07-21-2006 12:31 AM
Gambas - Forbidden Access indienick Programming 0 06-26-2006 10:51 PM


All times are GMT -5. The time now is 01:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration