Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
cannot execute img src in localhost
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 31 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marty  
View profile  
 More options Nov 7 2012, 6:00 pm
Newsgroups: alt.html
From: Marty <mart...@aol.com>
Date: 07 Nov 2012 23:00:42 GMT
Local: Wed, Nov 7 2012 6:00 pm
Subject: cannot execute img src in localhost
I have a web page that is webpage.php. It shows up fine in localhost
(ubuntu) except for the graphics. The header image, which is an img src,
shows the alt text and carves out a space for the image. But the image
does not show.

If I change the page to .html I can see everything in the browser. But, I
cannot execute the .html page on local host at all.

I tried asking in a php group but they said this is really a problem with
the html not functioning.

Any suggestions?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bacarisse  
View profile  
 More options Nov 7 2012, 7:17 pm
Newsgroups: alt.html
From: Ben Bacarisse <ben.use...@bsb.me.uk>
Date: Thu, 08 Nov 2012 00:17:37 +0000
Local: Wed, Nov 7 2012 7:17 pm
Subject: Re: cannot execute img src in localhost

Marty <mart...@aol.com> writes:
> I have a web page that is webpage.php. It shows up fine in localhost
> (ubuntu) except for the graphics. The header image, which is an img src,
> shows the alt text and carves out a space for the image. But the image
> does not show.

> If I change the page to .html I can see everything in the browser. But, I
> cannot execute the .html page on local host at all.

> I tried asking in a php group but they said this is really a problem with
> the html not functioning.

> Any suggestions?

The src attribute is wrong.  Exactly how, it's impossible to say, partly
because your terminology is not clear.  Here is my translation which you
can disavow if you like:

"I am running a web server on localhost.  When I view webpage.php, the
main image does not appear.  If I rename the file to webpage.html and
view it directly in a browser the image appears."

If that's what's happening, post the PHP and there's a change you will
get detailed assistance.  The second most important data is the location
of the various files relative to each other.

You might also get fast answers if you uploaded the page and the image
to a publicly available server.

--
Ben.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian  
View profile  
 More options Nov 7 2012, 7:35 pm
Newsgroups: alt.html
From: Ian <ian.rast...@gmail.com>
Date: Wed, 7 Nov 2012 16:35:39 -0800 (PST)
Local: Wed, Nov 7 2012 7:35 pm
Subject: Re: cannot execute img src in localhost

On Wednesday, November 7, 2012 6:00:42 PM UTC-5, Marty wrote:
> If I change the page to .html I can see everything in the browser. But, I
> cannot execute the .html page on local host at all.

Do you mean that you can see the .html page when you view it remotely through the browser, but can't see it when you view it locally through the browser?

If so, perhaps there is a problem with the local server that you have running on Ubuntu.

No matter what, if you post your code, it will make things clear.

Ian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan N. Little  
View profile  
 More options Nov 7 2012, 8:46 pm
Newsgroups: alt.html
From: "Jonathan N. Little" <lws4...@gmail.com>
Date: Wed, 07 Nov 2012 20:46:21 -0500
Local: Wed, Nov 7 2012 8:46 pm
Subject: Re: cannot execute img src in localhost

Marty wrote:
> I have a web page that is webpage.php. It shows up fine in localhost
> (ubuntu) except for the graphics. The header image, which is an img src,
> shows the alt text and carves out a space for the image. But the image
> does not show.

> If I change the page to .html I can see everything in the browser. But, I
> cannot execute the .html page on local host at all.

PHP is server side scripting where it outputs html. It sounds like you
have invalid PHP code.

> I tried asking in a php group but they said this is really a problem with
> the html not functioning.

Probably not. If just changing the file extension to .html fixes your
problem then what your problem is most likely is that you are not
writing PHP code but HTML markup.

> Any suggestions?

Post the the source code.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marty  
View profile  
 More options Nov 7 2012, 9:56 pm
Newsgroups: alt.html
From: Marty <mart...@aol.com>
Date: 08 Nov 2012 02:56:17 GMT
Local: Wed, Nov 7 2012 9:56 pm
Subject: Re: cannot execute img src in localhost

