Solved

failed to open stream: Permission denied in /etc/httpd/

Posted on 2015-02-08
6
121 Views
Last Modified: 2015-02-13
I have a centos linux server apache1
Right now my server is set up to use var/www/html  where my 1 website has been serving from and runs fine.
I have another site I need to add so I decided to change the httpd file to use virtual host names.
Now the home firectory for the site is etc/httpd/domainname

I uploaded site to this folder in /etc/httpd/domainname and get this error when trung to open page.
failed to open stream: Permission denied in /etc/httpd/domainname.

Not sure what to do I set the directory to 0777 in attempt to overcome permissions.
the group is root on the folder and permissions is 0777.


Thanks,
0
Comment
Question by:leadcodev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
6 Comments
 
LVL 78

Assisted Solution

by:arnold
arnold earned 500 total points
ID: 40597633
You likely have Selinux running.

It is not advisable to use the site in /etc/ as there other restriction.
Ls -lZ

You should use /var/www/domainname

/etc/httpd/conf.d/domainname.conf that will set the documentroot and other parameters.

This will also handle updating the site.
0
 

Author Comment

by:leadcodev
ID: 40597649
Ok  here is what I have in conf.d

[root@D19019 conf.d]# ls
php.conf  proxy_ajp.conf  README  welcome.conf


Can you be more specific on how to do what your saying please.
0
 

Author Comment

by:leadcodev
ID: 40597652
This is in my httpd file

<VirtualHost *:80>
ServerName support.domain.com
ServerAlias *.support.domain.com
DocumentRoot support.domain.com_folder
</VirtualHost>
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 

Assisted Solution

by:leadcodev
leadcodev earned 0 total points
ID: 40597673
<VirtualHost *:80>
  ServerName example.org
  ServerAlias *.example.org
  ServerAdmin webmaster@example.org
  ErrorLog /var/log/httpd/example.err
  CustomLog /var/log/httpd/example.log combined
  DocumentRoot /var/www/example.org
  <Directory "/var/www/example.org">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>
0
 

Accepted Solution

by:
leadcodev earned 0 total points
ID: 40597674
Ok for anyone else with this problem add the above config into (domain).conf under conf.d/
0
 

Author Closing Comment

by:leadcodev
ID: 40607545
Expert answer was vague.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question