Showing posts with label Linux Tutorials. Show all posts
Showing posts with label Linux Tutorials. Show all posts

Monday, August 08, 2011

How to setup a localhost with Lamp Server in Ubuntu

Although, I use Ubuntu, this should apply to a large number of linux distros. Every developer uses a local environment to develop locally before testing it live. I kinda avoid that root by mounting my FTP webspace in Ubuntu and directly working on live files (there is no need of download and upload as you might think), but I wanted to do some CPU intensive job for a client for which I needed to setup a localhost environment, so I thought I would share this with everyone on my blog.

Install LAMP Server


Fire up a terminal (Applications > Accessories > Terminal) and enter this command:

sudo apt-get install lamp-server^


Enter y for yes when it asks to continue after estimation of how much data will be downloaded and how much will be used on disk.
It will install quickly and can take a few minutes depending on your internet speed, and then it will ask you to setup the password for MySQL user root. It is usually left blank on localhost machines as they are used only for development purposes but last time I left it blank, I had to deal with the issues that it didn’t change the password to blank but has something else and I had to turn off the password prompt for root access. Avoid doing all that by just selecting “root” or anything you want as the password of the root user of MySQL.


Confirm it once (Type the password and press Tab key).


and you are done.

 

Test Apache Webserver


Just open http://localhost/ in your browser and it will show up this page,


which means Apache is working fine.

 

Test PHP


Create a file named phpinfo.php in /var/www/ to check if PHP is working fine.

sudo nano /var/www/phpinfo.php

Enter the content as <?php phpinfo() ;?> and save the file by hitting Ctrl + X and then Y (for yes) and return key (enter).

Restart Apache webserver by the following command. sudo /etc/init.d/apache2 restart

Now open http://localhost/phpinfo.php and it will show up a page with lots of php related information,


if you can see it, PHP is working fine.

 

Install phpMyAdmin


Enter this command in terminal. sudo apt-get install libapache2-mod-auth-mysql phpmyadmin


Select Apache2 as the web server by pressing Space and then Tab key and press enter key.


Press Yes to configure database for phpmyadmin.


Provide password which we set as “root” earlier.


Again, enter “root“.


Confirm it, and then you are done.

 

Test phpMyAdmin


Now open http://localhost/phpmyadmin/ in your brower to access phpmyadmin and you can login with username and password both as root.



Code for other installation:
sudo apt-get install apache2 apache2-doc mysql-server php5 libapache2-mod-php5 php5-mysql phpmyadmin

Pretty quick & easy!

Enter this command to edit permissions & access your web directory, sudo nautilus and go to File System your web root at /var/www/ where you will need super user permissions to write files.


Everything is done.

Friday, July 29, 2011

How to enable desktop effects in Ubuntu


In previous versions of Ubuntu, if you wanted wobbly windows and eye candy, you had to follow complicated HowTos full of a lot of copying and pasting of cryptic commands, with the very real possibility of you screwing up your graphics configuration to the point where it's unusable.

Now (as of 7.10) Ubuntu allows you an easy way to enable desktop effects. Keep in mind that you may have to enable proprietary video card drivers if you have an Nvidia or ATI video card. See an example of this (using Nvidia as an example) here.


Go to System > Preferences > Appearance


In Appearance Preferences select the Visual Effects tab.


Then, select Normal or Extra, depending on how fancy you want your desktop effects to be.


Ubuntu will try to enable desktop effects. If the trial works, you should see this dialogue, and you can decide to keep the newly enabled effects or revert back to having no desktop effects.


If the trial doesn't work, you'll be told Desktop effects could not be enabled, which may mean that you don't have the proper video drivers installed or that your video card cannot support desktop effects.

If you're having trouble setting up desktop effects, please search or post a support thread in Desktop Effects & Customization subforum of the Ubuntu Forums

Wednesday, July 27, 2011

How To Install 64-bit Flash Player 11 In Ubuntu 11.04 “Natty Narhwal”


