I am very new to web servers , php, etc. I built a small web server using Apache 2.2.22 on ubuntu 12.04 LTS. The webpage is for local access only and can be viewed by other devices connected to the access point (No thereat of security). The document root directory is /var/www/, I edited the default index.html file to display what I want to see.
Here I am trying to display few images which is in /home/myname/somedir/
, but the images are not displayed. I cannot save the images to the web document root as the images are being updated regularly by another program. How do i access the images and display them.
Things I have tried so far:
- Symbolic / soft link
Aliasing: added this to the default configuration file
/etc/apache2/sites-available/default
Alias /images/ "/home/myname/somedir/" <Directory "/home/myna-me/somedir/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
php script: I used the following code in a php script `cam_images.php'
and I called them in the hmtl file as /cam_images.php?file=myfile.jpg
referred from here
None of them have worked so far. I'm not sure where I am going wrong. I have also tried readfile()
in php, but the function isn't able to open that file. I even tried moving the DocumentRoot to the same directory as of the images but the webpage was not shown
(you don't have permission to access / of the server)
Any help is appreciated.
Thanks