SME HowTo Page
HowTo | Last Updated | SME Versions |
How to use SSH to remotely access Server-Manager | January 30, 2003 | 5.5U2 & 5.6 |
How to Install Apache MP3 Jukebox | 5.5U2 | |
How to enable HTML emails for webmail (Horde/IMP) | January 17, 2003 | 5.5U2 & 5.6 |
How to install SSL Certificate for webmail | 5.5U2 | |
How to install YAPPA Photo Album | January 17, 2003 | 5.5U2 & 5.6 |
How to Install MRTG system monitoring with SNMP Support | January 17, 2003 | 5.5U2 & 5.6 |
How to Install AWStats Web Statistics | January 17, 2003 | 5.5U2 & 5.6 |
How to Install NetJuke | January 17, 2003 | 5.5U2 & 5.6 |
How to install fetchmail | January 17, 2003 | 5.5U2 & 5.6 |
How to enable FTP to an iBay | 5.5U2 | |
How to install PhpSysInfo in an IBay | January 17, 2003 | 5.5U2 & 5.6 |
How to Install a simple system monitor | 5.5U2 | |
How to Install Gallery 1.3.3 in an Ibay on SME 5.5 | February 14, 2003 | 5.5U2 & 5.6 |
All these HowTo's are made based on other peoples HowTo's with my own additions to make them even easier to understand. I do in no way claim to be the e-smith wiz as I have merely gathered all the HowTo's to be able to do my own installation. All these HowTo's have been installed on a SME v5.5 with Update2 and when I did my Update installation to 5.6 they all worked without any hassle.
How to use SSH to remotely access Server-Manager
On SME v5.5 SSH X11 forwarding is enabled by default but on 5.6 you have to modify the SSH configuration.
[root@e-smith
]# mkdir -p
/etc/e-smith/templates-custom/etc/ssh/sshd_config
[root@e-smith
]# echo "X11Forwarding
yes" > /etc/e-smith/templates-custom/etc/ssh/sshd_config/X11Forwarding
[root@e-smith
]# /sbin/e-smith/expand-template
/etc/ssh/sshd_config
Now restart the SSH deamon
[root@e-smith ]# service sshd restart
Download and install TTSH
Telnet / SSH client
Read this section: How to Obtain and Install TTSSH
Make a shortcut to c:\program files\TTTERMPRO\ttssh.exe on your desktop.
Open TTSH | Setup | SSH Forwarding
and configure like so:
Set Terminal Window Size: Setup
| Terminal | check Term size=win size
Make sure you save it by doing Setup | Save
Setup
File | New Connection and put in your
remote IP to connection.
When prompted login as either admin
or root and supply password (same for both)
admin gets your the console and can admin it via lynx text browser, etc.
root gets your the shell ...check diskspace df -h, change config files,
etc.
Open up your broswer and type http://localhost:8000
(you need the http:// part)
It'll prompt you for authentication. Again login either as admin or root
and voila
you should now be able to use web browser to admin your e-smith server remotely.
How to Install Apache MP3 Jukebox
This can be found at: http://www.e-smith.org/docs/howto/jukebox-howto.php3
How to enable HTML emails for webmail (Horde/IMP)
See: http://www.horde.org/faq/admin/config/index.php#c14
Please note that the horde directory is located in:
/home/httpd/html/horde
How to install SSL Certificate for webmail
The solution is to install your own certificates into
Windows on a permanent basis, thus preventing users from being continually
prompted to accept certificates. And this is the point where things usually fall
apart, since most applications, such as Outlook Express, do not have the ability
to import certificates from a server -- leaving users to click "Use this
server" every time they check for email.
Fortunately the answer is simple and quick. Using Internet Explorer, load the
URL for the service; for example, with a SSL-enabled IMAP server running on
"imap.example.com," place the following URL into the Address bar:
https://imap.server.com:993/
The users will be prompted with the normal certificate dialog, and if they
choose to install the certificate it will then be available to Outlook Express
and other applications that make use of the Windows certificate management.
The following is a list of common SSL-enabled services and their port numbers:
SSL IMAP 993
SSL POP 995
SSL HTTP 443
SSL SMTP 465
SSL NNTP 563
SSL LDAP 636
Point Internet Explorer at the server and the appropriate port; you will be able
to install the certificate with ease. To make life easier for users, you can
also export the certificates, allowing for distribution in custom builds of
Internet Explorer, for example, or housed on a company Intranet site.
How to install YAPPA Photo Album
(based on contribution from Eric Womack)
First install the Freetype package (check rpmfind.net for updates)
SME 5.5U2
[root@e-smith ]# rpm -ivh ftp://ftp.rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/freetype-2.0.3-7.i386.rpm
SME 5.6
[root@e-smith ]# rpm -ivh ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/freetype-2.0.9-2.i386.rpm
Then create an ibay
to hold your pictures
Information bay name: Yappa
Description: Online Photo Album
Group: everyone
User access: Write=group, Read=everyone
Public access: (As you like it)
Execution of dynamic content: enabled
Now download the Yappa package from SourceForge.Net (http://sourceforge.net/projects/yappa/) and Unzip in the HTML directory
Now edit the config.inc.php file so that the Photo_root variable is set to the path of the images.
/* directory where album dirs are stored */ "photo_root" => "/home/e-smith/files/ibays/yappa/html/photos", |
Also make sure to set the Image_Module to use the GD package with is already installed on the SME 5.5
/* Image module: Magick, gd */ "image_module" => 'gd', |
In order to use the latest version 1.7 you need to alter a line in the "image-gd.class.php" file or you will not have auto generated thumbnails.
Change the line as indicated below (the ImageCreateTruecolor and ImageCopyResampled are part of the GD version 2 which is not yet available and functional on SME 5.5.
function ImageUtil(&$config)
{
// $this->_can_truecolor = (function_exists("ImageCreateTruecolor") && function_exists("ImageCopyResampled")) ? 1 : 0;
$this->_can_truecolor = 0;
}
How to Install MRTG system monitoring with SNMP Support
(created based on contribution by several people)
First install the two SNMP packages (check rpmfind.net for updates)
SME 5.5U2
[root@e-smith ]# rpm -ivh ftp://rpmfind.net/linux/redhat/updates/7.2/en/os/i386/ucd-snmp-4.2.5-7.72.0.i386.rpm
[root@e-smith ]# rpm -ivh ftp://rpmfind.net/linux/redhat/updates/7.2/en/os/i386/ucd-snmp-utils-4.2.5-7.72.0.i386.rpm
SME 5.6
[root@e-smith ]# rpm -ivh ftp://rpmfind.net/linux/redhat/updates/7.3/en/os/i386/ucd-snmp-4.2.5-7.73.0.i386.rpm
[root@e-smith ]# rpm -ivh ftp://rpmfind.net/linux/redhat/updates/7.3/en/os/i386/ucd-snmp-utils-4.2.5-7.73.0.i386.rpm
Then install the latest MRTG RPM (check rpmfind.net for updates)
[root@e-smith ]# rpm -ivh ftp://rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/mrtg-2.9.6-6.i386.rpm
You then need to change the hosts.allow file to allow access to the snmp deamon
Issue the following commands at console:
[root@e-smith
]# mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow
[root@e-smith
]# echo "snmpd: 127.0.0.1, 192.168.212.0/255.255.255.0" >
/etc/e-smith/templates-custom/etc/hosts.allow/snmpd
[root@e-smith
]# /sbin/e-smith/expand-template /etc/hosts.allow
You can replace the "127.0.0.1, 192.168.212.0/255.255.255.0" with "ALL" if you allow SNMP requests from the anywhere.
Then we need to make sure that the SNMP deamon is allowed to prope the right values. This is done by adding or modifying the following entries in the snmpd.conf file.
[root@e-smith ]# cd /etc/snmp
[root@e-smith ]# pico snmp.conf
# First, map the community name (COMMUNITY) into a security name
# (local and mynetwork, depending on where the request is coming
# from):
# sec.name source community
com2sec local localhost public
# Second, map the security names into group names:
# sec.model sec.name
group MyROGroup v1 local
group MyROGroup v2c local
group MyROGroup usm local
# Third, create a view for us to let the groups have rights to:
# incl/excl subtree mask
view all included .1 80
# Finally, grant the group access to the 1 view with different # write permissions:
# context sec.model sec.level match read write notif
access MyROGroup "" any noauth exact all none none
You now want to make sure that the SNMP deamon is restarted when/if the server is rebooted:
[root@e-smith ]# cd /etc/rc.d/rc7.d
[root@e-smith ]# ln -s /etc/rc.d/init.d/snmpd S95snmpd
[root@e-smith ]# /sbin/e-smith/config set snmpd service InitscriptOrder 95 status enabled
Now make sure to start the SNMP deamon to have the new setting take effect
[root@e-smith ]# service snmpd start
Now you are ready to do the actual MRTG installation:
1)
Then create an ibay called "mrtg" from the server manager
Information bay name: mrtg
Description: MRTG System Monitor
Group: everyone
User access: Write=group, Read=everyone
Public access: (As you like it)
Execution of dynamic content: disabled
2) Create the MRTG script
[root@e-smith ]# cd /root
[root@e-smith ]# pico create-mrtg
Now paste the following text into PICO and save the files by pressing CTRL-X, Y, to save. Make sure not to have line-breaks in the middle of the different commands.
#!/bin/bash
#This script will create a folder inside the ibay
"mrtg" which is named by the first variable. It will create a cfg file
inside the /etc/mrtg folder.
#It will also add a line to the script "/etc/mrtg/all-ip" so that #crontab will run this script which in turn will run mrtg for each device.
#The second variable is the IP address of each device to be monitored..This script is best run when "all" the workstations connected to
#it are powered up because "cfgmaker" ignores inactive
ports when it is run.
# EX:
#
Var1 Var2
#
| |
#
[root@e-smith /root]# create-mrtg 10001 10.0.0.1
# Create a "workdir" for this device
using the first variable
mkdir -p /home/e-smith/files/ibays/mrtg/html/$1
#create the cfg file for this Ip address using
the first variable (assumes community string is "public")
perl /usr/bin/cfgmaker public@$2 --global "workdir:
/home/e-smith/files/ibays/mrtg/html/$1" --output /etc/mrtg/$1.cfg
#Create an index.html file for this folder
using the first variable
perl /usr/bin/indexmaker /etc/mrtg/$1.cfg >
/home/e-smith/files/ibays/mrtg/html/$1/index.html
#create an entry in script "all-ip"
to run mrtg for each device.
echo "/usr/bin/mrtg /etc/mrtg/$1.cfg;"
>> /etc/mrtg/all-ip
#Uncommenting the line below will create a
"master" index.htm inside the ibay/html directory for all devices.
#Note that this line will create a text file
called index.html. This should be edited for correct html syntax.
#echo "<br><a href=$1/index.html> Traffic on ports of Device $1 </a>" >> /home/e-smith/files/ibays/mrtg/html/index.html
3) make the script executable
[root@e-smith ]# chmod 755 create-mrtg
4) Now run create-mrtg
var1 var 2
| |
[root@e-smith ]# ./create-mrtg server 10.0.0.1
- Where "server" is the first variable and is used to create,
- the mrtg configuration file for this device
- EX: "/etc/mrtg/server.cfg",
- a directory to place the png and html files created when the script runs
- EX: "/home/e-smith/files/ibays/mrtg/html/server
- And "10.0.0.1" is the IP address of the device. If you want to monitor you local server then use "localhost" as IP address
5) You now need to make sure that the update is run with regular intervals (every 5mins) so we insert it in the Crontab scheduler
[root@e-smith ]# chmod 755 /etc/mrtg/all-ip
[root@e-smith ]# mkdir -p /etc/e-smith/templates-custom/etc/crontab/
[root@e-smith ]# echo "0-59/5 * * * * root /etc/mrtg/all-ip" > /etc/e-smith/templates-custom/etc/crontab/mrtg
[root@e-smith ]# /sbin/e-smith/expand-template /etc/crontab
6) Now wait 5 minutes and then try to look at
http://server.domain.com/mrtg/server
If you also want to monitor your disk as well as CPU usage you can do the following:
First you need to add a disk entry in your snmp.conf file. Here is an example of an snmp.conf file from my system.
[root@e-smith ]# cd /etc/snmp
[root@e-smith ]# pico snmp.conf
find the Disk Check section or add the parameters:
###############################################################################
# disk checks
#
# The agent can check the amount of available disk space, and make
# sure it is above a set limit.
# disk PATH [MIN=DEFDISKMINIMUMSPACE]
#
# PATH: mount path to the disk in question.
# MIN: Disks with space below this value will have the Mib's errorFlag set.
# Default value = DEFDISKMINIMUMSPACE.
# Check the / partition and make sure it contains at least 10 megs.
disk / 10000
disk /boot 10000
###############################################################################
Make sure to specify existing mounts. Press CTRL-X, Y , to save when complete. Your mounts can bee found by executing the mount command:
You then need to restart the snmp deamon to enable the new parameters.
[root@e-smith ]# service snmpd restart
You now need to create MRTG config files for your CPU and Disk.
[root@e-smith ]# cd /etc/mrtg
[root@e-smith ]# pico system.cfg
Now inserts the following text and press CTRL-X, Y, to save.
workdir: /home/e-smith/files/ibya/mrtg/html/system
Interval: 5
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[kontor.cpu]: ssCpuRawUser.0&ssCpuRawIdle.0:public@localhost
RouterUptime[kontor.cpu]: public@localhost
MaxBytes[kontor.cpu]: 100
Title[kontor.cpu]: CPU LOAD
PageTop[kontor.cpu]: <H1>User CPU Load %</H1>
Unscaled[kontor.cpu]: ymwd
ShortLegend[kontor.cpu]: %
YLegend[kontor.cpu]: CPU Utilization
Legend1[kontor.cpu]: User CPU in % (Load)
Legend2[kontor.cpu]: Idle CPU in % (Load)
#Legend3[kontor.cpu]:
#Legend4[kontor.cpu]:
LegendI[kontor.cpu]: User
LegendO[kontor.cpu]: Idle
Options[kontor.cpu]: growright,nopercent
Target[kontor.cpusum]:ssCpuRawUser.0&ssCpuRawUser.0:public@localhost + ssCpuRawSystem.0&ssCpuRawSystem.0:public@localhost + ssCpuRawNice.0&ssCpuRawNice.0:public@localhost
RouterUptime[kontor.cpusum]: public@localhost
MaxBytes[kontor.cpusum]: 100
Title[kontor.cpusum]: CPU LOAD
PageTop[kontor.cpusum]: <H1>Active CPU Load %</H1>
Unscaled[kontor.cpusum]: ymwd
ShortLegend[kontor.cpusum]: %
YLegend[kontor.cpusum]: CPU Utilization
Legend1[kontor.cpusum]: Active CPU in % (Load)
Legend2[kontor.cpusum]:
Legend3[kontor.cpusum]:
Legend4[kontor.cpusum]:
LegendI[kontor.cpusum]: Active
LegendO[kontor.cpusum]:
Options[kontor.cpusum]: growright,nopercent
Target[kontor.root]:dskPercent.1&dskPercent.2:public@localhost
RouterUptime[kontor.root]: public@localhost
MaxBytes[kontor.root]: 100
Title[kontor.root]: Disk Usage on Server
PageTop[kontor.root]: <H1>Root and Boot Disk Usage %</H1>
Unscaled[kontor.root]: ymwd
ShortLegend[kontor.root]: %
YLegend[kontor.root]: Disk Utilization
Legend1[kontor.root]: Root disk
Legend2[kontor.root]: Boot disk:
Legend3[kontor.root]:
Legend4[kontor.root]:
LegendI[kontor.root]: Root disk:
LegendO[kontor.root]: Boot disk:
Options[kontor.root]: growright,gauge,nopercent
Now we just need to make sure this new MRTG config file is run every 5 minutes.
[root@e-smith ]# pico all-ip
Insert the following line in the bottom and press CTRL-X, Y, to save:
/usr/bin/mrtg /etc/mrtg/system.cfg;
6) Now wait 5 minutes and then try to look at
http://server.domain.com/mrtg/systemr
An example of MRTG can be seen here
How to Install AWStats Web Statistics
There are two way of doing this. The first and absolutely most easy way is to use the RPM developed by Neddix. They have a version of AWStats 4.0 as well as AWStats 5.3 installation which is only accesses via the Server Manager.
Description and the RPM for this can be found at: http://www.neddix.de. The AWStats 5.3 version can also be found in my download section.
If you want to install in a Ibay and spend the time configuring your self then do the following.
1) First create an ibay with the name "awstats":
Information bay name: awstats
Description: AWStats Web Statistics
Group: everyone
User access: Write=group, Read=everyone
Public access: (As you like it)
Execution of dynamic content: enabled
2) Download the latest AWStats from awstats.Sourceforge.net (http://awstats.sourceforge.net/files/awstats.zip)
3) Now you have to move the content of cgi-bin directory (wwwroot/cgi-bin) inside the ZIP file into the cgi-bin directory in the AWStats ibay
4) Now you have to move icon directory (wwwroot/icon) inside the ZIP file into the html directory in the AWStats ibay. The icon directory with content should be a sub-dir inside the HTML directory.
5) Now move the content of the tools directory inside the ZIP file into the cgi-bin directory in the AWStats ibay
You now have to configure AWStats.
6) Inside the cgi-bin directory in the awstats Ibay now need to make a copy of the awstats.model.conf file where you replace the "model" with the domain name that you want to get statistics for.
ex. (from Windows/Dos)
C:\>copy awstats.model.conf awstats.www.yourdomain.com.conf
7) Now you have to edit the new .conf file with you favorite editor. Make sure to change the following parameters:
LogFile="/var/log/httpd/access_log"
LogFormat="%virtualname %host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
DNSLookup=1
DirCgi="/awstats/cgi-bin"
DirIcons="/awstats/icon"
SiteDomain="www.yourdomain.com" changed to your domain name.
HostAliases="www.yourdomain.com yourdomain.com localhost 127.0.0.1" changed to your domain name.
AllowToUpdateStatsFromBrowser=1
UseFramesWhenCGI=1 (optional)
8) Now make sure the the awstats.pl file is an executable. Go to the cgi-bin directory and issue the following command.
[root@e-smith ]# chmod 755 awstats.pl
9) use you favorite browser and open the URL:
http://www.yourdomain.com/awstats/cgi-bin/awstats.pl
10) Remember to press the Update button and enjoy the stats.
How
to Install NetJuke for SME Server v. 5.5
(with contribution from Michael Smith)
Why Netjuke? Why not simply stick with the
MP3 Jukebox blade? Well, the Jukebox blade is great but it's slow on older
server hardware and it requires a lot of thought in planning your directory
structure. Netjuke uses a real, live MySQL database to store music info, so you
can access your entire music collection by artist, track title, album title,
genre -- or a random selection from any and all of the above.
The Netjuke home page:
http://netjuke.sourceforge.net
first create a MySQL database for netjuke
[root@e-smith
]# mysqladmin create netjuke
[root@e-smith ]# mysql --user=root mysql
mysql>GRANT ALL ON netjuke.* TO netjuke@localhost IDENTIFIED BY 'netjukepassword';
mysql>flush privileges;
mysql>quit
Then create an ibay from the server manager:
Information bay name: netjuke
Description: networked jukebox
Group: everyone
User access: Write=group, Read=everyone
Public access: (As you like it)
Execution of dynamic content: enabled
I recommend not setting a password on this ibay.
From the console or shell prompt (note that you should be able to copy &
paste the commands if using SSH or PuTTY): Please make sure to get the latest
version of netjuke from sourceforge.net
[root@e-smith
]# cd /home/e-smith/files/ibays/netjuke
[root@e-smith
]# wget http://cesnet.dl.sourceforge.net/sourceforge/netjuke/netjuke-1.0b16-php4.1+.tar.gz
[root@e-smith
]# tar -xvzf netjuke-1.0b16-php4.1+.tar.gz
This will unzip all files into a subfolder called "netjuke". What we
have to do now is move the contents of THAT folder into the ibay's
"html" folder. Note that the "mv" command is "mv (space)(STAR)(space)(DOT)(DOT)(SLASH)html(SLASH)"
which translates to "move everything, including subfolders, from THIS
folder into the html folder, one level down from the parent folder of the
current folder (thus the "dot dot").
[root@e-smith
]# cd /home/e-smith/files/ibays/netjuke/netjuke
[root@e-smith
]# mv * ../html/
Check to see that you can access the "netjuke" ibay from your network.
If you cannot, you have a login name/password problem.
Now we're ready to run the scripts. The next step is from a web browser:
http://(YOUR SME SERVER)/netjuke/installer/installer.php
You will be asked for the name of the netjuke database you created, user, and
password. You must also set up an admin login & password.
This will generate & offer to download a file named "installer.php",
which you should save as "inc-prefs.php". For a reason I don't know, I
was unable to save it directly into the location it needs to be in, namely, the
"etc" folder under the "html" folder in the netjuke ibay. So
I saved it into the "html" folder, which I was able to access easily
via Network Neighborhood, then used the Linux "mv" command from the
console to move inc-prefs.php to the etc. folder, like so:
[root@e-smith
]# cd /home/e-smith/files/ibays/netjuke/html
[root@e-smith
]# mv inc-prefs7.php ./etc/
(Note the SINGLE dot in that command, rather than the double dot.)
[root@e-smith
]# cd /home/e-smith/files/ibays/netjuke/html/var
[root@e-smith
]# chmod -R 777 data
[root@e-smith
]# chmod -R 777 music
[root@e-smith
]# cd /home/e-smith/files/ibays/netjuke/html/etc
[root@e-smith
]# chmod 777 inc-prefs.php
I also deleted the index.html file from the netjuke ibay, so I wouldn't get the
default SME page if I neglected to specify "index.php" when logging in
to the jukebox. And per Daury's documentation, I also deleted the
"installer" directory for better security. WATCH OUT here as the
"rm -rf" command is a good candidate for the most destructive command
in Linux! If you were to do "rm -rf *" from the root of your
filesystem you would destroy everything!
[root@e-smith
]# cd /home/e-smith/files/ibays/netjuke/html
[root@e-smith
]# rm -rf index.html
[root@e-smith
]# rm -rf installer
Now you should be able to return to your web browser and access your new Netjuke
setup with the following URL:
http://(YOUR SME SERVER)/netjuke
Use the Admin function to customize. I set my Security Mode to 0.1 so I could
login from anywhere but no one could create a user.
Now load some music: everything goes in /home/e-smith/files/ibays/netjuke/html/var/music
Once you've loaded some music, it's time to tell Netjuke what it is. Use the
"Recursive File Finder"; it will go through all your music files and
extract whatever information it can from ID3 tags on MP3 files.
Go back to "Browse" and enjoy.
SME 5.5U2
[root@e-smith ]# rpm -Uvh http://sme.swerts-knudsen.dk/downloads/e-smith-fetchmail-0.3-4.noarch.rpm
SME 5.6
[root@e-smith ]# rpm -Uvh http://sme.swerts-knudsen.dk/downloads/sme-upgppp-1.0-1.noarch.rpm
[root@e-smith ]# rpm -Uvh http://sme.swerts-knudsen.dk/downloads/sme-fetchmail-1.0-2.noarch.rpm
From the e-smith manager in the "E-mail retrival" set the retrival mode to "multi-drop". Make sure to change the secondary mail server to a valid address (suggestion: type your own host name). Configure the check interval and then go to the "Mail Users" section in the server manager main menu. Choose "Individual mailbox" and configure the POP3 name, username and password.
If
you want to ftp to an Ibay you need to use the ibay name not user name e.g ftp://svensvin@swerts-knudsen.dk
you will need to create a custom template
[root@e-smith
]# mkdir /etc/e-smith/templates-custom/etc/proftpd.conf
[root@e-smith ]# pico /etc/e-smith/templates-custom/etc/proftpd.conf/60AnonymousIBay
copy and paste this into it:
{
#------------------------------------------------------------
# How to handle logins from information bay accounts: chroot to the
# files part of the information bay directory.
#------------------------------------------------------------
my %accounts;
tie %accounts, 'esmith::config', '/home/e-smith/accounts';
my $key;
my $value;
$OUT .= "";
while (($key,$value) = each %accounts)
{
my ($type, %properties) = split (/\|/, $value, -1);
if ($type eq 'ibay')
{
#------------------------------------------------------------
# Figure out which combination of parameters to use. If
# PublicAccess parameter is present, this is e-smith 4.0.
# Otherwise, it's e-smith 3.0.
#------------------------------------------------------------
my $allow;
my $pass;
if ($properties{'PublicAccess'})
{
if ($properties{'PublicAccess'} eq 'none')
{
$allow = "127.0.0.1";
$pass = 1;
}
elsif ($properties{'PublicAccess'} eq 'local')
{
$allow = $localAccess;
$pass = 0;
}
elsif ($properties{'PublicAccess'} eq 'local-pw')
{
$allow = $localAccess;
$pass = 1;
}
elsif ($properties{'PublicAccess'} eq 'global')
{
$allow = 'all';
$pass = 0;
}
elsif ($properties{'PublicAccess'} eq 'global-pw')
{
$allow = 'all';
$pass = 1;
}
elsif ($properties{'PublicAccess'} eq 'global-pw-remote')
{
$allow = 'all';
$pass = 1;
}
}
elsif ($properties {'ReadAccess'} eq 'global')
{
if ($properties {'UsePassword'} eq 'yes')
{
$allow = 'all';
$pass = 1;
}
else
{
$allow = 'all';
$pass = 0;
}
}
else
{
if ($properties {'UsePassword'} eq 'yes')
{
$allow = $localAccess;
$pass = 1;
}
else
{
$allow = $localAccess;
$pass = 0;
}
}
# variables: $allow (IP), $pass (bool)
$OUT .= "\n";
$OUT .= "<Anonymous /home/e-smith/files/ibays/$key/>\n";
$OUT .= " User $key\n";
$OUT .= " Group $key\n";
$OUT .= " AnonRequirePassword " . ($pass ? "on" :
"off") . "\n";
$OUT .= " UseFtpUsers on\n";
$OUT .= " MaxClients 10\n";
$OUT .= " DisplayLogin welcome.msg\n";
$OUT .= " DisplayFirstChdir .message\n";
$OUT .= " <Limit LOGIN>\n";
$OUT .= " Order Allow,Deny\n";
$OUT .= " Allow from $allow\n";
$OUT .= " Deny from all\n";
$OUT .= " </Limit>\n";
$OUT .= " <Directory *>\n";
$OUT .= " <Limit WRITE>\n";
$OUT .= " AllowAll\n";
$OUT .= " </Limit>\n";
$OUT .= " </Directory>\n";
$OUT .= "</Anonymous>\n";
}
}
}
Crtl x to save
yes
Enter
now expand the template
[root@e-smith
]# /sbin/e-smith/expand-template /etc/proftpd.conf
That should allow your user to access all folders in a ibay.
If access is only required for the html
directory then you could replace the line that says
$OUT .= "<Anonymous /home/e-smith/files/ibays/$key/>\n";
with
$OUT .= "<Anonymous /home/e-smith/files/ibays/$key/html>\n";
How to install PhpSysInfo in an IBay
(contributed by Martin Elhøj)
1) create a <new> ibay using the server-manager
2) download the latest PhpSysInfo version from http://sourceforge.net/projects/phpsysinfo/ into the newly created ibay. If you are using version 2.1 then issue the following commands:
[root@e-smith ]# cd /home/e-smith/files/ibay/<new>/html
[root@e-smith ]# wget http://belnet.dl.sourceforge.net/sourceforge/phpsysinfo/phpSysInfo-2.1.tar.gz
[root@e-smith ]# tar -zxvf phpSysInfo-2.1.tar.gz
A new directory will be created (phpsysinfo-2.1) where an index.php is located.
3) enable the PHP script to access the /proc directory (where all the fun is...)
[root@e-smith ]# /sbin/e-smith/db accounts setprop <new> PHPBaseDir /home/e-smith/files/ibays/<new>/:/proc
[root@e-smith ]# /sbin/e-smith/signal-event ibay-modify <new>
4) try it out... (http://your.domain.com/<new>/phpsysinfo-2.1/index.php)
An example of PhpSysInfo can be seen here
How to Install a simple system monitor
This module provides a system monitor accessible from the Server Manager. You can monitor the CPU, RAM, Interface and Disk.
From the command line type:
[root@e-smith ]# rpm -ivh http://www.shiloh.stclair.k12.il.us/bk/esmith/monitor/e-smith-monitor_en-2.1-01.noarch.rpm
How to Install Gallery 1.3.3 in an Ibay on SME 5.5
(Heavily
based on a HowTo
by Dan Brown)
First
Install the following RPMs
[root@e-smith
]# rpm
–Uvh ftp://rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/libtiff-3.5.5-13.i386.rpm
[root@e-smith
]# rpm
–Uvh ftp://rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/netpbm-9.14-2.i386.rpm
[root@e-smith
]# rpm
–Uvh ftp://rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/netpbm-progs-9.14-2.i386.rpm
Now
install the jhead binary
[root@e-smith
]# cd
/usr/bin
[root@e-smith
bin]# wget
http://www.sentex.net/~mwandel/jhead/jhead
[root@e-smith
bin]# chmod a+x /usr/bin/jhead
Now
you're just about ready to install and configure Gallery. First, you'll
need to create an Ibay in which Gallery should be installed.
Information
bay name: gallery
Description: Networked Picture Gallery
Group: everyone
User access: Write=group, Read=everyone
Public access: (As you like it)
Execution of dynamic content: enabled
Now
you're ready to install Gallery itself. Run these commands to prepare the
gallery system:
[root@e-smith
]# cd /home/e-smith/files/ibays/gallery/
[root@e-smith
gallery]# wget http://cesnet.dl.sourceforge.net/sourceforge/gallery/gallery-1.3.3.tar.gz
[root@e-smith
gallery]# tar zxf gallery-1.3.3.tar.gz
[root@e-smith
gallery]# cd gallery
[root@e-smith
gallery]# mv * ../html
[root@e-smith
gallery]# cd ..
[root@e-smith
gallery]# rm -f gallery-1.3.3.tar.gz
[root@e-smith
gallery]# rmdir gallery
[root@e-smith
gallery]# cd html
[root@e-smith
html]# mkdir albums
[root@e-smith
html]# mkdir temp
[root@e-smith html]#
chown -R www:www .
[root@e-smith
html]# chown
-R www temp
[root@e-smith
html]# rm –f index.html
[root@e-smith html]#
sh configure.sh
Now
allow Gallery to use the jhead from the/usr/bin directory
[root@e-smith
html]# /sbin/e-smith/db
accounts setprop gallery PHPBaseDir /home/e-smith/files/ibays/gallery/:/usr/bin
[root@e-smith
html]# /sbin/e-smith/signal-event
ibay-modify gallery
Now point your favorite web browser to http://yourhost.yourdomain/gallery/setup. Go ahead and click the "Configure Gallery" button at the bottom of this page.
On the next page, there are a few items you'll need to enter. First is the admin password; you may set this to anything you like. Other things that need setting:
Album
directory: /home/e-smith/files/ibays/gallery/html/albums
Albums URL: http://yourhost.yourdomain/gallery/albums
Temporary directory: /home/e-smith/files/ibays/gallery/html/temp
The rest of the defaults should be fine. Click on the "Album Defaults " button to proceed to the next screen when you can either configure or press “Save Settings”. At this screen, if there are any errors, they will appear in red text. If there's no red, scroll down to the bottom of the page and click on "Save Config". At this point, your configuration is complete. Return to the console (or telnet/ssh app) and do
[root@e-smith html]# sh secure.sh
You're done! Point your browser to http://yourhost.yourdomain/gallery, log in as "admin" with the admin password you chose previously, and create some galleries. Upload some pictures. Enjoy!