Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
when i visit the webpage i get a big square with a red dot....Please help
Also as a secondary question
If i create an html page as the user i'm signed in as and then
try to view that webpage, it says there is an error, but if i
create teh file as root, then everything is ok for people to
view that html page.
what do i need to do to be signed is as me and create web content
so that it is viewable, i don't really want to have to always be root to
get anything done.
When you have your image dir as /var/www/html/images/ it should work with the html you provided. Have you checked the server error_log? Its mostly very useful for debugging "not found" errors. Its most likely located somewhere like /var/log/apache/error_log or similar.
I dont fully understand your seconf question, but Ill try to answer anyways. Make sure the chmods for the files are set to allow reading for the group other. That is the group which under apache should access them. Heres an example:
Code:
# do this as the owner of the file, or root
chmod o+r /var/www/html/file.html
1) If your parent directory (with index.html) is in /var/www/html, your images directory MUST be under that directory (eg /var/www/html) unless you set an alias in the Apache config file. If you wanted to usr /var/www/images as your image directory, you would need to add a line like this into the configuration for your host/virtualhost:
Alias /images /var/www/images
2) All directories must have read AND execute permission for the user running the web server. If no other users have access to your machine, you can just do something like:
chmod 777 /var/www/images
Note that the above will let any user on your system read and write to the directory - take care if you are on a multi-user system.
3) User running web server must have read permission on all files that it has to server. The easy way to do this (and to answer your last question) is to write a little shell script that does this:
chmod 644 /var/www/html/*.html
...repeating for every file type that you are going to serve in that directory. If you decide to put your images in /var/www/html/images, you could:
chmod 644 /var/www/html/*
...but only if that directory contains files only and not subdirectories. (If there were subdirectories in there, you would be taking away the execute (x) permission required to descend into the directory.)
When you've written your script, give it execute permission (chmod 744 myscript) and run it every time you make any changes.
It's late at night, I'm tired, so I hope this makes sense!
Ok Gents, thanks for all the answers and I've tried to implement your advice but to no avail.
Below you will find the permissions of the images directory.
I've also looked through httpd.conf and found no
Code:
[mark@linuxbox html]$ pwd
/var/www/html
[mark@linuxbox html]$ ls -l
total 200
drwxr-xr-x 4 root mark 4096 Feb 13 21:47 images
-rw-r--r-- 1 mark root 2367 Feb 3 23:12 index.html
-rwxr--r-- 1 root mark 9448 Feb 13 17:47 IntelReports.dwt
-rw-r--r-- 1 root root 63 Feb 13 01:32 jcm.html
-rw-r--r-- 1 root root 65 Feb 10 20:50 mom.html
-rw-r--r-- 1 root root 15825 Feb 14 00:03 omaha1.html
-rw-r--r-- 1 root root 69 Feb 10 20:54 rudy.html
-rwxr--r-- 1 root root 107163 Feb 13 01:33 screener1.jpg
-rw-r--r-- 1 root root 121 Feb 11 20:28 trey.html
[mark@linuxbox html]$
In my error_logs I see alot of this
Code:
[Mon Feb 14 09:08:45 2005] [error] [client 66.26.157.109] (13)Permission denied: access to
/images/sitrep.jpg denied
With that in mind it is obviously a permission issue. the user and group is apache but i'm not sure how to determine the rights that user has beside the old fashioned -rwxr-xr-x which would appear to me as if user,group,others have the rights they need to view the files in the images folder.
My images directory is in fact in /var/www/html and all the files that are within that directory have the following permissions -rwxr-xr-x so at this point i'm scratching my head
check who is owner of your images: having file with permissions as yours it should be "apache" or belong to group "apache". try "chown apache:apache *"
Could you give us the three commands run with root environnement :
1 / id
2 / id apache
3 / ls -ail images/sitrep.jpg
Because when I see the images directory with root and mark group, if apache is running
with apache anc group apache, the command will fail if the images/siterep.jpg file is not
at least in : in rwxr-xr--
as shows your output to jeanpba file belongs to user "root" and group "mark". You can include user "apache" to group "mark" or chown file to be readable by user or group "apache" (run
"chown apache:mark *" for user apache, group mark or "chown root:apache *" for user root, group apache
or "chown apache:apache *" for both user and group apache)
I changed the owner group of the images directory to apache as reflected below
Code:
drwxr-xr-x 4 apache apache 4096 Feb 13 21:47 images
The bg image of my webpage is the one i'm working with now because
i know if i reload my page and it shows up then all the others will too if
i set their permissions identical to it so i changed its owner group to
apache as well as reflected below.
Code:
-rwxr-xr-x 1 apache apache 5887 Feb 13 17:40 cnvbkgnd.jpg
Still i am unable to enter my /images directory and my background image
does not appear on the page with those changes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.