Posts

Showing posts from August, 2008

Installation and Configuration of Joomla CMS! on Debian ETCH

Step 1: Install the LAMP server and also phpmyadmin See my blogpost "Installation of LAMP on Debian" #aptitude install phpmyadmin Step 2: Download Lattest version of Joomla e.g dwonload from following location http://linux.softpedia.com/progDownload/Joomla-Download-5739.html Step 3: make directory under /var/www/joomla and decompress joomla mkdir /var/www/joomla cd /var/www/joomla tar -xvf var/www/Joomla_1.5.6-Stable-Full_Package.tar.gz Step 4: Create Database in MySQL #mysqladmin -u root -p create Joomla mysql -u root -p mysql>GRANT ALL PRIVILEGES ON Joomla.* TO Joomla@localhost IDENTIFIED BY 'Joomla'; mysql>flush privileges; mysql>quit Step 5: Change ownership and priviliges of /var/www/joomla chown www-data.www-data /var/www/joomla chmod 777 /var/www/joomla Notw: Rechange this mode to normal after installation. Step 6: Begin installattion http://192.168.100.10/joomla This will start the wizard, answer the questions, in check list try to eliminate missing c...

Import and Export mysql database in Debian using phpmyadmin

Step 1: Install phpmyadmin aptitude install phpmyadmin Step 2: Login to phpmyadmin https://192.168.100.1/phpmyadmin/ Default user: root Enter root password. Step 3: Export Database After log in, click Export In EXPORT menue select your database e.g joomla Select format under Select All/Unselect All e.g SQL (by default) Click Save as file e.g jooml Press Go (botton right) Save it to your local hard disk Step 4: Import Database Press Import after log in to phpmyadmin in other machine. select the file under Location of the text file, Leave every thing by default and Press Go This will import the mysql database.

Recover MYSQL root password in Debian

Step # 1 : Stop mysql service # /etc/init.d/mysql stop Step # 2: Start to MySQL server without password # mysqld_safe --skip-grant-tables & Step # 3: Connect to mysql server using mysql client: # mysql -u root mysql> Step # 4: Setup new MySQL root user password mysql> use mysql; mysql> update user set password=PASSWORD("imran") where User='root'; mysql> flush privileges; mysql> quit Step # 5: Stop MySQL Server: # /etc/init.d/mysql stop Step # 6: Start MySQL server # /etc/init.d/mysql start Step # 7: Test it # mysql -u root -p

Installation of LAMP on Debian

Step 1) Installation of Apache and PHP4 aptitude install apache2 php4 libapache2-mod-php4 Step 2) Installation of MySQL Server aptitude install mysql-server mysql-client php4-mysql change of MYSQL root Pasword mysql -u root mysql> USE mysql; mysql> UPDATE user SET Password=PASSWORD('new-password') WHERE user='root'; mysql> FLUSH PRIVILEGES; step 3) Installation of PhpMyAdmin aptitude install phpmyadmin Edit /etc/apache2/apach2.conf: append at the end Include /etc/phpmyadmin/apache.conf Testing http://domainname.com/phpmyadmin/ Login using mysql root and create users. Further docs http://www.howtoforge.com/ubuntu_debian_lamp_server

Installing and configuring DHCP on Debian

Step 1: Install DHCP package aptitude install dhcp3-server Step 2: Configure DHCP package option domain-name "domain.com"; option domain-name-servers 10.0.0.2, 193.10.10.10; option routers 10.0.0.1; default-lease-time 3600; subnet 10.0.0.0 netmask 255.0.0.0 { arrange 10.0.0.100 10.0.0.254; #OPTIONS #if you want to assign IP based on MAC address host imran { hardware ethernet 00:50:BA:82:DE:63; fixed-address 10.10.10.10; } } Step 3: Restart /etc/init.d/dhcp3-server restart Further Docs http://www.debianhelp.co.uk/dhcp.htm

Useful Linux commands

Adding user name and password in authentication file in Apache2 root@jupiter:/etc/apache2# htpasswd /etc/apache2/intranet.passwd halvard This will append the MD5 password with user in file. Installation of Java on Ubuntu root@imran-desktop:~# sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts root@imran-desktop:~# java -version java version "1.6.0_16" Java(TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing) Check directory size du -hs /home/imran/ How to check all installed packaged and version of a specific installed packag e dpkg -s apache2 dpkg --list |more How to Zip and unzipp #aptitude install zip unzip zip imran.zip file1 file2 file3 Then you can extract the original files like this: unzip imran.zip

How to copy files/directory in Debian using rsync and scp over network

1) Network copying using rsync Step 1: Install rsync on both machines aptitude install rsync Step 2: Edit of /etc/default/rsync on both machines RSYNC_ENABLE=false to RSYNC_ENABLE=true Step 3: Restart rsync on both machines /etc/init.d/rsync restart Step 4: Start copy from machine1 to machine2 rsync -e ssh -avz /home/imran 192.168.100.10:/media/usbdisk/imran options a: archive mode perserver file permission v: verbose z: compress (this will reduce time) This will prompt for password, enter password, you will see building file list.. Backup using Rsync Make script and place it under /etc/cron.daily. Generate and copy the key ssh-keygen -t dsa, and press Enter when prompted for a passphrase. After the key is created, use ssh-copy-id -i .ssh/id_dsa.pub root@remote.host.com to copy the public key to the remote host. (Note: this presume that SSH is installed with key transfer) 2) Network copying using scp scp -Cr /home/imran 192.168.100.10:/media/usbdisk r:recursvly copying C:...

