Ok I have a small problem ... let me try to explain it.
I am to put apply these styles and images to a page. The page uses a template called header.shtml.
In the header.shtml I included a number of styles sheets as css files and images.
Now I need to set the path.
The path from root of the script which is loaded to browser is
- /ABX/WebServer/CGI-Executables/ask/ttxcfg.cgi
and the header.shtml is
- /ABX/WebServer/Documents/ttxdata/templates/header.shtml
Now I put the images in both those location i.e templates and ask directory with permission 755 but they are not getting displayed.
I assumed the document root is cgi-bin and tried image tag
- <IMG src="cgi-bin/ask/image.gif">
but it did not appear. Can anyone help me with this.
In the Apache server, images, and text/html, files are NOT displayed from a executable directory. You will have to place them, in a separate folder down from the root.
From the cgi folder you mentioned you will have to go "up" three and then down four to reach the template from the cgi script. If the pages are being generated by the CGI script you will have to construct you paths relative to there.
ie:
-
-
# In the script to reach your template.
-
my $temp = "../../../Documents/ttxdata/templates/header.shtml";
-
-
However you
can store the templates in the cgi directory, as long as they will only be accessed by your cgi scripts. BUT the images, css, etc... will have to still be up out of the executable directory. So in your templates you will have to list the path to an image as:
<img src="../../" > Now you will be in the WebServer dir, so wherever the image folder is go to that. (if it was one dir down in a folder called "images" it would be:
-
<img src="../../WebServer/images/theImage.jpg">
-
The pages are acually being "served" from the cgi dir.
Hope this helps!!
It's kinda confusion, without me knowing where the css, and images are at.
I recommend making a sub folder in the CGI-Executables for the templates.
Unless (I noticed you have named them with shtml) you are using server side includes.
Let me know if this cleared things up at all??