Forum: 
Tags: 

Overwrote index.php in /var/www/ -- Any way to get it back?

Nick's picture

Turnkey 12.0 / Debian 6.0.5

Accidentally overwrote the index.php that Turnkey uses to allow access to the web shell, phpmyadmin, etc.  Is there a place to nab that file and drop it in there?

Jeremy Davis's picture

But you can access them easily from your browser address bar, you just need to know the port numbers and add them on the end of your appliance IP/FQDN (all are https).

WebShell - port 12320 ie https://<appliance-ip-or-fqdn>:12320
Webmin - port 12321 ie https://<appliance-ip-or-fqdn>:12321
phpMyAdmin - port 12322 ie https://<appliance-ip-or-fqdn>:12322

All this info is available from the TKL ConfConsole screen of your appliance (the screen that shows on the local console of your appliance).

If you really want the TKL landing page back (ie the index.php) let me know and I can upload a copy for you. But let me know what appliance you are using (they are different depending on the appliance).

Nick's picture

A copy would be great.  Even the code is fine.  I appreciate the info on accessing them but I don't know if the other people who use this appliance would be appreciative.

Jeremy Davis's picture

You didn't mention which appliance though, so I've assumed that it is the LAMP appliance. I rename mine tkl.php.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="Content-Style-Type" content="text/css">
        <meta http-equiv="Content-Script-Type" content="text/javascript">

        <title>TurnKey LAMP</title>
        
        <link rel="stylesheet" href="css/ui.tabs.css" type="text/css" media="print, projection, screen"/>
        <link rel="stylesheet" href="css/base.css" type="text/css"/>

        <script src="js/jquery-1.2.6.js" type="text/javascript"></script>
        <script src="js/ui.core.js" type="text/javascript"></script>
        <script src="js/ui.tabs.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function() {
                $('#container-1 > ul').tabs({ fx: { opacity: 'toggle'} });
            });
        </script>
    </head>

    <body>
        <h1>TurnKey LAMP</h1>
        
        <div id="container-1">
            <ul>
                <li><a href="#cp"><span>Control Panel</span></a></li>
            </ul>

            <div id="cp">
                <div class="fragment-content">
                    <div>
                        <a href="https://<?php print
                        $_SERVER{'HTTP_HOST'}; ?>:12320"><img
                        src="images/shell.png"/>Web Shell</a>
                    </div>
                    <div>
                        <a href="https://<?php print
                        $_SERVER{'HTTP_HOST'}; ?>:12321"><img
                        src="images/webmin.png"/>Webmin</a>
                    </div>
                    <div>
                        <a href="https://<?php print
                        $_SERVER{'HTTP_HOST'}; ?>:12322"><img
                        src="images/phpmyadmin.png"/>PHPMyAdmin</a>
                    </div>
                    <div></div>
                    <div></div>

                    <h2>Resources and references</h2>
                    <ul>

                        <li>
                          <a href="/phpinfo.php">Apache PHP information</a>
                          (to disable: rm /var/www/phpinfo.php)
                        <li>
                          <a href="/server-status">Apache server status</a>
                          (to disable: a2dismod status)
                        </li>
                        <li><a
                        href="http://www.turnkeylinux.org/lamp">
                        TurnKey LAMP release notes</a></li>
                    </ul>
                    ./cgi-bin/pywebapp.py
                </div>
            </div>

        </div>
    </body>
</html>

Nick's picture

Thank you!  Much appreciated.

Post new comment