一:安装MySQL
1.安装
yum install mysql mysql-server mysql-devel
?
2.启动MySQL
/etc/init.d/mysqld start
?
3.设置MySQL初始密码
???假设密码设置为123456
mysqladmin -u root password 123456?
?
4.设置远程登录权限
mysql -u root -p
????输入密码
mysql> GRANT ALL PRIVILEGES ON *.* TO '用户名'@'地址' IDENTIFIED BY '密码' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES;
?
二:安装Apache
yum install httpd httpd-devel?
?
三:安装PHP及插件
yum install php php-mysql php-common php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc ?
?
启动Apache
/etc/init.d/httpd start
?
设置开机启动
chkconfig mysqld on chkconfig httpd on
?
安装后的网页位置是 /var/www/html
如果要用其他机器访问需关闭防火墙
service iptables stop
或者自己设置防火墙允许访问端口80
iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
?