Solved

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

Posted on 2015-02-08
6
115 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 77

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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 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