แสดงบทความที่มีป้ายกำกับ ubuntu แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ ubuntu แสดงบทความทั้งหมด

วันจันทร์ที่ 3 มีนาคม พ.ศ. 2557

APT cacher installation

Running several server with same distribution like ubuntu or debian. It is smart to have repository cache on your network. This can save your bandwidth and time.


Server side
1. Install apt-cacher mandatory package
$  apt-get install apt-cacher

2. Edit apt-cacher configuration
$  vi /etc/apt-cacher/apt-cacher.conf

#####
daemon_addr =
allowed_hosts = /
#####

3. Restart apt-cacher service
$  /etc/init.d/apt-cacher restart


Client side
1. Create proxy files for connect to apt-cacher
$  vi /etc/apt/apt.conf.d/01proxy

#####
Acquire::http::Proxy "http://:3142";
#####


How it work?
1. On client side try to use command apt-get update
2. On APT cacher server check logs file at /var/log/apt-cacher/access.log
to see client connection


Reference :
http://www.debuntu.org/how-to-set-up-a-repository-cache-with-apt-cacher/
https://help.ubuntu.com/community/Apt-Cacher-Server

วันพฤหัสบดีที่ 8 ธันวาคม พ.ศ. 2554

ubuntu installing mongodb- part II : install php driver

After finishing this part, your php will be able to use mongodb function. 

To install mongodb php driver, first of all we need pecl to install from PHP repository. 
#sudo apt-get install php5-dev php5-cli php-pear
Running pecl to get and install php driver. 
#sudo pecl install mongo
Turn your back to the screen and have a coffee while system compiling the mongo extension. After finishing installation, you will see this : 
Build process completed successfully
Installing '/usr/lib/php5/20090626+lfs/mongo.so'
install ok: channel://pecl.php.net/mongo-1.2.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
Then, edit php.ini  (/etc/php5/cli/php.ini, ubuntu)  and add this line extension=mongo.so.


Reference : http://www.mongodb.org/display/DOCS/PHP+Language+Center

วันพุธที่ 30 พฤศจิกายน พ.ศ. 2554

ubuntu installing mongodb- part I : install server




The newest version of mongodb is not in repository of ubuntu. To install newest 2.0, custom repository 10gen is needed.

Add key :
#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

Add repository by creating file name '/etc/apt/sources.list.d/10gen.list'
with this line :
(using upstart)
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
You're ready to install :
#apt-get update#apt-get install mongodb-10gen
The mongodb is running in the system. The configuration for mongodb is /etc/mongodb.conf and in /etc/init/mongodb.conf (for startup script)

Reference:
http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages

วันอังคารที่ 7 กันยายน พ.ศ. 2553

Install windows font in linux(ubuntu)

Linux user cannot avoid living with windows user. That make linux users to adjust ourselves to read file from windows including fonts they using.

(1) using font package
#sudo apt-get install msttcorefonts

#sudo fc-cache -fv


(2) copying font files from windows
copy *.ttf font to /usr/share/fonts/truetype/thai

#fc-cache -fv

reference
1. ms-font package installation [here]

วันศุกร์ที่ 12 กุมภาพันธ์ พ.ศ. 2553

Ubuntu package management & package installed for web server

Update list of package
#apt-get update

Upgrade all package in system
#apt-get upgrade

To install package
#apt-get install foo

To remove package
#apt-get remove foo
-remove configuration on the system
#apt-get --purge remove for

To upgrade all packages on the system
#apt-get dist-upgrade

apt-cache : query package list tool

To find packages whose description contain word:
#apt-cache search word

To print the detailed information of a package:
#apt-cache show package

To print the packages a given package depends on:
#apt-cache depends package

#To print detailed information of the versions available for a package and the packages
that reverse-depends on it:
apt-cache showpkg package



PHP package
php5
php5-cgi
php5-cli
php5-curl
php4-common
php5-gd
php5-imagick
php5-memcache
php5-mysql
php5-xcache
libapache2-mod-fcgid
nfs-kernel-server


Apache package
apache2
apache2-mpm-worker
apache2-utils
apache2.2-bin
apache2.2-common
libapache2-mod-fcgid


Apache Ubuntu vs Apache gentoo
add user apache with uid81 (gentoo)
#useradd -r -u 81 apache

edit /etc/apache2/envvars to run apache with user apache

Reference :
A Debian Package Primer: Part One
Aptitude :part two
Ubuntu Community Doc.

วันพฤหัสบดีที่ 11 กุมภาพันธ์ พ.ศ. 2553

Understanding apache config order in debian/ubuntu

In ubuntu, i've found a lot of config file for apache. To identify the problem, you need to know which config loading sequence which might overwrite another one.

/etc/apache2

1) apache2.conf - define #process, timeout etc...
2) mods-enabled/*.conf - module configuration
3) httpd.conf (user configuration)
4) ports.conf - port listening
5) conf.d/*- generic snippet statement - charset localized-error-pages, security
6) sites-enable/* -all vhost

วันอังคารที่ 8 ธันวาคม พ.ศ. 2552

Ubuntu handy configuration and command after installation + apache PHP

Ubuntu

configuration after setup.

startup interface/fix ip on startup
> /etc/network/interfaces.
iface eth1 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1

set name server
> /etc/resolv.conf
nameserver 204.11.126.131


install ssh for remote login
> openssh
sudo apt-get install openssh-client openssh-server


>adduser
sudo adduser username


>user / add/ super user (group admin) sodoer
sudo adduser xeon
sudo adduser xeon admin


>php5 + mysql
sudo apt-get install
  • php5
  • php5-cgi
  • php5-cli
  • php5-mysql
  • php5-memcache
  • php5-gd
  • php5-imagick

>apache
sudo apt-get install apache2-mpm-worker


>remove service from startup
update-rc.d -f apache2 remove

>add service
update-rc.d apache2 defaults

>more reading on services
http://www.debuntu.org/how-to-manage-services-with-update-rc.d


>NFS server
sudo apt-get install nfs-kernel-server
sudo /etc/init.d/nfs-kernel-server start

>NFS client
sudo apt-get install nfs-common
For more info about nfs : https://help.ubuntu.com/community/SettingUpNFSHowTo


>/etc/exports
/ubuntu *(ro,sync,no_root_squash)
/home *(rw,sync,no_root_squash)

>package management-install
#apt-get install packagename
-see update current version

# apt-cache policy apache2
apache2:
Installed: 2.2.8-1ubuntu0.3
Candidate: 2.2.8-1ubuntu0.14
Version table:
2.2.8-1ubuntu0.14 0
500 http://th.archive.ubuntu.com hardy-updates/main Packages
500 http://security.ubuntu.com hardy-security/main Packages
*** 2.2.8-1ubuntu0.3 0
100 /var/lib/dpkg/status
2.2.8-1 0
500 http://th.archive.ubuntu.com hardy/main Packages

Remark
*apache worker mpm not work with libapach2-php
using fcgid mod and php cgi

*NFS add host to /etc/hosts.allow
*snmpd change init opt /etc/default/snmpd
*all rp_filter need to be disable