Monday, October 3, 2016
Bootable Windows with Ubuntu
Wednesday, September 14, 2016
Virtual Statistics Laboratory
Starting from a less popular software-based non-commercial one R among practitioners of statistics, Statistics Virtual Laboratory designed with toolkits based R-shiny, to create a web-GUI interfaces. With the aim of using visualization R without having to master the language R, because communication with the user can be done through a web friendly.
Professor of Statistics Prof. I Made Tirta create web content form of a tutorial / handouts / lecture notes electronically simulated illustrations presented directly by R. document that is therein, also includes mathematical notation correctly through the ability LaTeX on MathJax. By using server-based Ubuntu Server and apply the r-shiny therein made interactive web makes it not only learn but also to give it a try.
As I wrote earlier about building R-Shiny local computer, Virtual Laboratory Statistics is a continuation and development of the HTML for ease of application. Added also the application of Latex and MathJax through the Java language. Visitors can learn about a wide range of simulation are: Probability Freq, Mean Distributions and Normal Distribution. Demo also many show started Basic Statistics, Simple Regression, Cluster Analysis to RGraphics.
Statistics Virtual Laboratory glance similar to R-cloud that has been there, but the advantage is visitors no longer need to learn to use the language R. All the facilities have been provided and have been programmed in it are also still using the R language is always complete with the package - a package terupdatenya , As we used to know and use R-Commander, this is more interactive and web-based major has. Where and whenever can be used easily and learning becomes simple.
Tuesday, December 30, 2014
Joomla jos_session problem
DROP TABLE IF EXISTS `jos_session`;
CREATE TABLE IF NOT EXISTS `jos_session` ( `username` varchar (150) default '', `time` varchar (14) default '', `session_id` varchar (200) NOT NULL default '0', `guest` tinyint (4) default '1', userid` `int (11) default '0', `usertype` varchar (50) default '', `gid` tinyint (3) unsigned NOT NULL default '0', `client_id` tinyint (3) unsigned NOT NULL default '0', `data` LONGTEXT, PRIMARY KEY (`session_id` (64)), KEY `whosonline` (guest``, `usertype`), KEY `userid` (` userid`), KEY `time` (` time`) ) ENGINE = MyISAM DEFAULT charset = utf8;
function insert ($ sessionId, $ ClientID)2. Edit the file /index.php
{ $ url = 'http: //'.$_SERVER [' SERVER_NAME ']. $ _ SERVER [' REQUEST_URI '];
$ this-> session_id = $ sessionId; $ this-> client_id = $ ClientID; $ this-> time = time ();
if ($ this-> guest! = 1 || stristr ($ url, '/ administrator')) $ ret = $ this -> _ db-> insertObject ($ this -> _ tbl, $ this, 'session_id');
if (! $ ret && $ this-> guest! = 1) { $ this-> setError (strtolower (get_class ($ this)). "::". JText :: _ ('store failed'). "
". $ this -> _ db-> stderr ()); return false; } else { return true; } }
/ ** * CREATE THE APPLICATION * * NOTE: * / $ mainframe = & JFactory :: getApplication ('site');Change to:
$ mainframe = & JFactory :: getApplication ('site', array ('session' => false));
And the last is the patience and prayer to overcome the problem. Read More
Thursday, September 4, 2014
MySQL: Too Many Connection Error
Too Many Connection occurs because of some problems like this: too many connections that occur simultaneously, often experienced by these sites that weve crowded. packet flooding defect occurs to the port that MySQL is used, this can be tested by doing a telnet to 3306 too many connections are already obsolete, but not in the release or in-free
For the first cause, which occurs because the force is due to conditions that occur simultaneous connections. To solve this problem is to tweak the mysql configuration file (my.ini or my.cnf) and increase the value of the max_connections variable. Default variable values 100 For websites that crowded, maybe less default settings. Or it could be another way to dispose of or give a # at the max_connections variable.
For the second cause, there are many defects in the pool MySQL package, how to fix this is to do mysqladmin flush using the tools. make a batch-script that contents mysqladmin flush-hosts then attach a handler in the web server or on a desktop program (adjust with the environment) if you find an error in MySQL engines with error code SQLSTATE = 08S01 (for server-related error bad packet) or 46000 (to a server error relating to that connection)
For the third cause, too many connections that are already obsolete, but not in the release or in the free, this is a coding issue. Code that is not good, it will leave a lot of junk in the cache server. For the coder, may know how to connect to the DBMS, whether by way of persistent-connection or non-persistent. What is gained if you have too many connection, he replied restart the server. But if we understand the 3 terms above may be a bit inevitable. I HOPE
Friday, June 13, 2014
Internal Error Ubuntu 12.04
![]() |
| internal error message |
In ubuntu discussion this time is about error messages that often appear in the ubuntu desktop. Ubuntu users must have got the message as shown above
There is a suggestion that this feature remains enabled, but not one as well to know a simple way to disable this feature.
1. Open a terminal or console (ctrl + alt + t)
2. Use any editor (gedit, vim, pico, nano) in this case I use vim sudo vim /etc/default/apport
3. At the line enabled = 0 to disable the content parameters, while 1 to re-activate.
![]() |
| vim editor to open apport |
May be useful for us all
Wednesday, June 4, 2014
Ubuntu 14.04 Upgrade HowTo
1. Perform backups of your important data. Can save to another partition on the computer or storage media which you have.
2. Ensure release of Ubuntu you type the following command in the shell (to simplify the example I give a command shell and as root)
root@yoyok:~# uname -mrsthe result are
root@yoyok:~# lsb_release -a
Linux 3.2.0-51-generic x86_64 No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.4 LTS Release: 12.04 Codename: precise
yyp@yoyok:~# sudo apt-get update
yyp@yoyok:~# sudo apt-get install update-manager-core
yyp@yoyok:~# sudo do-release-upgrade
4. Fixing and forcing upgrade You may end up getting the following message on screen when you run sudo do-release-upgrade
Checking for a new Ubuntu release No new release foundTo force upgrade pass the -d option to sudo do-release-upgrade command:
yyp@yoyok:~# sudo do-release-upgrade -d5. Reboot the desktop or server Reboot the system
yyp@yoyok:~# sudo rebootVerify, your new settings:
root@yoyok:~# lsb_release -aRead More
root@yoyok:~# uname -mrs
Friday, May 30, 2014
Ubuntu 14.04 Trusty Tahr, What's new in this LTS
It's no secret since the Ubuntu Unity interface wear, they got a lot of criticism and problems. Unity itself becomes an interface defaut Ubuntu since 2011, the previous default Ubuntu is a Gnome interface. Ubuntu Unity, now much more refined and has better performance and faster. Perhaps there are still some less than perfect, but not too flashy. At 14.04 LTS Ubuntu Unity, Compiz plugins already replaced the same decor GTK3 CSS themed window decoration. GTK3 resize has better speed and anti-alias feature in every corner of the corner of the window. Top panel also already be in the right click option that will give you the option for minimize, unmaximize, set the window always on top. As a whole may not be too different from the previous edition. For systems in which there is a slightly different way of setting APT sources.list, in this edition source.lst been grouped by mirrors to be addressed. As for the disadvantages, there are some applications that are not available in this edition. But as a whole the same flavor and a little different.
Thursday, January 17, 2013
Asus X201E Ubuntu 12.04 ( Function Keys )
I recently bought asus notebook X201e some time ago. Since I am a fans of Ubuntu, I just installed Ubuntu LTS 12.04, I chose it because the support of the old and very easy to use. Once installed, there are several issues that arise are the function keys are not used. By doing the test a few pointers on google, finally I got the solution and it can work well.
sudo vim /etc/apt/sources.list
Then update and install the kernel:deb http://security.ubuntu.com/ubuntu quantal-security main universe restricted multiverse deb-src http://security.ubuntu.com/ubuntu quantal-security main universe restricted multiverse deb http://archive.ubuntu.com/ubuntu/ quantal-updates main universe restricted multiverse deb-src http://archive.ubuntu.com/ubuntu/ quantal-updates main universe restricted multiverse deb http://archive.ubuntu.com/ubuntu/ quantal main universe restricted multiverse deb-src http://archive.ubuntu.com/ubuntu/ quantal main universe restricted multiverse
For PAE kernel (for intel i386 with more than 4GB RAM) :sudo apt-get update sudo apt-get install linux
After that reboot: sudo reboot. Yessss !!!! ..., successfully. The volume setting can walk normally again, as well as wireless and others. But the Fn key for brightness is still not running. After dabbling again, This could be fixed by editing the /etc/default/grub file and changing the line "GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to "GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=". After running "sudo update-grub" in the terminal and rebooting, the keys were working again. And some functions in ASUS X201E worked. Good Luck Read Moresudo apt-get install linux-generic-pae
Wednesday, October 17, 2012
FreeTDS MYSQL MSSQL PHP
My post this time about the experience of using the connector from MYSQL ubuntu server to MSSQL the course of microsoft. The goal is to read data from MSSQL database using PHP commands in a project I was working on. The first one is the installation of freetds package ubuntu package, by typing the command:
sudo apt-get install freetds-common freetds-bin unixodbc php5-sybase
sudo vim /etc/freetds/freetds.conf then add some few lines at the bottom of the file:
sudo /etc/init.d/apache2 restart
<? php
$ link = mssql_connect ('yourserver', 'yourusername', 'yourpassword');
if (!$link) { die ('Unable to connect!'); }
if (!mssql_select_db ('yourdatabasename', $ link))
{ die ('Unable to select database'); }
$result = mssql_query ('SELECT * FROM yourtable');
while ($row=mssql_fetch_array ($ result)) { var_dump ($ row); }
mssql_free_result ($ result);
?>
Mysql database result has been able to read the data on MSSQL database. Furthermore, good luck, good luck
Thursday, October 20, 2011
Ubuntu 11.10 (Oneiric Ocelot)
Has been released yesterday, this edition includes the Ubuntu desktop, server, cloud, Kubuntu, Xubuntu, Lubuntu, Edubuntu, Mythbuntu, and Ubuntu Studio. Not too much difference with the previous edition 11.04 / Natty, just adding a few additional applications one of them: Deja DUP for backing up data.
Merger unity and compiz is a different side view of its predecessor, the login screen is also another. But as a whole can be spelled similar to the previous edition.
Because similar to the reply already installed, I just try and then delete it because of who got the laptop says "what is windows 8?"
Even more fun is waiting for 12.04 Ubuntu LTS (Precise pangolin) which is planned to release on April 26 next year (I think it's what Precise, was an anteater). 10.04 Maybe it could replace the LTS as well, because according to its developers this is a tough, durable and a little bug.
Good luck to those interested:
http://releases.ubuntu.com/11.10/ (Ubuntu, Ubuntu Server)
http://cloud-images.ubuntu.com/releases/11.10/ (Ubuntu Cloud Images)
http://cdimage.ubuntu.com/releases/11.10/ (Ubuntu DVD, preinstalled ARM images, source)
http://cdimage.ubuntu.com/netboot/11.10/ (Ubuntu Netboot)
http://releases.ubuntu.com/kubuntu/11.10/ (Kubuntu)
http://cdimage.ubuntu.com/kubuntu/releases/11.10/ (Kubuntu DVD)
http://cdimage.ubuntu.com/xubuntu/releases/11.10/ (Xubuntu)
http://cdimage.ubuntu.com/edubuntu/releases/11.10/ (Edubuntu)
http://cdimage.ubuntu.com/ubuntustudio/releases/11.10/ (Ubuntu Studio)
http://cdimage.ubuntu.com/mythbuntu/releases/11.10/ (Mythbuntu)
http://cdimage.ubuntu.com/lubuntu/releases/11.10/ (Lubuntu)
Read More
Monday, May 9, 2011
Ubuntu 11.04 Natty Narwhal Review

After waiting many months, the latest ubuntu release has been published a few weeks ago. What and how the performance of the Natty this.
Here's the latest test release ubuntu 11:04 uses several different hardware. Incidentally kompeter could borrow from friends and laptop to have someone (only intel, amd who do not have the love and loans)
1. Booting requires only 50-10 seconds (I3 processors or more)
booting requires 10-30 (under the dual cores, or netbook)
2. Desktop look a little different than previous releases, since it uses unity ubuntu 11:04.
glance for Apple users if somewhat similar, because the application is on the left desktop.
3. In the latest Ubuntu, there are some applications that change, which is very striking is that Open Office is no longer a default install of ubuntu. His replacement is the Libre Office, but its user exactly like other office applications like openoffice and microsoft office. Separate also is gimp, applications for the designer is also already there when the installation is not automatic, but we can still download through the application sypnatic or via terminal (apt-get install)
4. Browser Mozilla Firefox on ubuntu still, what a coincidence when released yesterday, also firefox has just launched its latest version. To support the performance of Ubuntu users. The latest version of Firefox has become the default browser on this Natty.
5. Natty is the latest breakthrough in cloud computing. If you want to store data in the cloud of ubuntu, ubuntu just use one application. This application is suitable for users who are super mobile.
So Ubuntu Natty review, we wait for the latest terobasan in the next Ubuntu release Oneiric Ocelot 11:10
Read More
Friday, May 6, 2011
Downgrade PHP 5.3 to PHP 5.2 Ubuntu Lucid Server
This process is required at the server system does not match the needs of bcompiler to perform the randomization code in PHP. Discussion will I show is using Ubuntu Lucid Server.
The following process steps downgrade:
1. Check what PHP packages are installed on the server, then list to be removed from the system. To do this use the command: dpkg-l | grep php
yoyok@yoyok-desktop:~$ dpkg -l | grep php
will appear like this:
ii libapache2-mod-php5 5.3.2-0ubuntu1 server-side, HTML-embedded scripting languag
ii php-pear 5.3.2-0ubuntu1 PEAR - PHP Extension and Application Reposit
ii php5-cgi 5.3.2-0ubuntu1 server-side, HTML-embedded scripting languag
ii php5-cli 5.3.2-0ubuntu1 command-line interpreter for the php5 script
ii php5-common 5.3.2-0ubuntu1 Common files for packages built from the php
ii php5-dev 5.3.2-0ubuntu1 Files for PHP5 module development
ii php5-gd 5.3.2-0ubuntu1 GD module for php5
rc php5-mcrypt 5.3.2-0ubuntu1 MCrypt module for php5
ii php5-mysql 5.3.2-0ubuntu1 MySQL module for php5
ii php5-sqlite 5.3.2-0ubuntu1 SQLite module for php5
2. Prepare a PHP packages that will diremove
yoyok@yoyok-desktop:~$ dpkg -l | grep php | awk '{print $2}'
results:
libapache2-mod-php5
php-pear
php5-cgi
php5-cli
php5-common
php5-dev
php5-gd
php5-mcrypt
php5-mysql
php5-sqlite
3. Remove the php package with the command:
yoyok@yoyok-desktop:~$ sudo apt-get remove libapache2-mod-php5
php-pear php5-cgi php5-cli php5-common php5-dev php5-gd php5-mcrypt php5-mysql php5-sqlite
4. After the successful, add the karmic repository in /etc/apt/sources.list, for ease of use this command:
yoyok@yoyok-desktop:~$ sed s/lucid/karmic/g /etc/apt/sources.list | tee /etc/apt/sources.list.d/karmic.list
5. Then, create a pin whose function is to hold for package PHP will not be upgraded to Lucid again, Create a file called php which is stored in the folder /etc/apt/preferences.d/, whose contents are as follows:
Package: libapache2-mod-php5
Pin: release a=karmic
Pin-Priority: 991
Package: php-pear
Pin: release a=karmic
Pin-Priority: 991
Package: php5-cgi
Pin: release a=karmic
Pin-Priority: 991
Package: php5-cli
Pin: release a=karmic
Pin-Priority: 991
Package: php5-common
Pin: release a=karmic
Pin-Priority: 991
Package: php5-dev
Pin: release a=karmic
Pin-Priority: 991
Package: php5-gd
Pin: release a=karmic
Pin-Priority: 991
Package: php5-mcrypt
Pin: release a=karmic
Pin-Priority: 991
Package: php5-mysql
Pin: release a=karmic
Pin-Priority: 991
Package: php5-sqlite
Pin: release a=karmic
Pin-Priority: 991
6. Do the updates and install the package php
yoyok@yoyok-desktop:~$ sudo apt-get update
yoyok@yoyok-desktop:~$ sudo apt-get install libapache2-mod-php5
php-pear php5-cgi php5-cli php5-common php5-dev php5-gd php5-mcrypt php5-mysql php5-sqlite
7. When finished do check the package php (php 5.2) with the command dpkg-l | grep php. result like this:
ii libapache2-mod-php5 5.2.10.dfsg.1-2ubuntu6.4 server-side, HTML-embedded scripting languag
ii php-pear 5.2.10.dfsg.1-2ubuntu6.4 PEAR - PHP Extension and Application Reposit
ii php5-cgi 5.2.10.dfsg.1-2ubuntu6.4 server-side, HTML-embedded scripting languag
ii php5-cli 5.2.10.dfsg.1-2ubuntu6.4 command-line interpreter for the php5 script
ii php5-common 5.2.10.dfsg.1-2ubuntu6.4 Common files for packages built from the php
ii php5-dev 5.2.10.dfsg.1-2ubuntu6.4 Files for PHP5 module development
ii php5-gd 5.2.10.dfsg.1-2ubuntu6.4 GD module for php5
rc php5-mcrypt 5.2.6-0ubuntu2 MCrypt module for php5
ii php5-mysql 5.2.10.dfsg.1-2ubuntu6.4 MySQL module for php5
ii php5-sqlite 5.2.10.dfsg.1-2ubuntu6.4 SQLite module for php5
So now the downgrade of package php 5.3 to 5.2 successfully Read More
Thursday, April 14, 2011
PHP and Javascript Autocomplete Search
Starting from the case when the search data using a key word table in a MySQL database. Search results can be done in several ways, but the accuracy and convenience take precedence. What is desired is to enter one character per word, it will display the results of database queries associated with that character.
Suppose we look for the word or the name of someone in a database, simply by memasukkam word Y, then Y is related to the word will be displayed in a list table: Yoyo, Sandy, Bayu and others. Next we discussed the script. In this case the language of php and javascript. Search techniques using javascript function showHint.
<head>
<script type="text/javascript">
function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","search1.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<form>
Input Name : <input type="text" onkeyup="showHint(this.value)" size="20" />
</form>
<p><span id="txtHint"></span></p>
Save the script above with the name of search.php. Next create another php file with the name search1.php to invoke a MySQL database (database query) based on input from the file search.php
if (isset($_GET[q])) {
//load database from php
include ('../config/db_connect.php');
$q=$_GET["q"];
$query = mysql_query("SELECT * FROM staff where name like '%$q%'");
?>
<table bgcolor="#000000" cellspacing="1" cellpadding="3">
<tr bgcolor="#DDDDDD">
<th>ID</th>
<th>Name</th>
</tr>
<? while($row = mysql_fetch_object($query)): ?>
<tr bgcolor="#FFFFFF">
<td><?=$row->ID?></a></td>
<td><?=$row->name?></td>
</tr>
<? endwhile; ?>
</table>
<? }
So hopefully can help
Read More
Tuesday, January 25, 2011
How to quickly and easily download youtube video
This trick will only be felt if you use the Linux operating system. It is very easy, simply use the existing browser, eg Mozilla Firefox or another browser.
The following process sequence:
1. Open your favorite browser
2. Type the address youtube.com
3. Allow it to finish spinning video
4. Open the / tmp directory on your computer, there will appear a file. flv is the result of streaming from youtube.com
5. Do not forget to quickly copy a file to another place, because after the computer restarts also missing file in the directory / tmp
Easy to do, so no need to use additional software to take a video on youtube. Good luck.
Read More
Thursday, October 21, 2010
SSH via web with JAVA
If at any time, you have problems with SSH in your workplace. Maybe the admin on your premises to close specific ports eg 443 or 22. This method can be effective, but there are a few tricks to put into the public html server. Maybe the hackers in cyberspace can help.
Okay, ready to empty file can use vi, vim, pico (editor unix) or notepad (windows). type the following script:
<html>
<body>
<APPLET CODE="com.mindbright.application.MindTerm.class" ARCHIVE="mindterm.jar" WIDTH=0 HEIGHT=0>
<PARAM NAME="sepframe" value="true">
<PARAM NAME="x11fwd" value="true">
<PARAM NAME="port" value="7575">
</APPLET>
</body>
</html>
give file name eg javassh.html
as supporting files, you can support the jar file (mindterm.jar). You can search via google.
good luck.
Read More
Wednesday, September 8, 2010
PHP Validate Form
Making the form on the php impressed casual. But one time we faced a problem with the validation of that form, eg filling of data can not be empty. Here are some scripts that can be used to check the validation of a form, especially checking space which can become the things we missed.
To make it easier, can be made a separate file with the parent file. suppose check.inc and later called in the php file using the command required
function check_not_empty($s, $include_whitespace = false)
{
if ($include_whitespace) {
// make it so strings containing white space are treated as empty too
$s = trim($s);
}
return (isset($s) && strlen($s)); // var is set and not an empty string ''
}
?>
Read More
Tuesday, September 7, 2010
Email Services : Linux Ubuntu Server 10.04 Chapter 5
The process of getting an email from one person to another over a network or the Internet involves many systems working together. Each of these systems must be correctly configured for the process to work. The sender uses a Mail User Agent (MUA), or email client, to send the message through one or more Mail Transfer Agents (MTA), the last of which will hand it off to a Mail Delivery Agent (MDA)
for delivery to the recipient's mailbox, from which it will be retrieved by the recipient's email client, usually via a POP3 or IMAP server.
1. POSTFIX
Postfix is the default Mail Transfer Agent (MTA) in Ubuntu. It attempts to be fast and easy to administer and secure. It is compatible with the MTA sendmail. This section explains how to install and configure postfix. It also explains how to set it up as an SMTP server using a secure connection(for sending emails securely).
To install postfix run the following command:
yoyok@yoyok-server:~$ sudo apt-get install postfix
To configure postfix, run the following command:
yoyok@yoyok-server:~$ sudo dpkg-reconfigure postfix
The user interface will be displayed. On each screen, select the following values:
• Internet Site
• mail.example.com
• steve
• mail.example.com, localhost.localdomain, localhost
• No
• 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24
• 0
• +
• all
By default Postfix will use mbox for the mailbox format. Rather than editing the configuration file directly, you can use the postconf command to configure all postfix parameters. The configuration parameters will be stored in /etc/postfix/main.cf file. Later if you wish to re-configure a particular parameter, you can either run the command or change it manually in the file.
To configure the mailbox format for Maildir:
sudo postconf -e 'home_mailbox = Maildir/'
SMTP Authentication
SMTP-AUTH allows a client to identify itself through an authentication mechanism (SASL).
Transport Layer Security (TLS) should be used to encrypt the authentication process. Once authenticated the SMTP server will allow the client to relay mail.
1. Configure Postfix for SMTP-AUTH using SASL (Dovecot SASL):
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_sasl_type = dovecot'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_sasl_path = private/auth-client'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_sasl_local_domain ='
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_sasl_security_options = noanonymous'
yoyok@yoyok-server:~$ sudo postconf -e 'broken_sasl_auth_clients = yes'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_sasl_auth_enable = yes'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_sudo postconf -e 'inet_interfaces = all'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_tls_auth_only = no'
yoyok@yoyok-server:~$ sudo postconf -e 'smtp_use_tls = yes'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_use_tls = yes'
yoyok@yoyok-server:~$ sudo postconf -e 'smtp_tls_note_starttls_offer = yes'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_tls_key_file = /etc/ssl/private/server.key'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_tls_cert_file = /etc/ssl/certs/server.crt'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_tls_loglevel = 1'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_tls_received_header = yes'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
yoyok@yoyok-server:~$ sudo postconf -e 'tls_random_source = dev:/dev/urandom'
yoyok@yoyok-server:~$ sudo postconf -e 'myhostname = mail.example.com'
yoyok@yoyok-server:~$ sudo postconf -e 'smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem'
The postfix initial configuration is complete. Run the following command to restart the postfix daemon:
yoyok@yoyok-server:~$ sudo /etc/init.d/postfix restart
To see if SMTP-AUTH and TLS work properly, run the following command:
telnet mail.example.com 25
After you have established the connection to the postfix mail server, type:
ehlo mail.example.com
If you see the following lines among others, then everything is working perfectly. Type quit to exit.
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
Monday, August 23, 2010
Apache : Linux Ubuntu Server 10.04 Chapter 4
Apache is the most commonly used Web Server on Linux systems. Web Servers are used to serve Web Pages requested by client computers. Clients typically request and view Web Pages using Web Browser applications such as Firefox, Opera, or Mozilla
Apache Web Servers are often used in combination with the MySQL database engine, the HyperText Preprocessor (PHP) scripting language, and other popular scripting languages such as Python and Perl. This configuration is termed LAMP (Linux, Apache, MySQL and Perl/Python/PHP) and forms a powerful and robust platform for the development and deployment of Web-based applications.
The Apache2 web server is available in Ubuntu Linux. To install Apache2:
yoyok@yoyok-desktop:~$ sudo apt-get install apache2
Apache Configuration
Apache2 is configured by placing directives in plain text configuration files. These directives are
separated between the following files and directories:
• apache2.conf: the main Apache2 configuration file. Contains settings that are global to Apache2.
• conf.d: contains configuration files which apply globally to Apache2. Other packages that use
Apache2 to serve content may add files, or symlinks, to this directory.
• envvars: file where Apache2 environment variables are set.
• httpd.conf: historically the main Apache2 configuration file, named after the httpd daemon. The file can be used for user specific configuration options that globally effect Apache2.
• mods-available: this directory contains configuration files to both load modules and configure them. Not all modules will have specific configuration files, however
• mods-enabled: holds symlinks to the files in /etc/apache2/mods-available. When a module configuration file is symlinked it will be enabled the next time apache2 is restarted.
• ports.conf: houses the directives that determine which TCP ports Apache2 is listening on.
• sites-available: this directory has configuration files for Apache2 Virtual Hosts. Virtual Hosts allow Apache2 to be configured for multiple sites that have separate configurations.
• sites-enabled: like mods-enabled, sites-enabled contains symlinks to the /etc/apache2/sitesavailable directory. Similarly when a configuration file in sites-available is symlinked, the site configured by it will be active once Apache2 is restarted.
Apache2 ships with a virtual-host-friendly default configuration. That is, it is configured with a single default virtual host (using the VirtualHost directive) which can modified or used as-is if you have a single site, or used as a template for additional virtual hosts if you have multiple sites. If left alone, the default virtual host will serve as your default site, or the site users will see if the URL
they enter does not match the ServerName directive of any of your custom sites. To modify the default virtual host, edit the file /etc/apache2/sites-available/default
this example of /etc/apache2/sites-available/default :
NameVirtualHost 192.168.45.126
ServerAdmin webmaster@localhost
DocumentRoot /var/www/yoyok
ServerName www.yoyok.com
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/errorYOYOK.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/accessYOYOK.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
after configure the apache, don't forget to restart :
yoyok@yoyok-server:~$ sudo /etc/init.d/apache2 restart
Read More
Friday, August 6, 2010
Linux Ubuntu Server 10.04 Chapter 3 Networking
Networking
Ubuntu ships with a number of graphical utilities to configure your network devices. This document is geared toward server administrators and will focus on managing your network on the command line.
Ethernet interfaces are identified by the system using the naming convention of ethX, where X
represents a numeric value. The first Ethernet interface is typically identified as eth0, the second as eth1, and all others should move up in numerical order.
To quickly identify all available Ethernet interfaces, you can use the ifconfig command as shown
below.
yoyok@yoyok-server:~$ ifconfig -a | grep eth0
eth0 Link encap:Ethernet HWaddr 00:13:d4:0e:32:59
Another application that can help identify all network interfaces available to your system is the lshw command. In the example below, lshw shows a single Ethernet interface with the logical name of eth0 along with bus information, driver details and all supported capabilities.
yoyok@yoyok-server:~$ sudo lshw -class network
[sudo] password for yoyok:
*-network:0
description: Ethernet interface
product: RTL-8139/8139C/8139C+
vendor: Realtek Semiconductor Co., Ltd.
physical id: 2
bus info: pci@0000:02:02.0
logical name: eth0
version: 10
serial: 00:13:d4:0e:32:59
size: 10MB/s
capacity: 100MB/s
width: 32 bits
clock: 33MHz
capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
QPPK7DA834B3
configuration: autonegotiation=on broadcast=yes driver=8139too driverversion=0.9.28 duplex=half latency=64 link=no maxlatency=64 mingnt=32 module=8139too multicast=yes port=MII speed=10MB/s
To configure your system to use a static IP address assignment, add the static method to the inet address family statement for the appropriate interface in the file /etc/network/interfaces. The example below assumes you are configuring your first Ethernet interface identified as eth0. Change the address, netmask, and gateway values to meet the requirements of your network.
auto eth0
iface eth0 inet static
address 192.168.45.11
netmask 255.255.255.0
gateway 192.168.45.10
By adding an interface configuration as shown above, you can manually enable the interface through
the ifup command.
sudo ifup eth0
To manually disable the interface, you can use the ifdown command.
sudo ifdown eth0
Loopback Interface
The loopback interface is identified by the system as lo and has a default IP address of 127.0.0.1. It can be viewed using the ifconfig command.
yoyok@yoyok-server:~$ ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2718 errors:0 dropped:0 overruns:0 frame:0
TX packets:2718 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:183308 (183.3 KB) TX bytes:183308 (183.3 KB)
By default, there should be two lines in /etc/network/interfaces responsible for automatically
configuring your loopback interface. It is recommended that you keep the default settings unless you have a specific purpose for changing them. An example of the two default lines are shown below.
auto lo
iface lo inet loopback
DHCP
The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host computers
to be automatically assigned settings from a server as opposed to manually configuring each network host. Computers configured to be DHCP clients have no control over the settings they receive from the DHCP server, and the configuration is transparent to the computer's user.
The most common settings provided by a DHCP server to DHCP clients include:
• IP-Address and Netmask
• DNS
• WINS
However, a DHCP server can also supply configuration properties such as:
• Host Name
• Domain Name
• Default Gateway
• Time Server
• Print Server
The advantage of using DHCP is that changes to the network, for example a change in the address of
the DNS server, need only be changed at the DHCP server, and all network hosts will be reconfigured the next time their DHCP clients poll the DHCP server. As an added advantage, it is also easier to integrate new computers into the network, as there is no need to check for the availability of an IP address. Conflicts in IP address allocation are also reduced.
A DHCP server can provide configuration settings using two methods:
MAC Address
This method entails using DHCP to identify the unique hardware address of each network card
connected to the network and then continually supplying a constant configuration each time the
DHCP client makes a request to the DHCP server using that network device.
Address Pool
This method entails defining a pool (sometimes also called a range or scope) of IP addresses from
which DHCP clients are supplied their configuration properties dynamically and on a "first come,
first served" basis. When a DHCP client is no longer on the network for a specified period, the
configuration is expired and released back to the address pool for use by other DHCP Clients.
Ubuntu is shipped with both DHCP server and client. The server is dhcpd (dynamic host
configuration protocol daemon). The client provided with Ubuntu is dhclient and should be installed on all computers required to be automatically configured. Both programs are easy to install and configure and will be automatically started at system boot.
At a terminal prompt, enter the following command to install dhcpd:
sudo apt-get install dhcp3-server
You will probably need to change the default configuration by editing /etc/dhcp3/dhcpd.conf to suit your needs and particular configuration.
You also need to edit /etc/default/dhcp3-server to specify the interfaces dhcpd should listen to. By default it listens to eth0.
# Sample /etc/dhcpd.conf
# (add your comments here)
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name "mydomain.example";
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}
This will result in the DHCP server giving a client an IP address from the range
192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will lease an IP address for 600
seconds if the client doesn't ask for a specific time frame. Otherwise the maximum (allowed) lease
will be 7200 seconds. The server will also "advise" the client that it should use 255.255.255.0 as
its subnet mask, 192.168.1.255 as its broadcast address, 192.168.1.254 as the router/gateway and
192.168.1.1 and 192.168.1.2 as its DNS servers.
Wednesday, August 4, 2010
Linux Ubuntu Server 10.04 Chapter 2 Package Management
Linux Ubuntu Server 10.04 Chapter 2 is about Package Management
Ubuntu features a comprehensive package management system for the installation, upgrade, configuration, and removal of software. In addition to providing access to an organized base of over 24,000 software packages for your Ubuntu computer, the package management facilities QPPK7DA834B3 also feature dependency resolution capabilities and software update checking.
Several tools are available for interacting with Ubuntu's package management system, from simple
command-line utilities which may be easily automated by system administrators, to a simple graphical interface which is easy to use by those new to Ubuntu.
Ubuntu's package management system is derived from the same system used by the Debian GNU/
Linux distribution. The package files contain all of the necessary files, meta-data, and instructions to implement a particular functionality or software application on your Ubuntu computer.
Debian package files typically have the extension '.deb', and typically exist in repositories which are collections of packages found on various media, such as CD-ROM discs, or online. Packages are normally of the pre-compiled binary format; thus installation is quick and requires no compiling of software.
Many complex packages use the concept of dependencies. Dependencies are additional packages
required by the principal package in order to function properly. For example, the speech synthesis package Festival depends upon the package libasound2, which is a package supplying the ALSA sound library needed for audio playback. In order for Festival to function, it and all of its dependencies must be installed. The software management tools in Ubuntu will do this automatically
dpkg
dpkg is a package manager for Debian based systems. It can install, remove, and build packages, but unlike other package management system's it can not automatically download and install packages and their dependencies. This section covers using dpkg to manage locally installed packages:
• To list all packages installed on the system, from a terminal prompt enter:
dpkg -l
• Depending on the amount of packages on your system, this can generate a large amount of output.
Pipe the output through grep to see if a specific package is installed:
dpkg -l | grep apache2
Replace apache2 with any package name, part of a package name, or other regular expression.
• To list the files installed by a package, in this case the ufw package, enter:
dpkg -L ufw
• If you are not sure which package installed a file, dpkg -S may be able to tell you. For example:
dpkg -S /etc/host.conf
base-files: /etc/host.conf
The output shows that the /etc/host.conf belongs to the base-files package.
• You can install a local .deb file by entering:
sudo dpkg -i zip_2.32-1_i386.deb
Change zip_2.32-1_i386.deb to the actual file name of the local .deb file.
• Uninstalling a package can be accomplished by:
sudo dpkg -r zip
apt-get
The apt-get command is a powerful command-line tool used to work with Ubuntu's Advanced
Packaging Tool (APT) performing such functions as installation of new software packages, upgrade
of existing software packages, updating of the package list index, and even upgrading the entire
Ubuntu system.
Being a simple command-line tool, apt-get has numerous advantages over other package management
tools available in Ubuntu for server administrators. Some of these advantages include ease of use over simple terminal connections (SSH) and the ability to be used in system administration scripts, which can in turn be automated by the cron scheduling utility.
Some examples of popular uses for the apt-get utility:
• Install a Package: Installation of packages using the apt-get tool is quite simple. For example, to install the network scanner nmap, type the following:
sudo apt-get install nmap
• Remove a Package: Removal of a package or packages is also a straightforward and simple
process. To remove the nmap package installed in the previous example, type the following:
sudo apt-get remove nmap
Also, adding the --purge options to apt-get remove will remove the package configuration files as
well. This may or may not be the desired effect so use with caution.
• Update the Package Index: The APT package index is essentially a database of available
packages from the repositories defined in the /etc/apt/sources.list file. To update the local
package index with the latest changes made in repositories, type the following:
sudo apt-get update
• Upgrade Packages: Over time, updated versions of packages currently installed on your computer
may become available from the package repositories (for example security updates). To upgrade
your system, first update your package index as outlined above, and then type:
sudo apt-get upgrade
Automatic Updates
The unattended-upgrades package can be used to automatically install updated packages, and can be
configured to update all packages or just install security updates. First, install the package by entering
the following in a terminal:
sudo apt-get install unattended-upgrades
To configure unattended-upgrades, edit /etc/apt/apt.conf.d/50unattended-upgrades and adjust
the following to fit your needs:
Unattended-Upgrade::Allowed-Origins {
"Ubuntu lucid-security";
// "Ubuntu lucid-updates";
};
Certain packages can also be blacklisted and therefore will not be automatically updated. To blacklist a package, add it to the list:
Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};
To enable automatic updates, edit /etc/apt/apt.conf.d/10periodic and set the appropriate apt
configuration options:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
The above configuration updates the package list, downloads, and installs available upgrades every
day. The local download archive is cleaned every week.
Configuration APT
Configuration of the Advanced Packaging Tool (APT) system repositories is stored in the /etc/apt/
sources.list configuration file. An example of this file is referenced here, along with information on adding or removing repository references from the file.
Here is a simple example of a typical /etc/apt/sources.list file.
You may edit the file to enable repositories or disable them. For example, to disable the requirement
of inserting the Ubuntu CD-ROM whenever package operations occur, simply comment out the
appropriate line for the CD-ROM, which appears at the top of the file:
# no more prompting for CD-ROM please
# deb cdrom:[Ubuntu 10.04_Lucid_Lynx - Release i386 (20070419.1)]/ lucid main restricted
Repository
In addition to the officially supported package repositories available for Ubuntu, there exist additional community-maintained repositories which add thousands more potential packages for installation.
Two of the most popular are the Universe and Multiverse repositories. These repositories are not
officially supported by Ubuntu, but because they are maintained by the community they generally
provide packages which are safe for use with your Ubuntu computer.
By default, the Universe and Multiverse repositories are enabled but if you would like to disable them, edit /etc/apt/sources.list and comment the following lines:
deb http://archive.ubuntu.com/ubuntu lucid universe multiverse
deb-src http://archive.ubuntu.com/ubuntu lucid universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ lucid universe
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid universe
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
Ok. lets try that and see you at the next chapter.
Read More