I can save it as .html or .php and the results are the same. I can see
everything formatted perfectly and I can see the alt text as well as the
placeholder for the image. But the image does not display.

To simplify troubleshooting, I put the image and the source file in the
same folder var/www. I use BlueFish editor and the preview or browser
button is set up to display the file in LocalHost.

I edited the source file to get rid of as much crap as possible and still
maintain the problem section:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My Title</title>
    <meta name="description" content="My Descsription">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="msvalidate.01" content="5D6F360E7CD47C4B14275762DBC20BAA">
    <link href="mystyle.php" rel="stylesheet" type="text/css">

</head>
  <body>
    <div align="center">
      <table class="black_tableoutline" bgcolor="#FFFFFF" width="960">
        <tbody>

          <tr style="height: 60px; text-align: center;">
            <th height="484" valign="top" width="83%">
              <p align="center">
              <img src="problemfile.jpg" alt="problem image" height="220"
width="700">
                  </p>
              <table align="center" bgcolor="#eef3f9" height="40"
width="676" border="0">
                <tbody>
                  <tr>
                    <td class="style25" height="36" valign="top"
width="601"><span
                        class="gobanner">Some Text
                        ..</span>. </td>
                    <td class="style25" valign="top" width="150"><img
src="orange_go_btn34.jpg"
                        alt="" align="left" height="34" width="112"></td>
                  </tr>
                </tbody>
              </table>

    </div>
  </body>
</html>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan N. Little  
View profile  
 More options Nov 7 2012, 11:20 pm
Newsgroups: alt.html
From: "Jonathan N. Little" <lws4...@gmail.com>
Date: Wed, 07 Nov 2012 23:20:54 -0500
Local: Wed, Nov 7 2012 11:20 pm
Subject: Re: cannot execute img src in localhost

Okay there is your answer. That is HTML markup not PHP code. PHP code
would be something like this:

<?php

$A_PHP_Variable="I am a variable";
$A_num=5;
$Double_Me=$A_num * 2;

echo "<p>Creating HTML with PHP and $A_num doubled is $Double_Me</p>";

?>

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
se  
View profile  
 More options Nov 8 2012, 12:18 am
Newsgroups: alt.html
From: "se" <s...@no-one.here>
Date: Thu, 8 Nov 2012 06:18:03 +0100
Local: Thurs, Nov 8 2012 12:18 am
Subject: Re: cannot execute img src in localhost

"Marty" <mart...@aol.com> skrev i meddelelsen
news:509b1f50$0$58015$c3e8da3$9b4ff22a@news.astraweb.com...

<link href="mystyle.php" rel="stylesheet" type="text/css">
A stylesheet must have the extention .css

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jukka K. Korpela  
View profile  
 More options Nov 8 2012, 2:07 am
Newsgroups: alt.html
From: "Jukka K. Korpela" <jkorp...@cs.tut.fi>
Date: Thu, 08 Nov 2012 09:07:39 +0200
Local: Thurs, Nov 8 2012 2:07 am
Subject: Re: cannot execute img src in localhost
2012-11-08 7:18, "se", using a forged address, wrote:

> <link href="mystyle.php" rel="stylesheet" type="text/css">
> A stylesheet must have the extention .css

Nonsense. As long as the HTTP headers specify Content-Type: text/css,
any conforming browser will treat the data as CSS.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis McMahon  
View profile  
 More options Nov 8 2012, 7:18 am
Newsgroups: alt.html
From: Denis McMahon <denismfmcma...@gmail.com>
Date: Thu, 8 Nov 2012 12:18:11 +0000 (UTC)
Local: Thurs, Nov 8 2012 7:18 am
Subject: Re: cannot execute img src in localhost

On Thu, 08 Nov 2012 02:56:17 +0000, Marty wrote:
> I edited the source file to get rid of as much crap as possible and
> still maintain the problem section:

No you didn't. If the problem is displaying the image, then it should be
apparent in the following (and arguably the <p> and </p> could be
omnitted):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>My Title</title>
  </head>
  <body>
    <p>
      <img src="problemfile.jpg" alt="problem image" height="220"
width="700">
    </p>
  </body>
</html>

