TurnKey Linux Virtual Appliance Library

Hosting standalone HTML in Turnkey Wordpress Environment

I have a Turnkey Wordpress environment (that I upgraded to 3.0.1) and I'm wanting to host standalone HTML files inside it.  So for example, when users go to http://mysite.com, they'll get Wordpress, but when they go to http://mysite.com/content/test.html the HTML can be displayed. 

Currently when I try to do this, I keep getting a "It Works!" HTML page (not what I want).

Any help is appreciated.

Jeremy's picture

Virtual hosts?

AFAIK what you need to do is fiddle with virtual hosts in the Apache config. I'm not well versed in this stuff (so I could be wrong). If you're keen and want to have a go before someone who can help out comes along, have a search/read about that online and it should head you in the right direction.

You can manually edit the config file(s) but another way is to have a play with Webmin. I think from memory the Apache module should already be installed (look under Servers>>Apache along the top menu in Webmin). Remember you'll need to restart apache for new settings to be applied (again from memory there's a "Restart Apache" button in Webmin).

If you get it worked out perhaps post back with the steps you took so other TKL users trying to do the same thing won't need to work it out themselves.

Root directory!

Having used the appliance whilst setting up some specialist searches of the db, I find that the most important thing to remember is that the root domain for the appliance is not at  the root www directory but at www/wordpress .

Hence create any directories under the wordpress directory, not the standard root directory.

Jeremy's picture

Good thought

It may be as simple as adding a folder at /var/www/wordpress/new-folder. You can test it by making the folder and try browsing to it (http://<appliance-ip>/new-folder/) and see what happens.

re: Good thought

Yeah, I tried that first, actually.  No dice.

But did you include something in the directory?

Don't just create an empty directory, as apache is probably configure to not show directories index, include a file, say index.html and when you access, write the whole url (/wordpress/mysite/index.html). If it doesn't work, paste here the results of

tail /var/log/apache2/access.log 

To see what's really happening. 

Short ride...

There is indeed an .html file in that directory; it's not empty.  I can link to other assets in that directory (all the same permissions and ownership), and will display all the files (jpeg, png, etc.) just fine... just not html.

 

tail /var/long/apache2/access.log returns nothing

 

Thanks,

Sapridyne

Jeremy's picture

Have a look at this thread:

Although obviously WordPress & Moodle are different creatures but this other thread may be at least vaguely relevant to you.

Have a read, try some of the stuff over there and post back here to let me know how you go. I may be able to assist you to adjust it to your usage scenario (or maybe not seeing as I'm still a bit of an Apache newb!)

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)