LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Web server sees the pages, but not the folder that has all the images for the pages (https://www.linuxquestions.org/questions/linux-server-73/web-server-sees-the-pages-but-not-the-folder-that-has-all-the-images-for-the-pages-807935/)

nortonz 05-14-2010 10:55 PM

Web server sees the pages, but not the folder that has all the images for the pages
 
OK I'm very new to Linux, and I have ran a Windows XP server before, with a Apache2 Server software for Windows. and didn't have any problems with it, but I really want to set this server up with Linux.

The server is running, but the only thing that comes up in the browser, is the html pages, the pages call all the images from a folder /images/
but for some reason I can't get it to pull the folder up. None of the graphics show on any of the pages.

I also have a VirtualHost setup, and have another website set up in the DocumentRoot with the 2nd site, but it won't come up ether, even tho it is listed as the 2nd VirtualHost, and have that folder set up as the DocumentRoot.

I'm just using IP Addresses for now till I get this all sorted out.
So if I enter the IP the main page comes up, just no graphics. if I enter the IP Address/2ndSiteFolder/ I get a directory listing with the 2nd site folder listed, so now if I click on the 2ndSiteFolderName, it comes up as IP/2ndSiteFolder/2ndSiteFolder/ Now the 2nd site comes up, and so does all the Graphics for that site, even if I go to some of the other subfolders site. So its just weird. I don't know what I need to do to get this to work right.

I know it has to do with setting up the folders for VirtualHost, I just don't know what it is. I have been working on this for a week, and I'm not getting anywhere.. I hope someone can help me, For I'm Not Smarter Than a 5 Grader!

nortonz

EricTRA 05-15-2010 01:27 AM

Hello and welcome to LinuxQuestions,

Windows XP server? Never heard of that one :rolleyes:

Have you checked the rights on your images folder? Does the apache user as which apache runs, have access to that folder? Post output of this commands:
Code:

ls -al /path/to/your/documentroot
Code:

ls -al /path/to/your/images_folder
Kind regards,

Eric

nortonz 05-15-2010 10:20 AM

Quote:

Originally Posted by EricTRA (Post 3969199)
Hello and welcome to LinuxQuestions,

Windows XP server? Never heard of that one :rolleyes:

Have you checked the rights on your images folder? Does the apache user as which apache runs, have access to that folder? Post output of this commands:
Code:

ls -al /path/to/your/documentroot
Code:

ls -al /path/to/your/images_folder
Kind regards,

Eric

Thanks for the response. Ya the Windows Server was ok, at least it all works, it was a program called "Apache2Triade" it had the Apache2 server, PHP5, MySQL, and PERL. it worked OK, but when you had a lot of sites on that server it was very slow. Thats why I want to switch to Linux.

[root@asrservice ~]# ls -al /var/www/html/
total 420
drwxr-xr-x 11 apache apache 4096 May 14 18:08 .
drwxr-xr-x 8 root root 4096 May 14 08:18 ..
drwxr-xr-x 3 root root 4096 May 8 20:29 antenna
-rw-rw-rw- 1 root root 3114 Jan 25 15:17 antenna.css
-rw-rw-rw- 1 root root 1151 Jan 25 13:52 asr.html
-rw-rw-rw- 1 root root 43222 Jan 25 13:52 asr.php
-rw-rw-rw- 1 root root 84699 Mar 31 2009 asr.swf
-rw-rw-rw- 1 root root 3289 Jan 25 13:52 asr.xml
-rw-rw-rw- 1 root root 3950 Jan 25 11:59 blue_submit.jpg
-rw-rw-rw- 1 root root 2964 Feb 7 2007 CaptchaSecurityImages.php
-rw-rw-rw- 1 root root 26045 Mar 21 09:03 Center.png
-rw-rw-rw- 1 root root 11015 Apr 25 23:21 computer repair.htm
-rw-rw-rw- 1 root root 9990 Apr 25 23:21 contact.htm
drwxr-xr-x 3 root root 4096 May 8 20:29 demo
-rw-rw-rw- 1 root root 11519 Jan 25 07:56 freeform.php
-rw-rw-rw- 1 root root 3272 Dec 4 16:13 green_submit.jpg
drwxrwxrwx 2 apache apache 4096 May 8 20:29 Images
-rw-rw-rw- 1 root root 15138 Apr 25 23:19 index.htm
-rw-rw-rw- 1 root root 14160 Feb 15 09:18 index.htm.bak
drwxrwxrwx 3 apache apache 4096 May 8 20:29 lectraink
-rw-rw-rw- 1 root root 6198 Jul 17 2008 Links.htm
drwxr-xr-x 2 root root 4096 May 8 20:29 litebox4
-rw-rw-rw- 1 root root 6495 Apr 25 23:20 litebox4.htm
drwxr-xr-x 2 root root 4096 May 8 20:29 liteboxv4
-rw-rw-rw- 1 root root 665 Apr 14 2008 Meta Tag.txt
-rw-rw-rw- 1 root root 41036 Jul 13 1999 monofont.ttf
-rw-rw-rw- 1 root root 1094 Jun 14 2008 notfound.html
drwxr-xr-x 8 root root 4096 May 8 20:29 PageFlip
drwxr-xr-x 3 root root 4096 May 8 20:29 pastel
drwxr-xr-x 3 root root 4096 May 8 20:29 peel
-rw-rw-rw- 1 root root 6241 Apr 25 23:18 site.theme
-rw-rw-rw- 1 root root 22955 Apr 13 14:34 Toolbar.jpg
-rw-rw-rw- 1 root root 13883 Apr 25 23:20 tv repair.htm
[root@asrservice ~]#

[root@asrservice ~]# ls -al /var/www/html/Images
total 30008
drwxrwxrwx 2 apache apache 4096 May 8 20:29 .
drwxr-xr-x 11 apache apache 4096 May 14 18:08 ..
-rw-rw-rw- 1 root root 32758 Jan 25 16:20 13-lgmo_72890.swf
-rw-rw-rw- 1 root root 30624 Jan 25 16:20 2-lg_53_336x280.swf
-rw-rw-rw- 1 root root 18305 Jan 25 16:18 32722198-2-200-0.gif
-rw-rw-rw- 1 root root 15633 Dec 27 15:18 4940099.gif
-rw-rw-rw- 1 root root 24143 Dec 27 15:22 4941148.gif
-rw-rw-rw- 1 root root 12266 Dec 27 15:27 4941314.gif
-rw-rw-rw- 1 root root 37370 Aug 21 2009 asr_logo.gif
-rw-rw-rw- 1 root root 26650 Aug 21 2009 asr_logo.png
-rw-rw-rw- 1 root root 2454 Aug 21 2009 corp_id_small.gif
-rw-rw-rw- 1 root root 6637 Aug 21 2009 default.jpg
-rw-rw-rw- 1 root root 4129 May 26 2008 electronickit.gif
-rw-rw-rw- 1 root root 3638 Aug 21 2009 favicon.ico
-rw-rw-rw- 1 root root 2213 Jan 25 08:49 gradient1.png
-rw-rw-rw- 1 root root 2380 Jan 25 08:59 gradient2.png
-rw-rw-rw- 1 root root 346 Jan 25 09:05 gradient3.png
-rw-rw-rw- 1 root root 2469 Jan 25 12:27 gradient5.png
-rw-rw-rw- 1 root root 1778 Jan 25 15:54 gradient6.png
-rw-rw-rw- 1 root root 30129938 Apr 26 08:14 KDL40XBR3.pdf
-rw-rw-rw- 1 root root 3719 Aug 21 2009 made_with_antenna.jpg
-rw-rw-rw- 1 root root 2322 Aug 21 2009 mail.jpg
-rw-rw-rw- 1 root root 7352 Aug 21 2009 marine.jpg
-rw-rw-rw- 1 root root 19782 Jan 25 15:37 p133l26x1-f.jpg
-rw-rw-rw- 1 root root 27565 Jan 25 15:36 p305ln19650-f.jpg
-rw-rw-rw- 1 root root 3365 May 26 2008 panel1.png
-rw-rw-rw- 1 root root 1538 Jul 20 2008 ph-off.gif
-rw-rw-rw- 1 root root 1528 Jul 20 2008 ph-on.gif
-rw-rw-rw- 1 root root 5033 May 26 2008 plasma.jpg
-rw-rw-rw- 1 root root 14115 May 26 2008 pm_com_01_070805.jpg
-rw-rw-rw- 1 root root 9229 Aug 21 2009 pm_com_01_fa.jpg
-rw-rw-rw- 1 root root 1120 Aug 21 2009 samusng logo.gif
-rw-rw-rw- 1 root root 1120 Aug 21 2009 Samusnglogo.gif
-rw-rw-rw- 1 root root 1207 Aug 21 2009 skypemebuttoneng.swf
-rw-rw-rw- 1 root root 2788 Aug 21 2009 top_pic_lglogo.gif
-rw-rw-rw- 1 root root 60431 Apr 14 2008 tringle2small.jpg
-rw-rw-rw- 1 root root 60431 Aug 21 2009 tringle [converted]2small.jpg
-rw-rw-rw- 1 root root 3206 Aug 21 2009 under_construction.jpg
-rw-rw-rw- 1 root root 22595 Jan 25 15:35 wd-833.jpg
-rw-rw-rw- 1 root root 1032 Aug 21 2009 Zenith_Logo.gif

Thank You for the help here..

Nortonz

EricTRA 05-15-2010 10:24 AM

Hello,

Looks like you set root as owner both on user as on group level. I'd advice you to change that to the apache user/group combination to avoid problems.
Also the permissions on directory(ies) seem to be set to 777. Change them back to 755 for directory level and 644 for file level. If you don't have access to the images directory with 777 set, then it seems the problem is caused by something else. Is anything showing up in your logs when you connect to your web?

Kind regards,

Eric

nortonz 05-15-2010 05:20 PM

Quote:

Originally Posted by EricTRA (Post 3969650)
Hello,

Looks like you set root as owner both on user as on group level. I'd advice you to change that to the apache user/group combination to avoid problems.
Also the permissions on directory(ies) seem to be set to 777. Change them back to 755 for directory level and 644 for file level. If you don't have access to the images directory with 777 set, then it seems the problem is caused by something else. Is anything showing up in your logs when you connect to your web?

Kind regards,

Eric

Thanks for the help, I figured out what it was, just a stupid windows to linux error. the Image folder was spelled "Image" and it should have been "images". I should have seen that, after all I just had to deal with that very same thing with another site I moved to a Linux Server. (lower case and Upper Case letters)

Now I have to figure out the VirtualHost problem with the 2nd site.

Thank You again.

nortonz

EricTRA 05-16-2010 12:24 AM

Hello,

Great you got that part figured out. I'm sorry I don't know much about Apache configuration but I'm sure someone will put in some knowledge soon enough.

Kind regards,

Eric

nortonz 05-16-2010 01:44 AM

Quote:

Originally Posted by EricTRA (Post 3970250)
Hello,

Great you got that part figured out. I'm sorry I don't know much about Apache configuration but I'm sure someone will put in some knowledge soon enough.

Kind regards,

Eric

That's OK, I think I will get it. I have only install this whole thing about 20 time now.

Only have 2 sites I need to get working, but I need PHP5, MySQL, and ProFTPD to get going. I think I have almost everything else installed this time. I just might make it to the end..

nortonz 05-17-2010 10:19 AM

Eric. I have one more question for you, you said I need to change ownership both files, and Group to "Apache" I did a Google search for the commands to do that, but it looks like everything I found is for an individual file or folder.

Is there a way to change the ownership of all the files, and folders in my DocumentRoot with one command?

Thanks
Michael

Hangdog42 05-17-2010 11:38 AM

Quote:

Originally Posted by nortonz (Post 3971533)
Eric. I have one more question for you, you said I need to change ownership both files, and Group to "Apache" I did a Google search for the commands to do that, but it looks like everything I found is for an individual file or folder.

Is there a way to change the ownership of all the files, and folders in my DocumentRoot with one command?

In the document root your could run

Code:

chown apache:apache * -R
And that should change the ownership of everything from that level on down. Have a look at the chown man page for more details and options.
Quote:

I also have a VirtualHost setup, and have another website set up in the DocumentRoot with the 2nd site, but it won't come up ether, even tho it is listed as the 2nd VirtualHost, and have that folder set up as the DocumentRoot.

What does your virtual hosts config section look like?

nortonz 05-17-2010 03:04 PM

Quote:

Originally Posted by Hangdog42 (Post 3971605)
In the document root your could run

Code:

chown apache:apache * -R
And that should change the ownership of everything from that level on down. Have a look at the chown man page for more details and options.



What does your virtual hosts config section look like?

Thanks for the reply Hangdog42, I knew there had to be a command to do that. It worked great. I just wasn't understanding what I read in the Manual. As you can tell I'm new to Linux. But I'm learning.

I have the 2nd site coming up now, as soon as I made the site live, by changing the address in DNS it started working. Its a little sluggish, but I'm still working on it. I think all I need to do now is get "ISPConfig, and ProFTPD working, and I think I will be done with the server part anyway. I have the MySQL database working, and can access it through phpmyadmin. php is working now too. So its coming along.

Thanks for the help here.
nortonz


All times are GMT -5. The time now is 04:38 PM.