Tuesday, August 12, 2008

Setup LAMP + OCS Inventory

Apache

Install Apache
sudo apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
Testing HTTP Server by open a web browser and enter http://localhost

PHP

Install PHP5
sudo apt-get install libapache2-mod-php5 libapache2-mod-ruby php5
php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick
php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming
php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy

php5-xmlrpc php5-xsl
Stop/Restart Apache
sudo /etc/init.d/apache2 restart
Test the installation
sudo gedit /var/www/testphp.php
Insert this following line into testphp.php file.

Save this new file.
Open a web browser and enter http://localhost/testphp.php
Be sure to remove the file afterwards, as it may pose a security risk.
sudo rm /var/www/testphp.php

MySQL

Install MySQL Server
sudo apt-get install mysql-server mysql-client libmysqlclient15-dev
MySQL initially only allows connections from the localhost (127.0.0.1). We’ll need to remove that restriction if you wish to make it accessible to everyone on the internet. Open the file /etc/mysql/my.cnf
sudo vi /etc/mysql/my.cnf
Find the line bind-address = 127.0.0.1 and comment it out then save the file.
MySQL comes with no root password as default. This is a huge security risk. You’ll need to set one. So that the local computer gets root access as well, you’ll need to set a password for that too. The local-machine-name is the name of the computer you’re working on.
mysqladmin -u root password newpassword
mysqladmin -h root@local-machine-name -u root -p password newpassword
sudo /etc/init.d/mysql restart

MySQL for Apache HTTP Server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
To get PHP to work with MySQL, open the php.ini file
sudo vi /etc/php5/apache2/php.ini
You’ll need to uncomment the “;extension=mysql.so” line so that it looks like this
extension=mysql.so
Restart Apache
sudo /etc/init.d/apache2 restart

No comments:

Pengurusan Air Untuk Ternak Ikan Air Tawar

Kriteria Air Berkualiti - Kimia: Kandungan Oksigen Terlarut (DO): Lebih daripada 4.0 mg/l (Disyorkan lebih daripada 5.0 mg/l) pH: 6.5 - 8....