I've escaped from database in the past but now I can't.
Actually the document Installing LAMP On Ubuntu For Newbies is good enough to make LAMP correctly.
In addition to my process of setup a LAMP referencing the document, I write how to configure MySQL and phpMyAdmin, application to administrate MySQL remotely.
You need install following pack
- Apache
- apache2
- PHP
- php5
- libapache2-mod-php5
- MySQL
- mysql-server
First, install apache.
$ sudo apt-get install apache2
Next, PHP.
$ sudo apt-get install php5 libapache2-mod-php5Restart Apache.
$ sudo /etc/init.d/apache2 restartTest PHP.
Write on /var/www/testphp.php following line
<? php phpinfo(); ?>
Access http://[server's IP address]/testphp.php with your browser to ensure that it shows PHP information.
Next, MySQL.
$ sudo apt-get install mysql-serverNow I start MySQL setting.
If you want to allow other computer to connect to your SQL server, you need to change [Bind Address] in /etc/mysql/my.cnf from 127.0.0.1 to your IP address.
$ sudo vi /etc/mysql/my.cnf
from
bind-address = 127.0.0.1
to
bind-address = [server's IP address]
Create password for MySQL root.
$ mysql -u rootInstall PHPMyAdmin.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.38-Ubuntu_0ubuntu1-log Ubuntu 7.04 distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('[パスワード]');
Query OK, 0 rows affected (0.00 sec)
mysql> quit
$ sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadminTo give a permission to administrate MySQL from PHP, configure /etc/php5/apache2/php.ini.
$ sudo vi /etc/php5/apache2/php.ini
;extension=mysql.so
remove ";".
extension=mysql.so
Restart Apache.
$ sudo /etc/init.d/apache2 restart
Now you can login PHPMyAdmin by accessing http://[server's IP address]/phpmyadmin/.
No comments:
Post a Comment