之前手动编译过一次lamp的开发环境,相当痛苦。这一次,就决定换yum的方式来进行环境的搭建。
我用的是centos6.3的系统。
步骤如下:
1安装apache
yum install httpd httpd-devel
安装完成后,用/etc/init.d
tpd start 启动apache
设为开机启动:chkconfig httpd on
2 安装mysql
yum install mysql mysql-server mysql-devel
同样,完成后,用/etc/init.d/mysqld start 启动mysql
设置mysql密码
mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql>; FLUSH PRIVILEGES;
允许远程登录
mysql -u root -p
Enter Password: <your new password>
mysql>GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
完成后就能用mysql-front远程管理mysql了。
设为开机启动
chkconfig mysqld on
3. 安装php
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d
tpd start
这个时候还要做最后一步,打开80端口
输入/etc/init.d/iptables status查看一下防火墙状态,我们发现80端口没有被允许;
接下来,允许80端口通过防火墙/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT;
保存防火墙配置/etc/rc.d/init.d/iptables save;
步骤如下:
1安装apache
yum install httpd httpd-devel
安装完成后,用/etc/init.d
设为开机启动:chkconfig httpd on
2 安装mysql
yum install mysql mysql-server mysql-devel
同样,完成后,用/etc/init.d/mysqld start 启动mysql
设置mysql密码
mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql>; FLUSH PRIVILEGES;
允许远程登录
mysql -u root -p
Enter Password: <your new password>
mysql>GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
完成后就能用mysql-front远程管理mysql了。
设为开机启动
chkconfig mysqld on
3. 安装php
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d
这个时候还要做最后一步,打开80端口
输入/etc/init.d/iptables status查看一下防火墙状态,我们发现80端口没有被允许;
接下来,允许80端口通过防火墙/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT;
保存防火墙配置/etc/rc.d/init.d/iptables save;
love my xx