Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question: Loads SSI but not any of the images? 1

Status
Not open for further replies.

egims

Technical User
Joined
Jun 5, 2001
Messages
96
Location
US
Please bare with my newbie questions.

I have successfully loaded apache onto my Win2000 computer. Being a web developer I have changed the DocumentRoot to the root directory I use to contain all my clients folders, along with having changed the <directory> tag.

I would like to be able to click through an entire web site on my local machine as if I were accessing it on the web. Again, I use a lot of SSI, so I have also enabled that.

The problem I am having is that I can load an index.shtml page , and it loads the text from the includes, but won't load any graphics? Also, I can't navigate to any of the other site pages in the folder.

How can I achieve my goal?

Thanks.
 
Hi

egims said:
Being a web developer I have changed the DocumentRoot to the root directory I use to contain all my clients folders
Would not be better to use distinct virtualhosts for each of your clients ? I think this will solve all your mentioned problems.

Feherke.
 
Hi feherke,

Oh, yes of course. This does come after I have completed designing a web site. I wish to be able to do what I mentioned locally during the design process, simply to make some things easier.

Seems like it shouldn't be to difficult once apache is installed as it is, but I don't know enough about apache to make the necessary tweaks.
 
Hi

egims said:
This does come after I have completed designing a web site.
My experience says that is better to start by setting up a virtual host. For me HTTP goes first, HTML after.
egims said:
Seems like it shouldn't be to difficult
Yes, is simple. In the default httpd.conf file of the Linux package is a well commented virtualhost example too. Just need to personalize it.

The documentation also contains good examples with explanations :

Feherke.
 
Thanks feherke, I do appreciate you help.

I hate to seem stupid, but I really am quite an apache newbie. I have seen the examples, done some tinkering, but still not been successful. I guess I just don't understand.
 
Hi

egims said:
done some tinkering, but still not been successful
Quite vague. So let see :
[ul]
[li]You put something like this in the httpd.conf ( or whatever is your server configuration file ) :
Code:
NameVirtualHost *:80
<VirtualHost *:80>
  DocumentRoot /webproject/myfairclient
  ServerName myfairclient
</VirtualHost>
[/li]
[li]Restarted Apache[/li]
[li]Added this to your hosts file
Code:
127.0.0.1       localhost
127.0.0.1       myfairclient
or provided other way to redirect requests for myfairclient host to your machine
[/li]
[/ul]
( Assuming that your Apache is serving on port 80, the client's site is located in \webproject\myfairclient directory on the same disk as Apache. )

The hosts file is located in c:\windows on Windows '9x, c:\windows\system32\drivers\etc\ on Windows XP, no idea for others. ( And in /etc on Linux. )

As verification :
- [highlight]httpd -t[/highlight] - will do syntax check on your configuration files ( no idea how this works on Windows )
- [highlight]ping myfairclient[/highlight] - should answer, showing the IP specified in hosts

Feherke.
 
Hello feherke,

Thank you again. I did everything you said, so that all I now need to do is type in:

directory/

...and the index.shtml page loads, including the "text of the includes. However, just as before, the images won't load, and I can not navigate to any other page on the site.

So, I'm really back to square one. Any thoughts?
 
Hi

egims said:
However, just as before, the images won't load, and I can not navigate to any other page on the site.
Ok, then please give us details about :
[ul]
[li]main shtml file location[/li]
[li]included shtml file location[/li]
[li]image file location[/li]
[li]the [tt]img[/tt] tag which does not include the image[/li]
[li]the [tt]a[/tt] tag which does not link to the other sites[/li]
[li]the access_log and error_log messages for the failed requests[/li]
[/ul]

Feherke.
 
Just wanted to say that this is the simplest explanation I have seen for setting up virtual hosts!! I'd tried various times before but never got them working. 20secs following the instructions here and it works perfectly.

Thanks loads Feherke, it will make my life so much easier from now on.

A star me thinks.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top