Hardware: Mac Mini (192.168.2.250)
VMWare Fusion: 3.0.1
CentOS 5.4 Virtual Machine installed with Server packages
The network router forwards traffic from port 80 to 192.168.2.80
// Check
vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.2.80
GATEWAY=192.168.2.254
NETMASK=255.255.255.0
Root access permit in /etc/ssh/sshd_config
PermitRootLogin yes
install php:
yum install php
install mysql-server mysql:
yum install mysql-server mysql
yum install php-mysql
// start apache
service httpd restart
// Every time after reboot
chkconfig httpd on
chkconfig mysqld on
// Mysql password
mysqladmin -u root password hiddenpass
index.php
<?php
$db=mysql_connect('localhost', 'root', 'hiddenpass');
mysql_select_db("test", $db);
$result=mysql_query("SELECT * from MARTIN");
if($r=mysql_fetch_assoc($result)){
echo "a : {$r['a']}\n";
}
Resume:
- Apache 2
- PHP 5.1.6
- MySQL 14.12
Geen opmerkingen:
Een reactie posten