As a general observation, if you use a content-type http pseudo header in
the document head, some people suggest that best practice is to place it
as the first element in the <head>, as it may require that the document
be re-parsed - the sooner the browser can make this decision the less
time it wastes parsing stuff that will become redundant when it starts
again.

Also - as an aside - in a "normal"[1] apache web server + php
configuration, if a file called something.php contains only html markup
and no <?php ... ?> code sections, the php processor will pass it
unaltered to the web server process for sending to the requesting client.

[1] every configuration is different, but there are some things that most
configurations will do the same way.

Rgds

Denis McMahon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marty  
View profile  
 More options Nov 8 2012, 10:50 am
Newsgroups: alt.html
From: Marty <mart...@aol.com>
Date: 08 Nov 2012 15:50:51 GMT
Local: Thurs, Nov 8 2012 10:50 am
Subject: Re: cannot execute img src in localhost

Forget the code above. I see it has a lot of distracting elements. Here
is an HTML file. The problem is the same. I cannot display the image in
LocalHost. By the way, the same code will display properly on a browser.
It just will not work with localhost. So, I do not think it is an html
problem at all. Know of any newsgroups that could help with a localhost
problem?

Could it be the doctype statement?

By the way, you most certainly can have a .php for a css file. Doing so
enables you to do lot of other things as well. It works perfectly in a
regular browser.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My Title</title>
    <meta name="description" content="My Descsription">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <body>
     <img src="problemimage.jpg" alt="problem image"
        height="220" width="700">
  </body>
</html>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jukka K. Korpela  
View profile  
 More options Nov 8 2012, 11:44 am
Newsgroups: alt.html
From: "Jukka K. Korpela" <jkorp...@cs.tut.fi>
Date: Thu, 08 Nov 2012 18:44:56 +0200
Local: Thurs, Nov 8 2012 11:44 am
Subject: Re: cannot execute img src in localhost
2012-11-08 18:15, Tim Streater wrote:

> Or are you running apache on your machine, with the image and html files
> in the proper place so that you can put http://localhost/problem.html
> into your browser?

That seems to be the natural interpretation. Now, we might conjecture
that the server software sends wrong information in HTTP headers. We
just need to hack into the OP's system to check that... wait a sec...

--
Yucca, http://www.cs.tut.fi/~jkorpela/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan N. Little  
View profile  
 More options Nov 8 2012, 12:15 pm
Newsgroups: alt.html
From: "Jonathan N. Little" <lws4...@gmail.com>
Date: Thu, 08 Nov 2012 12:14:48 -0500
Local: Thurs, Nov 8 2012 12:14 pm
Subject: Re: cannot execute img src in localhost

Marty wrote:
> Forget the code above. I see it has a lot of distracting elements. Here
> is an HTML file. The problem is the same. I cannot display the image in
> LocalHost. By the way, the same code will display properly on a browser.
> It just will not work with localhost. So, I do not think it is an html
> problem at all. Know of any newsgroups that could help with a localhost
> problem?

Wait a minute, by the above are you saying that it works if your view is
using your local filesystem but fails using the server? IOW

file:///var/www/thepage.html

works but

http://localhost/thepage.html

doesn't?

If so then that would point to a problem with your server configuration.
You need to check out your /etc/apache2/httpd.conf

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Mullen  
View profile  
 More options Nov 8 2012, 2:05 pm
Newsgroups: alt.html
From: Ed Mullen <e...@MUNGEedmullen.net>
Date: Thu, 08 Nov 2012 14:05:29 -0500
Local: Thurs, Nov 8 2012 2:05 pm
Subject: Re: cannot execute img src in localhost

Try specifying a path for the image files in your code.

--
Ed Mullen
http://edmullen.net/
Bureaucracy: a method of turning energy into solid waste.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis McMahon  
View profile  
 More options Nov 8 2012, 5:00 pm
Newsgroups: alt.html
From: Denis McMahon <denismfmcma...@gmail.com>
Date: Thu, 8 Nov 2012 22:00:09 +0000 (UTC)
Local: Thurs, Nov 8 2012 5:00 pm
Subject: Re: cannot execute img src in localhost

On Thu, 08 Nov 2012 15:50:51 +0000, Marty wrote:
> Know of any newsgroups that could help with a localhost
> problem?

