码迷,mamicode.com
首页 > 系统相关 > 详细

Linux yum安装

时间:2018-07-21 14:31:22      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:存在   https   安装php7   emc   文件的   目的   服务器ip   lag   flag   

一.安装Apache软件
步骤:
1.安装 yum install httpd
 2.启动,关闭 重启等命令
systemctl start httpd.service(启动)
systemctl restart httpd.service(重启)
systemctl stop httpd.service
systemctl enable httpd.service(开机即启动)
systemctl status httpd.service(查看运行状态)

之后开放80端口 设置防火墙
firewall-cmd --zone=public --add-port=80/tcp --permanent

重新启动防火墙
systemctl restart firewalld.service

然后在浏览器中输入192.168.1.111:80就可以访问apache服务器了(192.168.1.111是服务器ip)

3.杀死进程
查看指定的进程 ps -ef|grep httpd 看是否已经存在进程,若存在,手工kill掉 kill -9 pid
4.开放80端口的
5.查看相关文件的位置
Apache软件的主配置文件为/etc/httpd/conf/httpd.conf
网页文档是需要放置在,/var/www/html目录下

可以通过命令find / -name www 来搜索放置项目的位置
通过命令 find / -name httpd.conf来查找文件所在的位置

二.安装 Php7
开启php错误提示信息 http://www.zuimoban.com/jiaocheng/linux/7591.html

1.安装epel-release
通过命令:yum -y install epel-release 
2.安装PHP7
终端再次运行如下命令:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
成功获取PHP7的yum源,然后再执行:yum install php70w
3.验证安装
终端命令:php -v,显示当前PHP版本,信息如下:
安装其他插件(选装)
php70w
php70w-fpm (nginx)
php70w-gd 
php70w-mysql
php70w-pdo 


三.安装mysql
1.下载YUM库
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
2.安装YUM库
yum localinstall -y mysql57-community-release-el7-7.noarch.rpm
3.安装数据库
yum install -y mysql-community-server
之后开放3306端口 设置防火墙
firewall-cmd --zone=public --add-port=3306/tcp --permanent

重新启动防火墙
systemctl restart firewalld.service

4.启动MySQL服务
systemctl start mysqld.service

三.安装nginx
1.使用yum安装nginx需要包括Nginx的库,安装Nginx的库
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2.使用下面命令安装nginx yum install nginx
3.启动Nginx
systemctl start nginx.service
systemctl restart nginx.service

4.安装好之后可以通过which nginx和whereis nginx来查看nginx安装的位置
5.配置文件是/etc/nginx/conf.d/default.conf
6.页面存放位置 /usr/share/nginx/html

7.添加/etc/nginx/conf.d/default.conf配置文件的内容为以下:
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}

8.安装php-fpm
9.yum install php70w-fpm
10.php-fpm的配置文件在 /etc/php-fpm.d/www.conf
11.启动php-fpm

systemctl start php-fpm.service
systemctl restart php-fpm.service


Nginx+php+fastcgi的原理与关系
http://www.cnblogs.com/mangguoxiansheng/p/5967745.html

12.通过进程查看服务是否开启
查看进程 ps -ef|grep nginx php-fpm kill -9 pid


http://www.centoscn.com/CentOS/Intermediate/2013/0817/1334.html
13.开启php提示错误
首先要编辑PHP配置文件:
vi /etc/php.ini
error_reporting = E_ERROR
display_errors = On

编辑 php-fpm.conf文件,如果php-fpm.conf中没有php_flag[display_errors] 请查找和这个文件相关的其他的conf文件 进行修改
把php_flag[display_errors]设为on:

vi www.conf

php_flag[display_errors] = on

如果不知道php-fpm.conf放到哪里了 可以find / -name php-fpm.conf 查找

Linux yum安装

标签:存在   https   安装php7   emc   文件的   目的   服务器ip   lag   flag   

原文地址:https://www.cnblogs.com/zzg02/p/9346076.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!