Access Denied Localhost

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












After moving my httpd directory to my new install of Fedora 27, every page (php and html) has an "Access Denied." error and every directory returns a 403. I've tried changing the permissions of the httpd directory, but it hasn't worked.



Strangely, the Fedora localhost/ default page works fine.







share|improve this question
















  • 2




    Is selinux in the picture?
    – Jeff Schaller
    Nov 19 '17 at 23:31






  • 2




    If you went from Apache 2.2 to 2.4 the grant permissions syntax has changed in your <directory...> stanzas.
    – ivanivan
    Nov 19 '17 at 23:39










  • What does the error log say? What permissions do you have on the target directories and files (one or two examples will suffice)?
    – roaima
    Nov 20 '17 at 0:14










  • Thanks. I have tried changing the permissions to give every user read/write access and www ownership. SeLinux is enabled, but the troubleshooter shows no activity. I'm not sure what apache version Fedora 26 uses, but changing apache versions shouldn't have mattered much since I just moved the files within var/www/html to the new var/www/html -- the apache installation and conf files are all brand new.
    – John S
    Nov 20 '17 at 2:04















up vote
1
down vote

favorite












After moving my httpd directory to my new install of Fedora 27, every page (php and html) has an "Access Denied." error and every directory returns a 403. I've tried changing the permissions of the httpd directory, but it hasn't worked.



Strangely, the Fedora localhost/ default page works fine.







share|improve this question
















  • 2




    Is selinux in the picture?
    – Jeff Schaller
    Nov 19 '17 at 23:31






  • 2




    If you went from Apache 2.2 to 2.4 the grant permissions syntax has changed in your <directory...> stanzas.
    – ivanivan
    Nov 19 '17 at 23:39










  • What does the error log say? What permissions do you have on the target directories and files (one or two examples will suffice)?
    – roaima
    Nov 20 '17 at 0:14










  • Thanks. I have tried changing the permissions to give every user read/write access and www ownership. SeLinux is enabled, but the troubleshooter shows no activity. I'm not sure what apache version Fedora 26 uses, but changing apache versions shouldn't have mattered much since I just moved the files within var/www/html to the new var/www/html -- the apache installation and conf files are all brand new.
    – John S
    Nov 20 '17 at 2:04













up vote
1
down vote

favorite









up vote
1
down vote

favorite











After moving my httpd directory to my new install of Fedora 27, every page (php and html) has an "Access Denied." error and every directory returns a 403. I've tried changing the permissions of the httpd directory, but it hasn't worked.



Strangely, the Fedora localhost/ default page works fine.







share|improve this question












After moving my httpd directory to my new install of Fedora 27, every page (php and html) has an "Access Denied." error and every directory returns a 403. I've tried changing the permissions of the httpd directory, but it hasn't worked.



Strangely, the Fedora localhost/ default page works fine.









share|improve this question











share|improve this question




share|improve this question










asked Nov 19 '17 at 23:27









John S

82




82







  • 2




    Is selinux in the picture?
    – Jeff Schaller
    Nov 19 '17 at 23:31






  • 2




    If you went from Apache 2.2 to 2.4 the grant permissions syntax has changed in your <directory...> stanzas.
    – ivanivan
    Nov 19 '17 at 23:39










  • What does the error log say? What permissions do you have on the target directories and files (one or two examples will suffice)?
    – roaima
    Nov 20 '17 at 0:14










  • Thanks. I have tried changing the permissions to give every user read/write access and www ownership. SeLinux is enabled, but the troubleshooter shows no activity. I'm not sure what apache version Fedora 26 uses, but changing apache versions shouldn't have mattered much since I just moved the files within var/www/html to the new var/www/html -- the apache installation and conf files are all brand new.
    – John S
    Nov 20 '17 at 2:04













  • 2




    Is selinux in the picture?
    – Jeff Schaller
    Nov 19 '17 at 23:31






  • 2




    If you went from Apache 2.2 to 2.4 the grant permissions syntax has changed in your <directory...> stanzas.
    – ivanivan
    Nov 19 '17 at 23:39










  • What does the error log say? What permissions do you have on the target directories and files (one or two examples will suffice)?
    – roaima
    Nov 20 '17 at 0:14










  • Thanks. I have tried changing the permissions to give every user read/write access and www ownership. SeLinux is enabled, but the troubleshooter shows no activity. I'm not sure what apache version Fedora 26 uses, but changing apache versions shouldn't have mattered much since I just moved the files within var/www/html to the new var/www/html -- the apache installation and conf files are all brand new.
    – John S
    Nov 20 '17 at 2:04








2




2




Is selinux in the picture?
– Jeff Schaller
Nov 19 '17 at 23:31




Is selinux in the picture?
– Jeff Schaller
Nov 19 '17 at 23:31




2




2




If you went from Apache 2.2 to 2.4 the grant permissions syntax has changed in your <directory...> stanzas.
– ivanivan
Nov 19 '17 at 23:39




If you went from Apache 2.2 to 2.4 the grant permissions syntax has changed in your <directory...> stanzas.
– ivanivan
Nov 19 '17 at 23:39












What does the error log say? What permissions do you have on the target directories and files (one or two examples will suffice)?
– roaima
Nov 20 '17 at 0:14




What does the error log say? What permissions do you have on the target directories and files (one or two examples will suffice)?
– roaima
Nov 20 '17 at 0:14