First of all, there is no such thing as a localhost problem, the problem
is either with your local webserver configuration, or with your html. Do
you even have a local webserver running?

Please try the following shell command:

sudo ps -A | grep apache

You should see something like:

 1269 ?        00:03:17 apache2
 9231 ?        00:00:00 apache2
 9232 ?        00:00:00 apache2
 9238 ?        00:00:00 apache2
 9239 ?        00:00:00 apache2
 9243 ?        00:00:00 apache2
 9661 ?        00:00:00 apache2
 9750 ?        00:00:00 apache2
10175 ?        00:00:00 apache2
10176 ?        00:00:00 apache2
10597 ?        00:00:00 apache2

If that shows several entries, then the webserver seems to be running.
Try typing the following 2 lines, both followed by return (note there may
be no visible response to the 'nc localhost 80', just type the GET
anyway.):

nc localhost 80
GET /webpage.php

This should display the content that your php file generates and delivers
via the webserver.

If the 'nc localhost 80' returns a normal (eg name@host$) prompt, then
it's possible your webserver, although running, isn't active on the
expected port.

Try the following command:

sudo netstat -t -l -p -v | grep http

This should output a line similar to the one below (the 1269 will
probably be a different number, and I've trimmed some whitespace):

tcp   0   0 *:http   *:*   LISTEN   1269/apache2

Finally, try opening the browser and enter the following in the location
bar:

http://localhost/name.ext

Where name.ext is the name and extension of your image file. If the image
file is in the root directory of the web server, then it should display
in the browser. If it does not display, then either:

a) There's no browser running
b) The file is not where the server is looking for it

Rgds

Denis McMahon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marty  
View profile  
 More options Nov 8 2012, 7:53 pm
Newsgroups: alt.html
From: Marty <mart...@aol.com>
Date: 09 Nov 2012 00:53:08 GMT
Local: Thurs, Nov 8 2012 7:53 pm
Subject: Re: cannot execute img src in localhost

I get You don't have permission to access /imagefile.jpg on this server.
When I do localhost/imagefile.jpg

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan N. Little  
View profile  
 More options Nov 8 2012, 8:25 pm
Newsgroups: alt.html
From: "Jonathan N. Little" <lws4...@gmail.com>
Date: Thu, 08 Nov 2012 20:25:10 -0500
Local: Thurs, Nov 8 2012 8:25 pm
Subject: Re: cannot execute img src in localhost

Marty wrote:
> I get You don't have permission to access /imagefile.jpg on this server.
> When I do localhost/imagefile.jpg

Your server is not setup properly. This is not an HTML problem this is a
Apache server setup problem, (assuming your are using Apache). Or your
have a permission problem, for example you put the file with your
profile and image is neither wwwdata user or group (marty:marty) OR your
file is not world readable (660).

