Admin Books

DOWNLOAD Free e-Books for Linux Admin Servers :

CSF Installation on Webmin/Virtualmin


Installation
============
Installation is quite straightforward:

rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

Next, test whether you have the required iptables modules:

perl /etc/csf/csftest.pl

Don't worry if you cannot run all the features, so long as the script doesn't
report any FATAL errors

You should not run any other iptables firewall configuration script. For
example, if you previously used APF+BFD you can remove the combination (which
you will need to do if you have them installed otherwise they will conflict
horribly):

sh /etc/csf/remove_apf_bfd.sh

That's it. You can then configure csf and lfd by edit the files
directly in /etc/csf/*



csf auto-configures your SSH port on installation where it's running on a non-
standard port.

csf auto-whitelists your connected IP address where possible on installation.

You should ensure that kernel logging daemon (klogd) is enabled. Typically, openvz VPS
servers have this disabled and you should check /etc/init.d/syslog and make
sure that any klogd lines are not commented out. If you change the file,
remember to restart syslog. Read This : http://linux-server-admin.blogspot.com/2012/06/syslogd-appears-to-be-running-but-not.html

See the readme.txt file for more information.

Webmin Module Installation/Upgrade
==================================

To install or upgrade the csf webmin module:

Install csf as above
Install the csf webmin module in:
  Webmin > Webmin Configuration > Webmin Modules >
  From local file > /etc/csf/csfwebmin.tgz > Install Module


Uninstallation
==============
Removing csf and lfd is even more simple:

On generic linux servers:

cd /etc/csf
sh uninstall.generic.sh


GD::Graph
=========
This perl module is required for Statistical Graphs available from the csf UI.
It is dependent on garphical libraries being installed for your OS (e.g.
libgd, libpng, etc. which is beyond the scope of this document)

The perl module itself can be installed in a variety of ways, e.g.:

Debian v6:
# apt-get install libgd-graph-perl

Direct from cpan.org:
# perl -MCPAN -e shell
cpan> install GD::Graph

Cheapest VPS Offers RAM >= 512 MB

I am trying to record some VPS Server which affordable at least has 512 MB RAM in their offered VPS package.


http://flipperhost.com/openvz_vps.php :
(I use them for one of my "cheap but enough" rdiff-backup server)
Disk Space : 70 GB
RAM : 768 MB / 1 GB
Traffic : 0.65 TB/Month
Price : $7.99/Month

FlipperHost Promo1 VPS :
Disk Space : 45 GB
Bandwidth : 1.5 TB
Guaranteed RAM : 512 MB
Bursted Ram : 768 MB
Price : $4,99 Per month ---> Order Now


https://www.evolucix.com/clients/cart.php?a=confproduct&i=0 :
Virtual Servers Package Special - Evo1024-LEB
Disk Space: 20 GB
Guaranteed RAM: 1 GB / 1.5 GB
Traffic: 500 GB / month
Price : $6.95/ month




http://123systems.net/vps.html :
Virtual Servers Package Special - Lin-512MB Dallas,TX
Guaranteed RAM: 512 MB/ 1 GB
Disk Space: 20 GB
Traffic: 1TB / month
Price : $6.00/ month


https://hostigation.com/?page=OpenVZ :
Package OVZ-512
RAM : 512/1024 MB
Disk Space : 50 GB
Traffic :1000 GB/month
Price :$6/mo
Order Data Center Location : CLT | LAX
3 letter code denotes airport code for the city VPS will be provided in
Paying a full year makes you eligible for a two month discount.



http://buyvm.net/ or https://my.frantech.ca/cart.php?a=add&pid=47
Virtual Servers Package Special
Guaranteed RAM: 512 MB/ 1 GB
Disk Space: 50 GB
Traffic: 2 TB / month
Price : $5.95/ month
I will consider their $3.5 /month package to be my next backup server of my VPS Server.




https://billing.eoreality.net/cart.php?a=add&pid=216
End Of Reality – $5.75/Month, 1024MB OpenVZ VPS in Chicago, IL
LEB Offer: OpenVZ Professional VPS
RAM : 1 GB RAM
Disk Space : 25GB
Traffic : 1 GB
$5.75/Month
(Promo Code: lowendbox1)
(This, I took this one, after my DirectServer.Net VPS got 2 times data lost and one mass hacking makes me mad)



Disclaimer : No, I do not endorsed by any of them. This Cheapest VPS with at least 512 MB RAM list is strictly just for my note.

Virtualmin/Webmin + CentOS Installing Config Server Firewall (CSF/LFD)


Virtualmin/Webmin + CentOS Installing Config Server Firewall (CSF/LFD)



These are the simple instructions on how to install CSF. You will want to make sure you’ve also installed the perl prerequisites with the following command:

yum  install perl-libwww-perl

You can do this with the following commands:



cd /tmp

wget -c http://www.configserver.com/free/csf.tgz

tar xzf csf.tgz

cd csf

sh install.sh


This will install CSF, but by default, CSF is in “testing” mode, which means that it doesn’t really protect you from anything as it normally would. There are some settings that must be changed before you will want to disable testing mode. Open the file /etc/csf/csf.conf like this:

nano /etc/csf/csf.conf

Find the TCP_IN variable and set it to:

TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,3000:3050,10000"

This will enable all of the default ports that are used on a web server. Now, we will need to find the UDP_IN variable and change it to read:

UDP_OUT = "20,21,53,113,123,33434:33523"

This will allow the use of the “Traceroute” command, without the “33434:33523″, traceroute will not work.

Before you go ahead and change the TESTING variable to 0, I highly recommend reading the entire CSF readme located here: http://configserver.com/free/csf/readme.txt

Like I mentioned, to disable TESTING change the TESTING variable to:

TESTING = "0"

Now you can save the file. Now you’re ready to restart the csf daemon:

service csf restart

To make sure CSF starts on reboot:

chkconfig --level 235 csf on

You’ve successfully configured CSF!

Next, test whether you have the required iptables modules:

perl /etc/csf/csftest.pl
In webmin, follow this route:

Webmin > Webmin Configuration > Webmin Modules >
  From local file >
/etc/csf/csfwebmin.tgz > Install Module
 
  If you've installed the Webmin CSF module - then you can manage your CSF firewall in your browser (via Webmin >> System >> ConfigServer Security & Firewall).

Other than that, the only option I know of is to use the command line.

Add Custom Link To Virtualmin/Webmin Menu

I want to have links on the left side of webmin/virtualmin default theme.
The links I want are link to File Manager and to PHPMyadmin.
File Manager was located in the original webmin menu.
PHPMyadmin , I installed it in the http://vps.mydomain.com/phpmyadmin/.
Also available in secured pages  https://vps.mydomain.com/phpmyadmin/
So I hack the template in /usr/libexec/webmin/virtual-server-theme/left.cgi.

Here is dirtty hack of  How to Add Custom Link To Virtualmin/Webmin Menu :

Edit /usr/libexec/webmin/virtual-server-theme/left.cgi.
Find code block like this :

     # Show list of all systems
    print "<div class='linkwithicon'><img src='images/vm2-small.png' alt=''><b><div class='aftericon'><a href='server-manager/index.cgi' target=right>$text{'left_vm2'}</a></b></div></div>\n";
    }




Right below that block, add several lines of code like this :

#START OF MY CUSTOM LINKS
#added by roy :


print "<div class='linkwithicon'><img src='images/vm2-small.png' alt=''>\n";
print "<div class='aftericon'><a target=right href='/file/'>File Manager</a></div></div>\n";

print "<div class='linkwithicon'><img src='images/vm2-small.png' alt=''>\n";
print "<div class='aftericon'><a target=_blank href='http://";
print "$ENV{'SERVER_NAME'}";
print "/phpmyadmin/'>PHPMyadmin</a> ";

print "<a target=_blank href='https://";
print "$ENV{'SERVER_NAME'}";
print "/
phpmyadmin/'>(https)</a>";

print "</div></div>\n";

#END OF MY CUSTOM LINKS


Then save the left.cgi and refresh webmin/virtualmin page. Customize your code if you want to add other links. Make sure you edit the right theme. Mine , I use default installation  theme called virtual-server-theme.