Page 1 of 1

Help for ssh newbie, please

Posted: 09 Apr 2011, 18:19
by rolf
@ SSH - serving programs to thin clients, Fearless Leader wrote:You will need a ssh server like openssh server. I am going to assume that you know how to set up SSH. (If you don't, ask in the help section and you will be guided)

and here I be. :greetings

Setting the Scene

I've got http://lanlesalon.com/ being served from my Igel thin client running the Hiawatha web server software on Puppy Linux (4.3.1).

That came from a lot of help at bjoernvold.com/forum, thanks, and some blundering, blind moves on my part, so my grasp of the current state of affairs is somewhat limited.

The Help Request

Formerly, I had Joomla installed on the server box and was able to cobble up the web page with a combination of gui editors in the Joomla administration module. I could access the module over the lan on my desktop, which is really convenient. What I did, essentially, is copy the page source of lanlesalon.com from Seamonkey and paste it into the outward-facing file in Hiawatha on the thin client. As I understand it, I have no CMS, like Joomla, no administrative page. I can connect monitor, mouse, keyboard to the Igel but, iiuc what dmidecode reports, it is crawling along at a 300MHz overclock of the 200MHz Geode mini-brain. I can attest that working in the Puppy gui is painfully slow.

So, when I see reports like Make your SSH connection a Nautilus folder and fishy talk in KDE 4.6.1 from a Gnomer's point of view, I dream of administering the website over ssh (which I have never set up), making use of the Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz on the desktop.
Can this dream become a reality? Image

Re: Help for ssh newbie, please

Posted: 10 Apr 2011, 05:16
by rolf
There is some progress :coffee_smile:
Image


Essentially, google showed me I needed sshd on the Puppy machine, I found openssh, which supplies this, in the repositories, and I installed it. I fumbled about with konqueror on Mandriva, called ssh from terminal, and found I was asked for the root password. Puppy comes running as root and no password but simply Enter was not enough. So, running passwd on Puppy was enough to get me credentials to log in, as the screenie shows. I can browse and open files. I know there are other nuances I have seen, such as generating a key for a password-less login or such, but this looks like significant success. :B

I think I am still hobbled by the 300MHz cpu on the Igel, somewhat, as it is serving files, still but, perhaps, having X running on the client desktop and not having to switch sources from one computer to the other on the monitor will be a worthwhile improvement. Thanks.

Re: Help for ssh newbie, please

Posted: 10 Apr 2011, 09:52
by viking60
Great work!
And it is as easy as installling openSSH in most cases. The keygen command is very usefull for direct login and also it is more secure! If you provide a key wihout putting anything in the keyring, you will be logged directly in.
That means that you can have programs update and transfer files automatically (like a backup to another machine via a cronjob). This will normally be stoped by a password prompt.

Re: Help for ssh newbie, please

Posted: 10 Apr 2011, 17:40
by rolf
Thanks. Ok, maybe you can help or maybe it is too foreign but my next experiment was to try to insert a little php date/time script I see on the intertubes.

Code: Select all

            <div style="text-align: center;"><span class="article_separator"><?php // set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('AMERICA/LOS_ANGELES');
?><br />
            </span></div>


Well, the php code I tried to use is between <?php and ?> inclusive.
The rest is what bluefish/kompozer put there when I tried to do what I thought would work. The whole index.php is:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb"><head>
  <title>Elegant Styling Salon</title>

 
</head><body id="page_bg" class="color_blue bg_blue width_fmax">
<a name="up" id="up">
</a>
<div class="center" align="center">
<div id="wrapper">
<div id="wrapper_r">
<div id="header">
<div id="header_l">
<div id="header_r">

</div>
</div>
<div id="tabarea">
<div id="tabarea_l">
<div id="tabarea_r">
<div id="tabmenu">
<table class="pill" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td class="pill_l">&nbsp;</td>
      <td class="pill_m">
      <div id="pillmenu"> </div>
      <br />
      </td>
      <td class="pill_r">&nbsp;</td>
    </tr>
  </tbody>
</table>
</div>
</div>
</div>
</div>
<div id="search"><a name="up" id="up"> </a></div>
<div id="pathway"><a name="up" id="up"> </a></div>
<div class="clr">
<div id="whitebox">
<div id="whitebox_t">
<div id="whitebox_tl">

</div>
<div id="whitebox_m">
<div id="area">
<div id="leftcolumn"><a name="up" id="up"> </a></div>
<div id="maincolumn_full">
<table class="nopad">
  <tbody>
    <tr valign="top">
      <td>
      <table class="blog" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td valign="top">
            <div>
            <table class="contentpaneopen">
              <tbody>
                <tr>
                  <td colspan="2" valign="top">
                  <div style="text-align: center; font-weight: bold;"> <img src="/images/lan_n_me0014solo2.5.png" style="width: 76px; height: 96px; vertical-align: middle;" border="0" /><big><big><big><big>
                  <small style="font-family: Blue Highway Condensed;"><span style="font-style: italic;"><big>Welcome to Lan Le's Elegant Styling
Salon!</big><br />
                  <br />
                  </span></small></big></big></big></big>
                  <div style="text-align: justify;">
                  <div style="text-align: center;"> For 13 years, Lan
has provided beauty services and supplies from her salon at <a href="http://maps.google.com/maps/place?oe=utf-8&amp;um=1&amp;ie=UTF-8&amp;q=elegant+styling+salon+94619&amp;fb=1&amp;gl=us&amp;hq=elegant+styling+salon&amp;hnear=Oakland,+CA+94619&amp;cid=5802118223626512045" target="_blank">3926 MacArthur Boulevard</a>, in the Oakland Laurel
Village.<br />
New phone number: (510) 479-6899</div>
                  <p style="text-align: center;">
                  <script language="JavaScript" type="text/javascript">
 <!--
 var prefix = 'm&#97;&#105;lt&#111;:';
 var suffix = '';
 var attribs = ' title="email Lan"';
 var path = 'hr' + 'ef' + '=';
 var addy81505 = 'l&#97;nl&#101;' + '&#64;';
 addy81505 = addy81505 + 'm&#105;ndspr&#105;ng' + '&#46;' + 'c&#111;m';
 var addy_text81505 = '<img src="/images/env1a.jpeg" style="border-style: solid; border-width: 0px; width: 75px; height: 75px; vertical-align: middle;" />';
 document.write( '<a ' + path + '\'' + prefix + addy81505 + suffix + '\'' + attribs + '>' );
 document.write( addy_text81505 );
 document.write( '<\/a>' );
 //-->
 </script>
                  <script language="JavaScript" type="text/javascript">
 <!--
 document.write( '<span style=\'display: none;\'>' );
 //-->
 </script>This
e-mail address is being protected from spambots. You need JavaScript
enabled to view it
                  <script language="JavaScript" type="text/javascript">
 <!--
 document.write( '</' );
 document.write( 'span>' );
 //-->
 </script></p>
                  <table style="text-align: left; width: 100%;" align="center" border="0" cellpadding="2" cellspacing="2">
                    <tbody>
                      <tr>
                        <td style="vertical-align: top; text-align: center;"> &nbsp;</td>
                        <td style="vertical-align: top; text-align: center;"> <big><big><big><span style="color: rgb(204, 0, 0);"><span style="font-family: Bitstream Vera Sans;"><span style="text-decoration: underline;"><strong>Price List</strong></span></span></span></big></big></big></td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center;"> <big><big><big><span style="text-decoration: underline;"><span style="font-family: Bitstream Vera Sans Mono;"><strong><span style="color: rgb(51, 102, 255);"><u>HAIRCUTS</u></span></strong></span></span></big></big></big></td>
                        <td style="vertical-align: top;"> &nbsp;</td>
                      </tr>
                      <tr style="text-align: center;">
                        <td style="vertical-align: top; text-align: center;"> <span style="font-size: 14px;"><big><big><big><span style="color: rgb(255, 0, 0);"><strong>DI<small><big>SCOUNT</big></small></strong></span></big></big></big></span></td>
                        <td valign="top">
                        <address> <span style="font-size: 8px;"><span style="font-family: courier new,courier,monospace;"><u><strong><big>HAIRCUT</big></strong></u><strong>
Man....................$12 and up</strong></span></span></address>
                        <address> <span style="font-size: 8px;"><span style="font-family: courier new,courier,monospace;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Woman..................$15 and up</strong></span></span></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center;"> <big><big><big><span style="color: rgb(51, 102, 255);"><strong>for</strong></span></big></big></big></td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <span style="font-family: courier new,courier,monospace;"><span style="font-size: 8px;"><big><big><span style="text-decoration: underline;"><strong>SHAMPOO &amp; SET</strong></span><strong>..................$15
and up</strong></big></big></span></span></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center;"> <small><span style="color: rgb(51, 102, 255);"><big><big><big><big><strong>Seniors</strong></big></big></big></big></span></small></td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <span style="font-size: 8px;"><span style="font-family: courier new,courier,monospace;"><big><big><span style="text-decoration: underline;"><strong>PERM or COLOR or HIGHLIGHT</strong></span><strong>.....$35
and up</strong></big></big></span></span></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center;"> <img src="/images/as_coeur_jean_victor_bal_.png" border="0" /></td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <span style="font-size: 8px;"><span style="font-family: courier new,courier,monospace;"><big><big><span style="text-decoration: underline;"><strong>FACIAL WAXING</strong></span><strong>.........................$35</strong></big></big></span></span></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top;"> &nbsp;</td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <tt><span style="font-size: 8px;"><span style="font-family: courier new,courier,monospace;"><big><big><span style="text-decoration: underline;"><strong>EYEBROW or CHIN</strong></span><strong>.......................$15</strong></big></big></span></span></tt></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center;"> <em><big><big><big><span style="color: rgb(204, 0, 0);"><strong><span style="font-family: URW Chancery L;">Japanese Straight Perms</span></strong></span></big></big></big></em></td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <span style="font-size: 8px;"><span style="font-family: courier new,courier,monospace;"><big><big><strong><span style="text-decoration: underline;">UPPER LIP</span>..............................$5</strong></big></big></span></span></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center;"> <em><span style="color: rgb(51, 102, 255);"><big><big><big><span style="font-family: URW Chancery L;"><strong>Ear Piercing</strong></span></big></big></big></span></em></td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <span style="font-family: courier new,courier,monospace;"><span style="font-size: 8px;"><big><big><strong><span style="text-decoration: underline;">EYEBROW COLOR</span>.........................$15</strong></big></big></span></span></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center; font-family: URW Chancery L;">
                        <em><big><big><big><span style="color: rgb(204, 0, 0);"><strong>Eyelash and Eyebrow Tint</strong></span></big></big></big></em></td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <span style="font-family: courier new,courier,monospace;"><span style="font-size: 8px;"><big><big><strong><span style="text-decoration: underline;">EYELASHES</span>
Individual..................$15</strong></big></big></span></span></address>
                        </td>
                      </tr>
                      <tr>
                        <td style="vertical-align: top; text-align: center; font-family: URW Chancery L;">
                        <em><big><big><big><span style="color: rgb(204, 0, 0);"><strong>Perm<span style="color: rgb(51, 102, 255);"> Color</span> Hilite</strong></span></big></big></big></em></td>
                        <td style="text-align: center; font-family: monospace;">
                        <address> <span style="font-family: courier new,courier,monospace;"><span style="font-size: 8px;"><big><big><strong><span style="text-decoration: underline;">EAR PIERCING</span>..........................$15</strong></big></big></span></span></address>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                  </div>
                  </div>
                  </td>
                </tr>
              </tbody>
            </table>
            <div style="text-align: center;"><span class="article_separator"><?php // set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('AMERICA/LOS_ANGELES');
?><br />
            </span></div>
            </div>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
  </tbody>
</table>
</div>
<div class="clr">
</div>
<div class="clr">
</div>
<div id="whitebox_b">
<div id="whitebox_bl">

</div>
</div>
<div id="footerspacer">
</div>
<div id="footer">
<div id="footer_l">
<div id="footer_r">


</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</body></html>


There is no date/time showing on the website. Some confusion, for me, is that there is both httpd.conf and hiawatha.conf on the server. In httpd.conf, I have:

# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

If I uncomment those two lines in hiawatha.conf:

# Cause the PHP interpreter to handle files with a .php extension.
#
#AddHandler php5-script .php
#AddType text/html .php

and

Code: Select all

# /etc/init.d/rc.httpd start
read /var/run/php-fcgi.pid: No such file or directory
starting PHP FastCGI daemons
Syntax error in hiawatha.conf on line 101.


Where line 101 is this one: AddHandler php5-script .php
If I comment 101, 102 throws the error. Comment that and the server starts.

Code: Select all

# /etc/init.d/rc.httpd start
stopping PHP FastCGI daemons
starting PHP FastCGI daemons


More confusion-> Although starting httpd is what gets the website online....

Code: Select all

# ps aux|grep hia     
root      7899  2.0  0.2   1656   560 pts/2    S+   09:19   0:00 grep hia
nobody   29792  0.0  0.5   7104  1352 ?        Ssl  08:47   0:00 /usr/sbin/hiawatha -c /etc/hiawatha
# ps aux|grep http
root      7929  0.0  0.2   1656   564 pts/2    S+   09:19   0:00 grep http
# ps aux|grep httpd
root      8016  0.0  0.2   1656   560 pts/2    S+   09:20   0:00 grep httpd
#


:wall:

So, if someone can offer insight, I would appreciate it!

Re: Help for ssh newbie, please

Posted: 11 Apr 2011, 01:03
by viking60
Just to start: I think httpd.conf is the right place to adjust and add functions to the server. (but I don't have hiawata).
Could you make the info.php page:

Code: Select all

<?php
echo "The viking superduperserver info:";
phpinfo();
?>

Save it to the server as info.php (or pannekaker.php for that matter) and look it up in your Browser.
That will give a nice overview of what you have activated. If you cant see it, php is not running. If I could somehow have a peek at it, I am sure that I could get confused at a much higher level. :shock:

Re: Help for ssh newbie, please

Posted: 11 Apr 2011, 01:44
by rolf
Thanks for falling on the sword, there, Über

Code: Select all

# ps aux|grep sql
root      1827  2.0  0.2   1656   556 pts/2    S+   17:11   0:00 grep sql
root      3534  0.0  0.4   2228  1184 ?        S    Mar27   0:00 /bin/sh /usr/local/bin/mysqld_safe --user=nobody --pid-file=/usr/local/var/mysql.pid
nobody    3759  0.0  4.6  90708 11532 ?        Sl   Mar27   0:32 /usr/local/libexec/mysqld --basedir=/usr/local --datadir=/usr/local/var --user=nobody --log-error=/usr/local/var/puppypc.err --pid-file=/usr/local/var/mysql.pid --socket=/tmp/mysql.sock --port=3306


I am not sure how to view info.php in a Browser. When I try to open a php file in fish:, it prompts for gedit or KomPozer or bluefish etc. and I wind up looking at code. I have seen some clues to follow, here, like opening a program over ssh and I'll try that when I get back from dinner!

....and, OH! :o

I see you were talking about php....

Code: Select all

# ps aux|grep php
root     18937  0.0  0.2   1656   560 pts/2    S+   18:02   0:00 grep php
nobody   29783  0.0  1.7  13360  4432 ?        Ss   08:47   0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php.ini
nobody   29784  0.0  0.7  13360  1968 ?        S    08:47   0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php.ini
nobody   29785  0.0  0.7  13360  1968 ?        S    08:47   0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php.ini
nobody   29786  0.0  0.7  13360  1968 ?        S    08:47   0:00 /usr/local/bin/php-cgi -b 127.0.0.1:2005 -c /etc/php.ini
#
:oops:

Re: Help for ssh newbie, please

Posted: 11 Apr 2011, 02:16
by rolf

Re: Help for ssh newbie, please

Posted: 11 Apr 2011, 10:13
by viking60
Yippi. You have PHP running just fine. Looks like Mysql is running too. In the "Date" section I can see that your timezone is set to America/Los Angeles so the setting is correct.
To add further modules to php and to get it under your skin you could take a look at /etc/php.ini on the server.
The Date and Timezone settings are under Module Settings.
PHP will only show up on the server in a browser. If you access it via fish you will only get the option to edit it in Bluefish etc. If you try to open it in a browser via fish you will get text or nothing. So edit via fish and look via http.

To execute php from a html file look here