sudo chown -R wwwdata:wwwdata /var/www/*

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marty  
View profile  
 More options Nov 8 2012, 9:43 pm
Newsgroups: alt.html
From: Marty <mart...@aol.com>
Date: 09 Nov 2012 02:43:59 GMT
Local: Thurs, Nov 8 2012 9:43 pm
Subject: Re: cannot execute img src in localhost

I know next to nothing about linux commands. Is it a chown I need to use
or a chmod? Is the syntax you show here correct?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan N. Little  
View profile  
 More options Nov 8 2012, 9:57 pm
Newsgroups: alt.html
From: "Jonathan N. Little" <lws4...@gmail.com>
Date: Thu, 08 Nov 2012 21:57:48 -0500
Local: Thurs, Nov 8 2012 9:57 pm
Subject: Re: cannot execute img src in localhost

chown changes the owner and group

chmod change the permission for owner, group, and world.

Depends on what you need to do. I am assuming that your server's
document root is /var/www if so then post the output of the following:

ls -lha /var/www

if your document root is different change accordingly

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bacarisse  
View profile  
 More options Nov 8 2012, 10:00 pm
Newsgroups: alt.html
From: Ben Bacarisse <ben.use...@bsb.me.uk>
Date: Fri, 09 Nov 2012 03:00:08 +0000
Local: Thurs, Nov 8 2012 10:00 pm
Subject: Re: cannot execute img src in localhost

Yes, chown not chmod (though if things are really screwed you might need
that as well) and, yes, the syntax is correct.  It's something of a
sledgehammer, but with little information to go on it seems like a good
start.  He's assuming that there is some permission problem and the
easiest solution is to make everything owned by the user id that the
apache server uses (that's wwwdata).  The ":wwwdata" bit also sets the
group id that owns the files which is probably overkill, but won't do
any harm.

The meta answer is to type man sudo and then man chown.  You won't
understand all of what you see but, in general, the basics are up the
top so you can read until you get baffled.  Do that enough and you'll
find you don't get baffled so much after a while.

--
Ben.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan N. Little  
View profile  
 More options Nov 8 2012, 10:28 pm
Newsgroups: alt.html
From: "Jonathan N. Little" <lws4...@gmail.com>
Date: Thu, 08 Nov 2012 22:28:16 -0500
Local: Thurs, Nov 8 2012 10:28 pm
Subject: Re: cannot execute img src in localhost

Yes is is possible to have it work with neither the owner or the group
set to wwwdata if world is set to read. But

-rw-rw---- marty marty imagefile.jpg

would give him the problem that he is experiencing and simply turning on
world read would fix it.

More info would help and that is why I ask for a listing of the dir. For
a private server to make thing easier to edit locally there are things
you can do to simplify the process. If you access the server from
Windows workstations you can make a samba share to the document root and
used "force group = wwwdata". Or if you access from Linux on the local
machine then edit apache config to set
"export APACHE_RUN_GROUP=marty"

Just depends on his situation.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis McMahon  
View profile  
 More options Nov 9 2012, 7:04 am
Newsgroups: alt.html
From: Denis McMahon <denismfmcma...@gmail.com>
Date: Fri, 9 Nov 2012 12:04:57 +0000 (UTC)
Local: Fri, Nov 9 2012 7:04 am
Subject: Re: cannot execute img src in localhost

On Thu, 08 Nov 2012 20:25:10 -0500, Jonathan N. Little wrote:
> sudo chown -R wwwdata:wwwdata /var/www/*

Bad advice.

He said he's using Ubuntu. On my Ubuntu server, the web user is www-data,
not wwwdata! This was the default user name set up by the installer.

What he could do is either of the following:

Method:

Easy Method A makes all the files in the /var/www tree the property of
the apache process.

1) sudo cat /etc/passwd | grep www

Hopefully there's only one line, and it will look something like:

www-user:x:999:999:www-group:/var/www:/bin/sh

The fields are separated by the colon characters.

user name : password : user id : group id : group name : home : shell

A password of "x" means an encrypted password is stored in another file.

2) Get the user name and group name from above line (which in this case
is www-user:www-group)

3) sudo chown -R wwwdata:wwwdata /var/www/*

Easy Method B:

Method B allows anyone to read all the files in the /var/www tree,
regardless of who actually owns them.

sudo chmod -R w+r /var/www/*

There are other methods, but they all require more knowledge of linux
users, groups and permissions than I'm prepared to contemplate getting
into with Marty here.

Rgds

Denis McMahon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bacarisse  
View profile  
 More options Nov 9 2012, 7:50 am
Newsgroups: alt.html
From: Ben Bacarisse <ben.use...@bsb.me.uk>
Date: Fri, 09 Nov 2012 12:50:14 +0000
Local: Fri, Nov 9 2012 7:50 am
Subject: Re: cannot execute img src in localhost
"Jonathan N. Little" <lws4...@gmail.com> writes:

Sure, but (to rather labour this detail) my point about maybe needing
both is just that if user and group read permission are missing,
changing the owner won't do it.

> More info would help and that is why I ask for a listing of the
> dir.

Absolutely.  Further hints can also come from the error log.

To the OP: have a look at the error log.  On my setup I just do

  tail /var/log/apache2/error.log

to see that last few entries.  When there is a misconfiguration you
might get lots of errors, in which case viewing the whole file is more
useful.

<snip>
--
Ben.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bacarisse  
View profile  
 More options Nov 9 2012, 8:10 am
Newsgroups: alt.html
From: Ben Bacarisse <ben.use...@bsb.me.uk>
Date: Fri, 09 Nov 2012 13:10:16 +0000
Local: Fri, Nov 9 2012 8:10 am
Subject: Re: cannot execute img src in localhost

Denis McMahon <denismfmcma...@gmail.com> writes:
> On Thu, 08 Nov 2012 20:25:10 -0500, Jonathan N. Little wrote:

>> sudo chown -R wwwdata:wwwdata /var/www/*

> Bad advice.

> He said he's using Ubuntu. On my Ubuntu server, the web user is www-data,
> not wwwdata!

Well spotted!

> This was the default user name set up by the installer.

> What he could do is either of the following:

> Method:

> Easy Method A makes all the files in the /var/www tree the property of
> the apache process.

> 1) sudo cat /etc/passwd | grep www

Or just "sudo grep www /etc/passwd".  Indeed, on my default install (and
I think on many) there's no need for the sudo since /etc/passwd is
readable by all.

> Hopefully there's only one line, and it will look something like:

> www-user:x:999:999:www-group:/var/www:/bin/sh

Just to clarify (since the OP is new to this) you are most likely to see
www-data in both places.

> The fields are separated by the colon characters.

> user name : password : user id : group id : group name : home : shell

> A password of "x" means an encrypted password is stored in another file.

> 2) Get the user name and group name from above line (which in this case
> is www-user:www-group)

> 3) sudo chown -R wwwdata:wwwdata /var/www/*

I think you meant to edit that!

> Easy Method B:

> Method B allows anyone to read all the files in the /var/www tree,
> regardless of who actually owns them.

> sudo chmod -R w+r /var/www/*

I think you meant:

  sudo chmod -R o+r /var/www/*

> There are other methods, but they all require more knowledge of linux
> users, groups and permissions than I'm prepared to contemplate getting
> into with Marty here.

It's a nightmare trying to guess what might or might not be wrong here.
I am still not convinced it's a file permission or ownership thing,
since the defaults work without change (at least on my setup) but
something is wrong so permissions do need to be checked.

--
Ben.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis McMahon  
View profile  
 More options Nov 9 2012, 12:38 pm
Newsgroups: alt.html
From: Denis McMahon <denismfmcma...@gmail.com>
Date: Fri, 9 Nov 2012 17:38:29 +0000 (UTC)
Local: Fri, Nov 9 2012 12:38 pm
Subject: Re: cannot execute img src in localhost

On Fri, 09 Nov 2012 13:10:16 +0000, Ben Bacarisse wrote:
> Denis McMahon <denismfmcma...@gmail.com> writes:
>> 2) Get the user name and group name from above line (which in this case
>> is www-user:www-group)

>> 3) sudo chown -R wwwdata:wwwdata /var/www/*

> I think you meant to edit that!

Yes, it should have been something like:

3) Use the following, substituting the user name and group name from step
2 for user and group:

sudo chown -R user:group /var/www/*

>> sudo chmod -R w+r /var/www/*

> I think you meant:

> sudo chmod -R o+r /var/www/*

Damn it, I'm on a roll today. :(

Yes, I did, and in my defence, I still make the w+r (world+read) mistake
myself regularly, especially if I haven't had to chmod anything for a few
days.

Rgds

Denis McMahon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
se  
View profile  
 More options Nov 9 2012, 4:12 pm
Newsgroups: alt.html
From: "se" <s...@no-one.here>
Date: Fri, 9 Nov 2012 22:12:28 +0100
Local: Fri, Nov 9 2012 4:12 pm
Subject: Re: cannot execute img src in localhost

"Lewis" <g.kr...@gmail.com.dontsendmecopies> skrev i meddelelsen
news:slrnk9mno6.cnj.g.kreme@mbp55.local...

> In message <k7ffae$8o...@dont-email.me>
>  se <s...@no-one.here> wrote:

>> <link href="mystyle.php" rel="stylesheet" type="text/css">
>> A stylesheet must have the extention .css

> What idiot told you that?

A .php extention won't work together with a rel="stylesheet"
At least not in EW2. I just made a trial. You should do.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 31   Newer >
« Back to Discussions « Newer topic     Older topic »