ENABLE AUTHENTICATION ON DEBIAN APACHE WEB SERVER

Step by Step Guide; Step 1 Enable Digest Authentication This authentication does not supported by default #a2enmod auth_digest Step 2 Set up user/password/realm htdigest -c /var/www/munin/.htpasswd munin username munin is realm and username is username. supply "username" user password, Step 3 Making Authentication required go back to /etc/apache2/sites-available/monitoring. Options FollowSymLinks AllowOverride None #authentification AuthType Digest AuthName "munin" AuthDigestFile /var/www/munin/.htpasswd #people using apache 2.2 will use instead: #AuthUserFile /var/www/munin/.htpasswd require valid-user Step 4 Reload apache configuration #apache2ctl -t Syntax OK $/etc/init.d/apache2 force-reload Step 5 Tesing and Running Now, go to http://monitoring.example.com with your browser. A box should prompt you for a username and password. Supply the one you define above and you should be given access to munin statistics.

Monitoring Linux (Debain) Network With Munin

It requires following packages; • Web Server e.g apache • Munin Server • Munin Clients • Measuring temperature using smartmontools • Munin Windows plugins • Documentation and further Reading WEB SERVER e.g APACHE Linux Apach2 for debian #apt-get install apache2-mpm-prefork Run the script “apache2-ssl-certificate” i.e # apache2-ssl-certificate MUNIN ON SERVER #apt-get install munin munin-node Edit Configuration /etc/munin/munin.conf # a simple host tree [localhost.localdomain] address 127.0.0.1 use_node_name yes [machine1.domain.com] address xx.xxx.xxx.xx use_node_name yes [machine2.domain.com] address xx.xxx.xxx.xx use_node_name yes ##please write ip on xx MUNIN ON CLIENTS Instlal it in each client #apt-get install munin-node change configuration /etc/munin/munin-node.conf Edit Configuration on each Client Machine Client 1 machine1.domain.com # # Example config-file for munin-node # log_level 4 log_file /var/log/munin/munin-node.log port 4949 pid_file /var/...

Mounting External USB Disk on Debian

After plugin USB, see any activity tail -f /var/log/syslog if nothing about usb mass storage, check reasons. If "no loadable modules!", your old Kernel does not support USB, you might need to upgrade it (depending upon hardware of machine) in my case it was the Via CPU which is not a full-blown 686. Then install the new kernel apt-get install linux-image-2.6.18-4-486 After that config the lilo or grub in our case it was lilo: edit /etc/lilo.conf default=2.6.18 Then restart the machine. check activity and see syslog (see up command) Kernal find the disk Aug 14 20:05:11 neptune kernel: usb-storage: device found at 3 Aug 14 20:05:11 neptune kernel: usb-storage: waiting for device to settle before scanning Aug 14 20:05:16 neptune kernel: Vendor: ATA Model: SAMSUNG HD321KJ Rev: CP10 Aug 14 20:05:16 neptune kernel: Type: Direct-Access ANSI SCSI revision: 05 Aug 14 20:05:16 neptune kernel: SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB) Aug 14 20:05:1...

Squirrelmail Web Client Installatin and Configuration on Debian

Following things are involved.  MAIL SERVER 'Exim4'  INSTALLATION OF PACKAGES  CONFIGURATION  FURTHER DOCUMENTATION MAIL SERVER: We are already running EXIM4, as our mail mail server on a different machine and network with folloing IMAP and SMTP Imap.domain.com Smtp.domain.com No need to install it from scracth. INSTALLATION OF PACKAGES: A) Web server Apache with ssl support Install apache2: apt-get install apach2 install ssl certificate: apt-get install ssl-cert generate certificate: openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem country name: NO state name: Oslo locality name: Oslo organizaion name: yourcompany organizatinal unit: IT common name: webmail email addres: youremail@yourdomain.com B) PHP4 (php5 has some problems) PHP4 Installation: apt-get install php4 C) UW IMAP Installation of uw-imapd: apt-get install uw-imapd D) Squirrelmail Squirrelmail Installation: apt-get install squirelmail you can also download f...