Showing posts with label lamp. Show all posts
Showing posts with label lamp. Show all posts

Monday, July 21, 2014

How to install phpMyAdmin on debian7 or ubuntu

phpMyAdmin is a free web software to work with MySQL on the web. It provides a convenient visual front end to the MySQL capabilities.

Before working with phpMyAdmin, you need to have LAMP installed on your server. If you don't have the Linux, Apache, MySQL, PHP stack on your server, you can find the tutorial for setting it up here.

Install phpMyAdmin

In Debian and Ubuntu it simple.You can use apt-get for setup it.

# su -
# apt-get install phpmyadmin
or

# sudo apt-get install phpmyadmin


if you enabled sudo

During the installation, phpMyAdmin will walk you through a basic configuration. Once the process starts up, follow these steps:
Select Apache2 for the server
Choose YES when asked about whether to Configure the database for phpmyadmin with dbconfig-common
Enter your MySQL password when prompted
Enter the password that you want to use to log into phpmyadmin

After the installation has completed, add phpmyadmin to the apache configuration.
# sudo Include /etc/phpmyadmin/apache.conf > /etc/apache2/apache2.conf

Restart apache2 Service.
# sudo /etc/init.d/apache2 restart

You can then access phpmyadmin by going to youripaddress/phpmyadmin.

Saturday, July 19, 2014

How to install LAMP on Debian 7

     หลังจากที่เราติดตั้ง Debian 7 กันไปแล้ว คราวนี้เรามาทำ web server หรือที่เค้าเรียกกันว่า LAMP(Linux, Apache, My Sql, PHP) กันดีกว่าครับ

     ว่าแล้วเราก็มาเริ่มกันเลยดีกว่าครับ
  • ก่อนอื่นเราต้องเข้าเป็น root ของระบบก่อนนะครับ
    $ su -
  • จากนั้นเรามาทำการอัพเดตกันหน่อยครับ
    root@debian:~# apt-get update
  • จากนั้นก็ติดตั้ง my sql ครับ
    root@debian:~# apt-get install mysql-server mysql-client
  • ตั้งรหัสผ่าน root ของ mysql ครับ

  • ยืนยันรหัสผ่านครับ

  • ติดตั้ง apache ครับ
    root@debian:~# apt-get install apache2 -y
  • ต่อไปก็ติดตั้ง Php, perl และ pyton ครับ

    root@debian:~# apt-get install php5 php-pear php5-mysql libapache2-mod-php5 -y
    root@debian:~# apt-get install perl libapache2-mod-perl2 -y
    root@debian:~# apt-get install python libapache2-mod-python -y
  • รีสตาร์ท service อีกทีครับ

    root@debian:~# /etc/init.d/apache2 restart
  • ทดสอบการใช้งาน php

    root@debian:~# nano -w /var/www/test.php
  • ใส่ Code นี้ลงไปครับเป็น code แสดงข้อมูลต่างๆของ php ที่ติดตั้งไปครับ

    <?php
         phpinfo();
    ?>
  • ทดสอบโดยการเปิด browser แล้วไปที่ http://<IP-address or Server name>/test.php ถ้าขึ้นก็เป็นอันใช้ได้ครับ

**หมายเหตุ
ถ้าจะเข้าใช้จากชื่อเครื่องต้องไปใส่ที่ไฟล์ /etc/hosts ก่อนนะครับโดยเพิ่ม

ip-address            hostname

เข้าไปครับ
เสร็จเรียบร้อยแล้วครับสำหรับการติดตั้ง ถ้าจะเอาหน้าเพจไปใส่ก็ใส่ที่ /var/www/ ได้เลยครับ

credit by : https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian