I am starting to learn server management with a CentOS Virtual Machine. I am trying to make a simple website.
Because the Apache default file is in /var/www it is hard to write/make/change files. Having said that, I would like to make the home page in the folder /var/www and all other pages will be in the folder /home/$USER/Documents/Website.
The code on the home page is just an href to the other pages. When I run the code on the machine, it works, but if I go the the home page (type in the IP in a browser) the link doesn't work, but the home page is still there.
The error that I get when I click the link is 404 file not found.
If I copy the file location from that error code and, on the Server, and type
cat {file_location}
It prints the file no problem. I have changed the Apache group to the owner of the file. How can I allow the Apache server to find the files in here? Would I need to edit the http.conf?
EDIT:
How would I just make it so the server could read and write in a folder called /Website?
EDIT 2:
I do not know which version of Apache I am running. I used the CentOS installer to install the Apache. The /var/www/html/index.html is the webpage pulled up when I type in the IP address, as it should. It very well could be a SELinux problem as after I installed the Server with GUI packages, a SELinux pop-up told me of a 'security' problem. I ran the scripts that it said and I could write the the /var/www/html folder. Now I am wanting to add folders in a different location and I don't know how to do so. Other than SELinux being in the way of writing to the /var/www/html folder, I also changed owner and ran chmod 755 if I remember correctly.
DocumentRootis used there?/var/www. Really. If you care to extend your question to permit that as an acceptable alternative then someone here (if not me) can explain aboutchmod.mod_userdirfor example? Why do you think server can't read/write to/var/www/html(what have you tried)?