Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2015-02-08
6
Medium Priority
?
183 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
  • 5
6 Comments
 
LVL 80

Assisted Solution

by:arnold
arnold earned 2000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

926 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