K
K
Kirill Krivitsky2015-08-17 08:22:06
Apache HTTP Server
Kirill Krivitsky, 2015-08-17 08:22:06

How to configure image display in Apache, ubuntu, localhost?

The essence of the question is this, the display of images through src does not work,
there is a simple html document code below, if I just run it in the browser, all the pictures are displayed, if I turn on apache and start the site, through the address on the localhost like mysite.zz then there are no images.

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>img</title>
</head>
<body>
<center>
    <img src="img/smi.png">
<img width="309" height="138" src="img/logo.png">
</center>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Krivitsky, 2015-08-17
@KrivitskiyKirill

In general, I found the answer on my own, if someone is interested, I did it as follows.
1. because all site files were placed in the /home/user/www/mysite.zz folder then added the user to the www-data group sudo adduser user www-data
2. www-data made the owner of the root folder
3. Gave access to the folder chmod -R 775 www
4. in the file /etc/apache2/apache2 .conf
added

<Directory /home/user/www/>
  AllowOverride All
  Require all granted
</Directory>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question