A while back, Adobe has finally delivered on its promise and released a native 64-bit Flash Player for Linux. if you are on Ubuntu 11.04 64-bit and want to update to Flash Player 11, here is what you have to do.
To install Flash Player 11 on Ubuntu 11.04 64-bit, we will use SevenMachines’ PPA. The PPA has been already updated with the latest release from Adobe.

So, open the Terminal and execute the command below to add the PPA.
sudo add-apt-repository ppa:sevenmachines/flash
Now update the software list.
sudo apt-get update
Finally install Flash 11 with the command given below.
> sudo apt-get install flashplugin64-installer

Here is a screen shot of a Flash video being played on Ubuntu 11.04 64-bit with Flash Player 11.

Tuesday, July 26, 2011

Run ubuntu with your current windows system

Wubi is an officially supported Ubuntu installer for Windows users. If you’ve got Windows, you can run Ubuntu within your current system with the Windows installer (Wubi). That way,  It can install and uninstall Ubuntu in the same way as any other Windows application. It's simple and safe.


Click File1 or File2 to download the latest version of Ubuntu. This Windows installer (Wubi) will help you to run Ubuntu within your current system.

* After the file is downloaded, you have to open it to run the installer. If you are using Internet Explorer, you'll be asked whether you want to run or save the file. Choose 'Run' to launch the installer.


* Most other browsers, like Firefox, will only ask you to save the file. Click 'Save' and then double-click the downloaded file to launch the installer.


* If a security message like this appears, click 'Continue' to proceed with the installation.


* To install Ubuntu, all you need to do is choose your username and password. Please note that you have to enter your password twice to make sure you typed it correctly.

* After choosing your password, click 'Install'. The files will be downloaded and installed automatically.


* Wait until Ubuntu is downloaded and installed. Please note that the whole process can take a while – the downloaded file size is 700MB


* When the installation is complete, you will be prompted to restart your computer. Click 'Finish' to restart. 


* After your computer restarts, choose 'Ubuntu' from the boot menu.


And its done! :)

Install BackTrack to Disk

NOTE: It is recommended that you have a minimum of 10 GB free disk space to install Backtrack!

