This is a discussion on Plain text file on web server, questions please... within the Apache Web Server forums, part of the Web Server and Related Forums category; I run a Fedora Core 6 machine 24/7 to host a few FQDNs from my home cable connection and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I run a Fedora Core 6 machine 24/7 to host a few FQDNs from my home
cable connection and the Linux machine also acts as a firewall and router for the home LAN. I really like this arrangement as it allows me to access my home machine from abroad with Putty, FTP, or even Usermin to get at my files. I use cron and newspost to post a newsgroup FAQ twice a week to a certain newsgroup. I like to keep a single copy of this FAQ and then link to it where necessary, rather than have multiple copies of it floating around that need individual attention. This FAQ is also available 24/7 online through apache, I keep the main file in my $HOME/scripts directory and put a symbolic link to it in my www root directory. All of this works very well, the FAQ gets posted twice a week and the FAQ is online all the time. The problem is (OR at least what issue I would like to improve.) that there are several hyperlinks in the FAQ and when reading it in any decent newsreader, the link can be followed by a mouse click or with simple keystrokes. Since the online FAQ is really a text document, foobar.txt, it has no HTML tags in it to designate URL links and one would have to copy and paste the links into a browser address bar in order to check them out, cumbersome at best. Some people will not get it and simply ignore the links, which are pretty important. Since I do not want to have two copies of the FAQ (More chance for errors and also more work to maintain.), is there any way in Linux to automate making an HTML wrapper to throw around this text document, strictly for online viewing that would add the HTML tags to the online version such as <body></body>, and especially the link tags like this: <A href="http://www.foobar.com/foobarFAQ.txt">FAQ</A> I have been using Linux for over ten years but some of the really in depth stuff I really am not familiar with (Just ask me what "awk" is, I will probably tell you that it is a sound that birds make. <g>) Is there a utility that would do this or can it be done with a shell script perhaps? All links in the text document would begin with http:// and that is something identifiable to search for if one were to try and script it. Since the main text document gets posted twice weekly, I really do not want to mess with it or mess it up, I only make changes to it when necessary and reflect the changes in a version increase, a minor one if all I did was to reduce the URL size to the online document as such: Version 1.3.2 - June 17th, 2007 Version went from 1.3.1 to 1.3.2 because the URL to the file was shortened by using a symbolic link in my web root, rather than forcing the viewer to delve down into my public_html user directory. Could cron be used to copy the document over prior to adding the HTML tags right before posting and then when posting again, do the same thing, this way that if anything changed in the FAQ, it would also be changed in the online version as well? Thank you all for your help, I am a bit over my head on this one. -- ~Ohmster ohmster at ohmster dot com Put "messageforohmster" in message body to pass my spam filter. Thanks! |