Solved

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

Posted on 2015-02-08
6
107 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 76

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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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 look for a specific file type in a local or remote server directory using PHP.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now