Thursday, January 27, 2011

installing UBUNTU’s APACHE2 LOCAL WEBSERVER

installing UBUNTU’s APACHE2 LOCAL WEBSERVER

May 9, 2008

Lately I’ve been using ubuntu 7.10 for all my projects/daily work.
As a web developer i should have LAMP on my machine and now i would guide you through installing it on yours.
This guide is divided into 3 steps: installing/tesing Apache, PHP and finally MySQL.
Lets start with Apache:
1. Open the terminal (we will be using it through most of my guide) from Applications > Accessories > Terminal
2. Install apache2 using apt-get by typing the following
sudo apt-get install apache2
Note that you should know the root password.
Now everything should be downloaded and installed automatically.
To start/stop apache2 write:
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
Your www folder should be in: /var/www/
If everything is OK you should see an ordinary HTML page when you type: http://localhost in your firefox browser
Finished with Apache ? lets conquer PHP:
1. Also in terminal write:
sudo apt-get install php5 libapache2-mod-php5
or any php version you like
2. restart apache
sudo /etc/init.d/apache2 restart
This is it for PHP D
Wanna test it ? Just create an ordinary PHP page in /var/www/ and run it.
Example:
sudo gedit /var/www/test.php
and write in it: < ?php echo “Hello World”; ?>
Now run it by typing http://localhost/test.php in firefox… You should see your ” Hello World ”
66 % is over, lets continue to installing MySQL:
1. Again and again in terminal execute:
sudo apt-get install mysql-server
2. (optional) If you are running a server you should probably bind your address by editing bind-address in /etc/mysql/my.cnf and replacing its value (127.0.0.1) by your IP address
3. set your root password (although mysql should ask you about that when installing)
mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(’xxxxxx’);
4. Try running it
mysql -uroot -pxxx
where xxx is your password.
Note: You can install PHPMyAdmin for a graphical user interface of MySQL by executing
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
5. restart apache for the last time
sudo /etc/init.d/apache2 restart

Installing MySQL Server on Linux (Ubuntu and Kubuntu) for Ruby and Rails

Installing MySQL Server on Linux (Ubuntu and Kubuntu) for Ruby and Rails
Posted June 23, 2008
Filed under: Hardy Heron Kde4 Remix, Rails, Ruby | Tags: install mysql hardy heron, install mysql linux, installing mysql for rails, installing mysql for rails on linux, installing mysql for ruby, installing mysql for ruby on linux, mysql |
I have installed MySQL on my Hardy Heron KDE4 remix after repeated efforts and that is why I thought that I should list the steps showing how to go about the task.
First of all open the terminal/konsole and type there “sudo apt-get install mysql-server ” and then press enter. You will be asked for your password and after providing password the installation will begin . In this you will also have to set up your MySQL password , so that your database remains secure .
Post installation type ” mysql -u root -p ” , you will be asked for your mysql password and after providing password , You should see the following :
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
If you see the above lines ,it means you can now work on MySQL, as far as i have understood this .
Installing MySql driver :
In konsole type “apt-cache search libmysqlclient ” to find out the different library versions available.You will see text similar to the following :
libcrypt-mysql-perl – Perl module to emulate the MySQL PASSWORD() function.
ser-mysql-module – contains the MySQL database connectivity module
libmysqlclient15-dev – MySQL database development files
libmysqlclient15off – MySQL database client library
Next install the library by typing ” sudo apt-get install libmysqlclient15-dev ” on the konsole . Library will depend on the version of MySQL you are using , you can select your library from the output which comes after writing “apt-cache search libmysqlclient” and then pressing tab two times .
Install MySQL driver with the Ruby ” gem install ” command . Type ” sudo gem install mysql ” on the konsole , here you will get various options choose “mysql-2.7″ or any other latest version and install it . On successful install you will get a message stating that mysql-2.7 has been Successfully installed .
Your Installation of mysql is complete .
If you are new to MySQL , like me , you can install MySQL Query Browser and MySQL Administrator from the Adept Manager or Synaptic both of which are default package managers for kubuntu and ubuntu respectively. I have installed Query Browser and Administrator from Adept Manager as I am a Kubuntu user .

Wednesday, January 26, 2011

install apache2 php and mysql in ubuntu

nstalling Apache

Now we can get started installing. This will take a few minutes, so grab a beer (or your favorite beverage,) and off we go. To install Apache, type or paste this into your terminal:


sudo apt-get install apache2


Testing Apache

Once apache2 is done installing, you can go ahead and test it by using:


sudo /etc/init.d/apache2 start



If you get a message that it's already running, you're good to go. Now, open up your browser and navigate to:


http://localhost/

Installing PHP

Again, to install PHP, type or paste this into your terminal:

sudo apt-get install php5 libapache2-mod-php5


Once it's finished installing, restart apache, using:

sudo /etc/init.d/apache2 restart


Testing PHP

Now, let's make sure that PHP is working properly. To do this, we're going to run phpinfo(). You can, of course, swap out gedit with your editor of choice.

sudo gedit /var/www/phpinfo.php


Type or paste the following into the document, and save it. (remove the space before the '?php')



Now we can test PHP by browsing to:

http://localhost/phpinfo.php
 

You should see all of the info about your PHP installation listed on the page, like so. For security reasons, you should remove this page when you're sure that PHP works.


Installing MySQL

Now we can conquer MySQL

sudo apt-get install mysql-server
 
As MySQL is installing, it will ask you to configure your root password. Make sure that you type it correctly, as it will only ask you once.


Testing MySQL

After that is finished, you can test MySQL by running this, where unixmen is your password

mysql -uroot -punixmen




If it brings you to a MySQL prompt, you're done! You can type exit to get out of MySQL.



Installing phpMyAdmin


Now, if you want to install phpMyAdmin to have a front end for MySQL, you can use the following



sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

It will ask you to choose a webserver to configure automatically, you can use the space bar to select Apache2. And after that's finished, restart one last time.

sudo /etc/init.d/apache2 restart

Finished!

Now you have your own LAMP (Linux Apache MySQL PHP) server, with phpMyAdmin

Bind Some Event to Element and trigger that function when click the element

Scenario: Suppose if we used same click event function in various web pages. if you want do some logic some page button for that need to re...