Thanks. I have tried changing the permissions to give every user read/write access and www ownership. SeLinux is enabled, but the troubleshooter shows no activity. I'm not sure what apache version Fedora 26 uses, but changing apache versions shouldn't have mattered much since I just moved the files within var/www/html to the new var/www/html -- the apache installation and conf files are all brand new.
– John S
Nov 20 '17 at 2:04





Thanks. I have tried changing the permissions to give every user read/write access and www ownership. SeLinux is enabled, but the troubleshooter shows no activity. I'm not sure what apache version Fedora 26 uses, but changing apache versions shouldn't have mattered much since I just moved the files within var/www/html to the new var/www/html -- the apache installation and conf files are all brand new.
– John S
Nov 20 '17 at 2:04











1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Just what Jeff was mentioning above - this sounds like classic SELINUX. Anytime I install Fedora and test httpd, the main page will come up fine but attempting to move to another page will fail. What I ended up doing was changing the context by copying from a directory that would work (e.g. the default page). Here's the simple answer that I found that worked:

chcon -R --reference=/var/www /path/to/webroot


And the site that I found the answer that worked (for me): Pete Freitag






share|improve this answer




















  • Thanks. I wonder why this happens with SELINUX, especially since both directories were made by the same installation process at the same time -- and never effected me before.
    – John S
    Nov 20 '17 at 2:40






  • 1




    If you (or a program) created the files in a directory with a different SELinux context, then the mv probably preserved that context, causing the issue.
    – Jeff Schaller
    Nov 20 '17 at 14:11










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405671%2faccess-denied-localhost%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Just what Jeff was mentioning above - this sounds like classic SELINUX. Anytime I install Fedora and test httpd, the main page will come up fine but attempting to move to another page will fail. What I ended up doing was changing the context by copying from a directory that would work (e.g. the default page). Here's the simple answer that I found that worked:

chcon -R --reference=/var/www /path/to/webroot


And the site that I found the answer that worked (for me): Pete Freitag






share|improve this answer




















  • Thanks. I wonder why this happens with SELINUX, especially since both directories were made by the same installation process at the same time -- and never effected me before.
    – John S
    Nov 20 '17 at 2:40






  • 1




    If you (or a program) created the files in a directory with a different SELinux context, then the mv probably preserved that context, causing the issue.
    – Jeff Schaller
    Nov 20 '17 at 14:11














up vote
1
down vote



accepted










Just what Jeff was mentioning above - this sounds like classic SELINUX. Anytime I install Fedora and test httpd, the main page will come up fine but attempting to move to another page will fail. What I ended up doing was changing the context by copying from a directory that would work (e.g. the default page). Here's the simple answer that I found that worked:

chcon -R --reference=/var/www /path/to/webroot


And the site that I found the answer that worked (for me): Pete Freitag






share|improve this answer




















  • Thanks. I wonder why this happens with SELINUX, especially since both directories were made by the same installation process at the same time -- and never effected me before.
    – John S
    Nov 20 '17 at 2:40






  • 1




    If you (or a program) created the files in a directory with a different SELinux context, then the mv probably preserved that context, causing the issue.
    – Jeff Schaller
    Nov 20 '17 at 14:11












up vote
1
down vote



accepted







up vote
1
down vote



accepted






Just what Jeff was mentioning above - this sounds like classic SELINUX. Anytime I install Fedora and test httpd, the main page will come up fine but attempting to move to another page will fail. What I ended up doing was changing the context by copying from a directory that would work (e.g. the default page). Here's the simple answer that I found that worked:

chcon -R --reference=/var/www /path/to/webroot


And the site that I found the answer that worked (for me): Pete Freitag






share|improve this answer












Just what Jeff was mentioning above - this sounds like classic SELINUX. Anytime I install Fedora and test httpd, the main page will come up fine but attempting to move to another page will fail. What I ended up doing was changing the context by copying from a directory that would work (e.g. the default page). Here's the simple answer that I found that worked:

chcon -R --reference=/var/www /path/to/webroot


And the site that I found the answer that worked (for me): Pete Freitag







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '17 at 2:03









Mountainerd

400111




400111











  • Thanks. I wonder why this happens with SELINUX, especially since both directories were made by the same installation process at the same time -- and never effected me before.
    – John S
    Nov 20 '17 at 2:40






  • 1




    If you (or a program) created the files in a directory with a different SELinux context, then the mv probably preserved that context, causing the issue.
    – Jeff Schaller
    Nov 20 '17 at 14:11
















  • Thanks. I wonder why this happens with SELINUX, especially since both directories were made by the same installation process at the same time -- and never effected me before.
    – John S
    Nov 20 '17 at 2:40






  • 1




    If you (or a program) created the files in a directory with a different SELinux context, then the mv probably preserved that context, causing the issue.
    – Jeff Schaller
    Nov 20 '17 at 14:11















Thanks. I wonder why this happens with SELINUX, especially since both directories were made by the same installation process at the same time -- and never effected me before.
– John S
Nov 20 '17 at 2:40




Thanks. I wonder why this happens with SELINUX, especially since both directories were made by the same installation process at the same time -- and never effected me before.
– John S
Nov 20 '17 at 2:40




1




1




If you (or a program) created the files in a directory with a different SELinux context, then the mv probably preserved that context, causing the issue.
– Jeff Schaller
Nov 20 '17 at 14:11




If you (or a program) created the files in a directory with a different SELinux context, then the mv probably preserved that context, causing the issue.
– Jeff Schaller
Nov 20 '17 at 14:11

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405671%2faccess-denied-localhost%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay