You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by eoghan <ap...@redry.net> on 2005/09/02 13:58:31 UTC

[users@httpd] virtualhost with file

Hello
Im wondering if its possible to specify a file in the DocumentRoot?
For example:
<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain/myfile.pdf
</VirtualHost>
So if I have a pdf located here:
http://mysite.com/mypdf.pdf
and i want it accessible:
http://mysite.com/myguide/
I know it will require adobe plugin for the user...
If not, is there some way of doing it?
Thanks
Eoghan


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: AW: [users@httpd] virtualhost with file

Posted by eoghan <ap...@redry.net>.
Guenther, Christian wrote:
> why not use a redirect to a file, in that case the pdf?
>  

Will have to go this way, suggest it to the person asking, just wasnt 
sure if php was installed or not.
Thanks for the replies.
Eoghan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: AW: [users@httpd] virtualhost with file

Posted by eoghan <ap...@redry.net>.
Mads Rosendahl wrote:
> There are so many html2pdf converters out there Eoghan, there must be at 
> least one that can do
> it the other way around :)
> 

heh :) im sure theres probably someone hacking it out with frontpage 3.0 
as we speak!
eoghan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: AW: [users@httpd] virtualhost with file

Posted by Mads Rosendahl <ma...@twilight.dk>.
There are so many html2pdf converters out there Eoghan, there must be at 
least one that can do
it the other way around :)

eoghan wrote:

> Mads Rosendahl wrote:
>
>> That would be my preferred solution as well.
>>
>> Or simply specify the file as default-document for the site/folder 
>> with DirectoryIndex?
>>
>> I never use "Options Indexes" !!! I don't want to allow directory 
>> browsing, unless needed in special
>> cases. For security reasons.
>>
>> By why would you want to do it this way to begin with? It is not 
>> common to have a pdf-file as default
>> document. You will only have problems with it, and confused users. 
>> And you can't specify HTML meta
>> headers such as title, keywords, author and so on.
>>
>> Just some thoughts:
>> When you send non-html content to users, the response header 
>> Content-Type is used by the client
>> to determine what to do with it, in this case "Content-Type: 
>> application/pdf". Apache uses the filename
>> suffix to determine mime-type, as specified in /etc/mime.types in 
>> linux. Will apache return the correct
>> Content-Type header when the requested resource is a folder? Just a 
>> thought.... Otherwise the browser
>> will get really confused.
>
>
> Thanks for the comments. I realise this isnt a good thing to do, but 
> Im just helping someone out... they had given a url to many users for 
> a guidebook... The people who gave the link (printed in a document) 
> dont think of these things. I have suggested using php header() but 
> also noted that this will require people have a plugin so the page 
> actually opens... Im surprised that they didnt actually use a html 
> template for this information, since they give a web address for it, 
> but there you go :)
> Thanks again for the comments!
> Eoghan
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: AW: [users@httpd] virtualhost with file

Posted by eoghan <ap...@redry.net>.
Mads Rosendahl wrote:
> That would be my preferred solution as well.
> 
> Or simply specify the file as default-document for the site/folder with 
> DirectoryIndex?
> 
> I never use "Options Indexes" !!! I don't want to allow directory 
> browsing, unless needed in special
> cases. For security reasons.
> 
> By why would you want to do it this way to begin with? It is not common 
> to have a pdf-file as default
> document. You will only have problems with it, and confused users. And 
> you can't specify HTML meta
> headers such as title, keywords, author and so on.
> 
> Just some thoughts:
> When you send non-html content to users, the response header 
> Content-Type is used by the client
> to determine what to do with it, in this case "Content-Type: 
> application/pdf". Apache uses the filename
> suffix to determine mime-type, as specified in /etc/mime.types in linux. 
> Will apache return the correct
> Content-Type header when the requested resource is a folder? Just a 
> thought.... Otherwise the browser
> will get really confused.

Thanks for the comments. I realise this isnt a good thing to do, but Im 
just helping someone out... they had given a url to many users for a 
guidebook... The people who gave the link (printed in a document) dont 
think of these things. I have suggested using php header() but also 
noted that this will require people have a plugin so the page actually 
opens... Im surprised that they didnt actually use a html template for 
this information, since they give a web address for it, but there you go :)
Thanks again for the comments!
Eoghan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: AW: [users@httpd] virtualhost with file

Posted by Mads Rosendahl <ma...@twilight.dk>.
That would be my preferred solution as well.

Or simply specify the file as default-document for the site/folder with 
DirectoryIndex?

I never use "Options Indexes" !!! I don't want to allow directory 
browsing, unless needed in special
cases. For security reasons.

By why would you want to do it this way to begin with? It is not common 
to have a pdf-file as default
document. You will only have problems with it, and confused users. And 
you can't specify HTML meta
headers such as title, keywords, author and so on.

Just some thoughts:
When you send non-html content to users, the response header 
Content-Type is used by the client
to determine what to do with it, in this case "Content-Type: 
application/pdf". Apache uses the filename
suffix to determine mime-type, as specified in /etc/mime.types in linux. 
Will apache return the correct
Content-Type header when the requested resource is a folder? Just a 
thought.... Otherwise the browser
will get really confused.

Guenther, Christian wrote:

> why not use a redirect to a file, in that case the pdf?
>  
> Christian Günther
> SAP NetWeaver Technical Consultant
>  
> REALTECH
> *REALTECH system consulting GmbH*
> Industriestraße 39c
> 69190 Walldorf Germany
>  
> Tel.: +49.6227.837.267
> Mobile: +49.173.2571.326
> Fax: +49.6227.837.837
> mailto: christian.guenther@realtech.com
>  
>
> ------------------------------------------------------------------------
> *Von:* eoghan
> *Gesendet:* Fr 02.09.2005 13:58
> *An:* users@httpd.apache.org
> *Betreff:* [users@httpd] virtualhost with file
>
>Hello
>Im wondering if its possible to specify a file in the DocumentRoot?
>For example:
><VirtualHost *>
>ServerName www.otherdomain.tld
>DocumentRoot /www/otherdomain/myfile.pdf
></VirtualHost>
>So if I have a pdf located here:
>http://mysite.com/mypdf.pdf
>and i want it accessible:
>http://mysite.com/myguide/
>I know it will require adobe plugin for the user...
>If not, is there some way of doing it?
>Thanks
>Eoghan
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>  
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


AW: [users@httpd] virtualhost with file

Posted by "Guenther, Christian" <Ch...@realtech.com>.
why not use a redirect to a file, in that case the pdf?


Christian Günther 
SAP NetWeaver Technical Consultant 

REALTECH

REALTECH system consulting GmbH 
Industriestraße 39c 
69190 Walldorf Germany 

Tel.: +49.6227.837.267 
Mobile: +49.173.2571.326 
Fax: +49.6227.837.837 
mailto: christian.guenther@realtech.com

  




Von: eoghan
Gesendet: Fr 02.09.2005 13:58
An: users@httpd.apache.org
Betreff: [users@httpd] virtualhost with file


Hello
Im wondering if its possible to specify a file in the DocumentRoot?
For example:
<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain/myfile.pdf
</VirtualHost>
So if I have a pdf located here:
http://mysite.com/mypdf.pdf
and i want it accessible:
http://mysite.com/myguide/
I know it will require adobe plugin for the user...
If not, is there some way of doing it?
Thanks
Eoghan


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: [users@httpd] virtualhost with file

Posted by Anatoly Pugachev <ma...@rootshell.ru>.
On Fri, Sep 02, 2005 at 12:58:31PM +0100, eoghan wrote:
| Hello
| Im wondering if its possible to specify a file in the DocumentRoot?
| For example:
| <VirtualHost *>
| ServerName www.otherdomain.tld
| DocumentRoot /www/otherdomain/myfile.pdf
| </VirtualHost>

no, it's not allowed by apache. read
http://httpd.apache.org/docs/1.3/mod/core.html.en#documentroot

DocumentRoot directive must point to directory.
You can try to make
DocumentRoot /www/domain/htdocs
and place mypdf.pdf into that directory. In case you enabled Indexes option
for this directory, user will be able to download and see pdf document under
http://mysite.com/ 

| So if I have a pdf located here:
| http://mysite.com/mypdf.pdf
| and i want it accessible:
| http://mysite.com/myguide/
| I know it will require adobe plugin for the user...
| If not, is there some way of doing it?
| Thanks
| Eoghan

-- 
Anatoly Pugachev