LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2020, 02:43 PM   #1
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Rep: Reputation: 46
MDWiki - cannot open a file outside document root


In the index.md file, you open a file with ordinary markdown

[filename](filename.md)

But what if filename.md is in other directory? For example:

[filename](/home/myhomedir/Dropbox/filename.md)

I cannot find any way to get that to work.
 
Old 01-10-2020, 07:09 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
What is MDWiki?
 
Old 01-11-2020, 01:16 PM   #3
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
"MDwiki is a CMS/Wiki completely built in HTML5/Javascript and runs 100% on the client. No special software installation or server side processing is required. Just upload the mdwiki.html shipped with MDwiki into the same directory as your markdown files and you are good to go!"


https://dynalon.github.io/mdwiki/#!index.md
 
Old 01-11-2020, 01:38 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
So, it's served by the webserver (i.e.: apache)?
The limitation to DocumentRoot is managed by the webserver, not by the page being served.

See the Alias directive (for apache).

...or put the page inside the DocumentRoot somewhere.

Last edited by scasey; 01-11-2020 at 01:39 PM.
 
Old 01-11-2020, 05:31 PM   #5
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by walterbyrd View Post
But what if filename.md is in other directory?
The path TO it is then relative to the document root: that is
/ is the document root
/something is the directory "something" IN that root, etc.
 
Old 01-12-2020, 03:21 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ exactly, you need to know what your web server's document root is.
You cannot serve files that are not under that directory structure.
So, assuming your document root is /var/www/html, you cannot serve /home/myhomedir/Dropbox/filename.md directly.
You have to copy or symlink it to something under the servers document root, e.g.:
/var/www/html/Dropbox/filename.md
Then you can reference it like this:
Code:
[filename](/Dropbox/filename.md)
PS: I think websites that show NOTHING without javascript are in bad taste.
 
Old 01-12-2020, 03:43 PM   #7
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
The root dir is /var/www/html.

I cannot access files on /var/www/html/dir1 either.

So [file](dir1/file.md) does not work either.
 
Old 01-12-2020, 04:06 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by walterbyrd View Post
The root dir is /var/www/html.

I cannot access files on /var/www/html/dir1 either.

So [file](dir1/file.md) does not work either.
no, that's not what I showed you:
[file](/dir1/file.md)
Of course assuming that dir1/file.md actually exists under /var/www/html.
 
Old 01-12-2020, 04:15 PM   #9
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,599

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546
Without knowing what "does not work" means, it's only possible to guess at what might be wrong.

e.g. It could be any of incorrect syntax, a bug in MDWiki, and/or a design flaw.

Certainly the requirement for JavaScript comes in that final category, so my recommendation would be to forget about MDWiki and investigate whether the likes of ikiwiki/Gollum/Gitit/etc will do what you need.


Last edited by boughtonp; 01-12-2020 at 04:18 PM.
 
Old 01-19-2020, 06:23 PM   #10
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
Thanks for the replies.

MDWiki will probably just not do it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Publishing Markdown to HTML with MDwiki LXer Syndicated Linux News 0 09-01-2018 06:38 PM
Trying To Browse Outside Document Root weisdaclick Linux - Software 3 09-27-2009 04:36 PM
Access files outside the document root for Apache vwvr9 Linux - Server 3 07-28-2008 05:28 PM
Apache 403 access denied outside of document root freedo5 Linux - Software 2 09-21-2005 08:06 PM
Convert openoffice document into ms document through cli? bruno buys Linux - Software 0 07-05-2004 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration