Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just installed httpd, mariadb and other basic things on the newest Centos7 and I am trying to run a website from that.
setenforce 1
--> 403 Permission denied in a browser (cant read .htaccess file in server logs)
senenforce 0
--> website showing php as source code (View Source Code in a browser), and this includes mysql database name, user and password
How to get out of this?
###Edit:
I tried using this (based on my notes made during the config of the previous systems, exactly the same), but it does not work, for some reason:
Then check
1. if the file .htaccess exists
2. the file permissions of this file, if it exists
755, all /home/www/http/domain.com/.htaccess are 755. It used to be a little different actually (751 on the domain.com and 644 on the .htaccess file. this used to work somewhere else). I am not sure if setting all these to 755 is correct, probably not. All this is becoming a mess now.
If somebody is familiar, what are the commands that I can run on /home/www/html, to make sure that the permissions and ownership are correct? This is Centos7, apache, just root user. root is the owner of anything, apaches accesses with the permisssios for other, this is how it is suppose to be, I think. This looks like SeLinux though. I've been dealing with things like this for five full days now, trying to test a site and get it to work correctly / better. I had notes and the commands that I've been running were good on two systems already, this is the third one and something does not work (permissions issue of some kind). The site has not been up for like 14 hours now, and it gets around 500 people per day. And I've been changing things on it for like a week, so they may ban me in google.com, but probably not. Too much mess.
###Edit: Looks like this is solved for now.
Last edited by AdultFoundry; 06-18-2016 at 04:56 AM.
755, all /home/www/http/domain.com/.htaccess are 755. It used to be a little different actually (751 on the domain.com and 644 on the .htaccess file. this used to work somewhere else). I am not sure if setting all these to 755 is correct, probably not.
Files should be 644, directories 755 or 751. But that's kind of an aside. Since it's your server and you have root access to it, your configuration changes should go in the main configuration file which should be /etc/httpd/conf/httpd.conf or somewhere in /etc/httpd/conf.d/ depending on where you have your vhost information. .htaccess is for when you have to farm out a subset of capabilities to someone who doesn't have access to the vhost's configuration file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.