安装环境
@H_502_12@ 配置Nginx
@H_502_12@ 重新加载
yum install -y autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
安装PHP
yum install -y PHP PHP-fpm PHP-MysqL PHP-devel PHP-mbstring PHP-gd@H_502_12@ 启动PHP-fpm
service PHP-fpm start@H_502_12@ 将PHP-fpm加入启动项
chkconfig --levels 2345 PHP-fpm on@H_502_12@ 查看
chkconfig --list | grep PHP-fpm
安装MysqL
- yum安装 @H_404_31@
yum install -y MysqL-server MysqL MysqL-devel@H_502_12@ 开启MysqL Server daemon (MysqLd)
service MysqLd start@H_502_12@ 用root帐号登录MysqL Server
MysqL -u root@H_502_12@ 修改 root 帐号的密码: (注: 这一步完成之后,下次使用MysqL -p -u root登录)
MysqL> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');@H_502_12@ 删除除root外的其它用户
select user,host from MysqL.user; delete from MysqL.user where not (user="root"); MysqL> FLUSH PRIVILEGES; select user,host from MysqL.user;@H_502_12@
MysqL> quit;@H_502_12@ 设置MysqLd开机启动
chkconfig --level 2345 MysqLd on && service MysqLd restart && chkconfig --list | grep MysqLd@H_502_12@ ====================================================== @H_502_12@ Centos7中用MariaDB代替了MysqL数据库。 @H_502_12@ CentOS 7的yum源中貌似没有正常安装MysqL时的MysqL-sever文件,需要去官网上下载
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh MysqL-community-release-el7-5.noarch.rpm # yum install MysqL-community-server
附:
@H_502_12@ 成功安装之后重启MysqL服务rpm-e需要卸载的安装包
在卸载之前,通常需要使用rpm-q…命令查出需要卸载的安装包名称。
ruby-1.8.7.352-7.el6_2.x86_64isaduplicatewithruby-1.8.7-1.el6.x86_64yum erase ruby
# service MysqLd restart
如果仍不能下载,把原来的yum源里自定义的源删除。
=====================================
安装web服务器Nginx
@H_502_12@ 下载链接:http://pan.baidu.com/s/1sjqknO5密码:7q59yum install -y pcre-devel zlib-devel tar -zxf Nginx-1.5.3.tar.gz cd Nginx-1.5.3 ./configure --prefix=/opt/Nginx make && make install@H_502_12@ 查看配置信息是否正确(可以一起复制)
cd /opt/Nginx/sbin/ ./Nginx -t@H_502_12@ 启动Nginx
/opt/Nginx/sbin/Nginx@H_502_12@ 开机启动
echo /opt/Nginx/sbin/Nginx >> /etc/rc.local
开放80端口
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT /etc/init.d/iptables save service iptables restart@H_502_12@ 或直接关闭防火墙(可选)
service iptables stop@H_502_12@ 开机关闭防火墙(可选)
chkconfig --level 0123456 iptables off@H_502_12@
@H_502_12@ 配置Nginx
vim /opt/Nginx/conf/Nginx.conf@H_502_12@ 安装vim
yum install -y vim@H_502_12@ 去掉注释并修改脚本路径为/opt/Nginx/html @H_403_163@
cd /opt/Nginx/sbin ./Nginx -s reload service PHP-fpm restart