* Boot the Backtrack Live Environment.
* At the bash prompt, type startx to enter the GUI.
* Double click the Install Backtrack.sh on the desktop
* Let's run through the installer step by step:

    * We select our language, in this case English and then click the Forward button


    * Here we select out geographical location (The Region and Time Zone) and click Forward. 


    * Chose your keyboard layout. We are going to leave it the default which is USA and click Forward.


    * Now it’s time to partition the Disk, for a full Disk installation we choose the “Erase and use the entire disk” option and click Forward.


    * In this screen we are able to check our install options, check them to make sure everything is right than click “Forward”.


    WARNING: When the installer reaches 99% the process might take some time so DO NOT panic, wait about 10-15 minutes.


    * Hit the Restart Now button, and enjoy Backtrack

     

    * After the reboot, you can log in with the default username root and password toor. Do not forget to change this default root password by issuing the passwd command. 

    * As you can see the splash screen disappeared after the reboot. In order to fix it just run fix-splash, and the splash screen will appear on the next boot.

      How to install BackTrack 5 in VirtualBox

      In this tutorial we are going to take a look on how to install BackTrack 5 in VirtualBox.

      * Download the latest version of VirtualBox from the official page.
      * Download the BackTrack 5 ISO from the official page.
      * After installing VirtualBox, let's launch it and try to set up a new Virtual Machine:


      Click New –> Continue –> Next 
      Name (Select Ubuntu 64Bit) –> Next 
      Select Ram (Assign at least 30%) –> Next 
      Check “Boot Disk” a Create New Hard Disk 
      Continue –> “Dynamically Expanding Storage” –>  
      Choose Location –> Size Minimum of  
      Continue –> Done

      * Your Disk Configuration should look similar to this:

      Click Settings
      (We are going to leave mosts defaults on 
      for everything for this How-To)
      Click Storage a With “IDE Storage” 
      Selected click the Drive Icon with the plus sign on it a
      Choose Add CD/DVD a Choose Disk a Navigate 
      to the BT5 ISO you had downloaded
      Click Display and assign at least 64MB
      Click Ok
      Open Terminal and enter the Following
      VboxManage setextradata 
      “Backtrack” 
      “CustomVideoMode1″ 
      “1100x740x16″


      Click Start Click inside the window –> Tab –> Choose 
      “Backtrack Text”

      * Once the boot sequence completes you will already be in a root shell.

      NOTE: If you have chosen the KDE Environment do not forget to issue the following command before startx:

      root@bt:~# rm /root/.kde/cache-*
      * Once Backtrack Launches Double Click the
      “Install Backtrack Icon” and follow the steps from here. 
      * After the setups is finished, shut down Backtrack.
      Click Settings in Virtual Box Manager a Click Storage a With
      “IDE Storage” selected remove the Live-ISO distribution
      Click Start to launch Backtrack
      * Now lets download the Vbox Guest Addon using wget.
      root@bt:~# wget  
      http://download.virtualbox.org/virtualbox/4.0.8/VBoxGuestAdditions_4.0.8.iso
      * Now issue the following commands:
      root@bt:~# mount –o loop VBoxGuestAdditions_4.0.8.iso /a
      root@bt:~# cd /a
      root@bt:~# chmod a+x VBoxLinuxAdditions.run
      root@bt:~# ./VBoxLinuxAdditions.run
      * Reboot and enjoy!

      Thursday, July 07, 2011

      How to change IP Address on Linux Redhat

      Introduction:

      Most of the time, I work in Windows environment. But I sometimes have to work on Linux platform, too. So I decide to note it down this topic to remind myself.

      There are many ways to change IP Address on Linux. First one is the easiest way that configure on GUI because it’s like on Windows platform. The second way is configure on command-line but it is only temporary, it’ll reload to the old configuration when the network service is restart. And the last one is also configure on command-line to change IP Address permanently.

      Section

      1. Configure on GUI (Permanently)
      2. Configure on commad-line (Temporary)
      3. Configure on commad-line by edit configuration file (Permanently)

      Step-by-step

      Configure on GUI (Permanently)

      1. Select Application -> System Settings -> Network.


      2. On Network Configuration and Devices tab, you’ll see available network card on the PC. In this example, the PC has 1 network interface card (NIC) and it’s currently inactive. Double click on the network interface card (NIC) that you want to configure to open its property.


      3. On Ethernet Device, you can configure the NIC to be either DHCP or static IP Address. When you finish, click OK.


      4. There is a pop-up message ask for activate the NIC. Click Yes to enable the NIC.


      5. The NIC will be restarted to reload the new configurations and the NIC is active now.



      Configure on commad-line (Temporary)

      Note: This way change IP Address only temporary. When you restart network service, it’ll load from configuration file to replace this configuration.

      1. Open Terminal.
      2. Type ifconfig -a

      to list all network interface card on the current PC.


      3. Type ifconfig eth0 192.168.125.10 netmask 255.255.255.0 up to configure IP Address on interface eth0.


      4. Note: To configure gateway, type route add default gw [gateway address].


      Configure on commad-line by edit configuration file (Permanently)

      1. Open Terminal.
      2. Open network configuration file. In this example, it’ll configure on interface eth0. Type vi /etc/sysconfig/network-scripts/ifcfg-eth0

      [root@BKKLINUX01 ~]# vi /etc/sysconfig/network-scripts/ifconfig-eth0

      3. The current configuration is DHCP.


      4. Modify the file by press ‘i’ to enter insert mode. Change BOOTPROTO to static and add IP Address and Net mask as new lines if they’re not existed yet..

      BOOTPROTO=static
      IPADDR=192.168.125.10
      NETMASK=255.255.255.0
      Save the configuration file by press ESC + ‘:’ and type ‘wq’ to write and quit the editor.


      5. You can added these configuration to the config file. Replace [number] with your actual value.

      GATEWAY=[number]
      TYPE=Ethernet
      NETWORK=[number]
      BROADCAST=[number]

      6. Restart the network interface card. Type service network restart.


      7. Review the configuration. Type ifconfig.

      The IP Address has been changed permanently.



      Done ...