Saturday, February 08, 2014

Linux LAMP (Linux, Apache, MySQL, PHP)

  Install Apache

sudo apt-get install apache2

Testing Apache

http://localhost/

Install PHP

sudo apt-get install php5 libapache2-mod-php5
Step: Eventually you need to:
sudo /etc/init.d/apache2 restart

Test PHP

Step: Let's test if PHP is working correctly.
sudo nano /var/www/index.php
or...
sudo echo “<?php phpinfo(); ?>” > /var/www/index.php
Step 3. Save and close the file.
Step 4. Now open you're web browser and type the following into the web address:
http://localhost/index.php
(It will show you the page that has all information about your php. If you have prior experience of installing php in some other OS, you must have seen this page.)
Congrats you have now installed both Apache and PHP!

Install MySQL

To finish this guide up we will install MySQL.
Step 1. Once again open up the amazing Terminal and then copy/paste or type this line:
sudo apt-get install mysql-server
Step 2 (optional). In order for other computers on your network to view the server you have created, you must first edit the "Bind Address". Begin by opening up Terminal to edit the  my.cnf  file.
sudo nano /etc/mysql/my.cnf
Change the line
bind-address = 127.0.0.1
And change the  127.0.0.1  to your IP address.
(In Linux Mint 11, terminal itself asked to the set password, But if it doesn't follow the step 3.)
Step 3. This is where things may start to get tricky. Begin by typing the following into Terminal:
mysql -u root
Following that copy/paste or type this line:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');
(Make sure to change yourpassword to a password of your choice.)
Step 4. We are now going to install a program called phpMyAdmin which is an easy tool to edit your databases. Copy/paste or type the following line into Terminal:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
After that is installed our next task is to get PHP to work with MySQL. To do this we will need to open a file entitled  php.ini. To open it type the following:
sudo nano /etc/php5/apache2/php.ini
Now we are going to have to uncomment the following line by taking out the semicolon ";"
Change this line:
;extension=mysql.so
To look like this:
extension=mysql.so
Now just restart Apache and you are all set! 
sudo /etc/init.d/apache2 restart

PhpMyAdmin Configuration

If you get a 404 error upon visiting http://localhost/phpmyadmin: You will need to configure apache2.conf to work with Phpmyadmin.
sudo nano /etc/apache2/apache2.conf
Include the following line at the bottom of the file, save and quit.
Include /etc/phpmyadmin/apache.conf


Installing LAMP on Linux Mint

1. Install Apache2 on Linux Mint using apt-get.
sudo apt-get install apache2
sudo apt-get install phpmyadmin
sudo apt-get install mysql-server

2. Install PHP and the various modules enabling Apache to work with PHP using apt-get.
sudo apt-get install php5 libapache2-mod-php5
sudo apt-get install libapache2-mod-auth-mysql php5-mysql

3. Install MySQL Server and set root MySQL user password with the following command, it will automatically prompt you for the password during installation.

4. Create a quick php test script that uses the phpinfo() function to test your server with. After running this command simply open up Firefox or Chrome and go to http://127.0.0.1/index.php or http://localhost/index.php.
sudo echo “<?php phpinfo(); ?>” > /var/www/index.php

5. Reload Apache2 Configuration
service apache2 reload

Monday, February 03, 2014

Poesia 2014 - Fernando Pessoa

Ó mar salgado, quanto do teu sal
São lágrimas de Portugal!
Por te cruzarmos, quantas mães choraram,
Quantos filhos em vão rezaram!
Quantas noivas ficaram por casar
Para que fosses nosso, ó mar!

Valeu a pena? Tudo vale a pena
Se a alma não é pequena.
Quem quer passar além do Bojador
Tem que passar além da dor.
Deus ao mar o perigo e o abismo deu,
Mas nele é que espelhou o céu.

Fernando Pessoa Pessoa, F. Mensagem. Poema X Mar Português. Edições Ática: Lisboa. 1959.

Monday, November 04, 2013

Joao Legenda - All of me



What would I do without your smart mouth
Drawing me in, and you kicking me out
Got my head spinning, no kidding, I can't pin you down
What's going on in that beautiful mind
I'm on your magical mystery ride
And I'm so dizzy, don't know what hit me, but I'll be alright

[Bridge:]
My head's under water
But I'm breathing fine
You're crazy and I'm out of my mind

[Chorus:]
'Cause all of me
Loves all of you
Love your curves and all your edges
All your perfect imperfections
Give your all to me
I'll give my all to you
You're my end and my beginning
Even when I lose I'm winning
'Cause I give you all, all of me
And you give me all, all of you, oh

[Verse 2:]
How many times do I have to tell you
Even when you're crying you're beautiful too
The world is beating you down, I'm around through every mood
You're my downfall, you're my muse
My worst distraction, my rhythm and blues
I can't stop singing, it's ringing, in my head for you

[Bridge:]
My head's under water
But I'm breathing fine
You're crazy and I'm out of my mind

[Chorus:]
'Cause all of me
Loves all of you
Love your curves and all your edges
All your perfect imperfections
Give your all to me
I'll give my all to you
You're my end and my beginning
Even when I lose I'm winning
'Cause I give you all of me
And you give me all, all of you, oh

Give me all of you
Cards on the table, we're both showing hearts
Risking it all, though it's hard

[Chorus:]
'Cause all of me
Loves all of you
Love your curves and all your edges
All your perfect imperfections
Give your all to me
I'll give my all to you
You're my end and my beginning
Even when I lose I'm winning
'Cause I give you all of me
And you give me all of you

I give you all, all of me
And you give me all, all of you, oh