TurnKey Linux Virtual Appliance Library

Document Root not Working

greensquare90's picture

Hi Everybody

I installed Turnkey LAMP and it works great. I can access all the menus in webmin. I then uploaded my web site to var/www/green90. But once I want to access my web site I keep on getting an error message from firefox.

Oops! This link appears to be broken.

I insert the following address - Then it does not work, and with my wamp server on my PC the site runs perfectly.

When I insert - I can access the server.

I have been searching for 3 hours now and testing to try and solve the problem. I also set the permissions on the directory and all sub directories to 777 for testing, but still not.

This is the contents of my /sites-available/default

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/

<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/cert.pem
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/

<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        Order allow,deny
        allow from all

Please let me know how to fix this or what am I missing ?

Guest's picture

Try different URL

I've tried the wamp server.

You said > the following address - Then it does not work

Have you tried the following address ?

Dickson Swanepoel's picture

Url Tried, no luck yet ?

Hi I tried the url above with no luck yet.

I have pasted the result from Live HTTP Headers:

#request# GET
GET /green90
#request# GET http://linkhelp.clients.google.com/tbproxy/lh/fixurl?url=http%3A%2F%2F19...
#redirect# GET /tbproxy/lh/fixurl?url=http%3A%2F%2F192.168.2.2%2Fgreen90&sourceid=navclient-ff&hl=en&sd=com.na&error=http404
#request# GET http://csi.gstatic.com/csi?v=3&s=linkdoctor&action=opt&srt=782&tran=-5&e...
GET /csi?v=3&s=linkdoctor&action=opt&srt=782&tran=-5&e=&rt=ol.63

This same error comes with the other urls as well. It is like my computer does not even send the request to my server.

This is the result I get when I just use the http://www.

#request# GET
#request# GET
#request# GET
#request# GET
#request# GET
#request# GET
#request# GET
#request# GET
#request# GET
#request# GET

Hope somebody can help. Thanks

Jeremy Davis's picture

Contents of /var/www should display using http://hostname-or-ip/

As /var/www is the document root then the contents of /var/www should display in your web browser using http://hostname-or-ip/ (in your example - note no www preceding the IP).

By default it will look for a file named index.htm (or variations of such eg index.html, index.php etc). If you don't have an index file you will need to explicitly state the filename (eg I'm not sure how the TKL LAMP appliance is setup but by default if there is no index file, apache will display the contents of the /var/www folder in the web browser.

If your page is in a sub directory (eg /var/www/green90) then is should display using http://hostname-or-ip/subfolder/ but again remember you probably want to explicitly define the page name if no index file exists.

Dickson Swanepoel's picture

Hi Everybody, I solved it!

I re-installed Turnkey LAMP on my server, just leaving all the default settings. After installing LAMP,  the default directory for your web site is (/var/www/). I created a new folder for my web site at  (/var/www/green90/) and installed my web site in that dierectory. To call the web site you have to use the following (Where is my server IP. So you leave out the (var/www/), and add your page at the end that you would like to connect to. This just shows you how such a simple thing can complicate your life as it took me more than 10 hours to figure out. Hope this helps someone else. Enjoy.


Thank You JedMeister

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)