Linux yum安装
一.安装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安装的更多相关文章
- Linux yum安装和源码安装
转载注明出处:原文地址 Linux Yum 在线安装 在线:Yum配置地址:/etc/yum.repos.d/CentOS-Base.repo 离线:光盘搭建Yum源 挂载光盘 使在线Yum源失效:m ...
- linux yum 安装mysql
1.安装查看有没有安装过: yum list installed MySQL* rpm -qa | grep mysql* 查看有没有安装包: yum list mysql* 安装mysql客户端: ...
- Linux yum安装java环境
1.jdk 1.8 #系统版本 [root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) #安装 ...
- Linux Yum 安装JDK
1.查看CentOS自带JDK是否已安装. 输入:yum list installed |grep java. 2.若有自带安装的JDK,如何卸载CentOS系统自带Java环境? 卸载JDK相关文件 ...
- linux yum安装jdk
>>>>>>>>>> 实例: yum安装jdk 1.查看当前的jdk版本,并卸载 (注1:rpm -qa ###解释:查询所有安装的rpm包 ...
- Linux yum安装MySQL5.7
一.安装配置MySQL的yum源 # 安装MySQL的yum源,下面是RHEL6系列的下载地址 rpm -Uvh http://dev.mysql.com/get/mysql-community-re ...
- Linux yum 安装 Nginx
搭建 Nginx 静态服务器 安装 Nginx 使用 yum 安装 Nginx: yum install nginx -y 修改 /etc/nginx/conf.d/default.conf,去除对 ...
- Linux yum安装MySQL5.7,及远程连接mysql(亲测有效!)
一.安装配置MySQL的yum源 # 安装MySQL的yum源,下面是RHEL6系列的下载地址 rpm -Uvh http://dev.mysql.com/get/mysql-community-re ...
- linux yum安装指定版本mysql
1.下载mysql rpm包 cd /usr/local/src wget https://dev.mysql.com/get/mysql80-community-release-el7-.noarc ...
随机推荐
- myeclipse-9.0安装svn客户端插件
SVN插件配置到MyEclipse中的步骤 听语音 | 浏览:20471 | 更新:2015-01-09 10:26 | 标签:myeclipse 1 2 3 4 5 6 7 分步阅读 MyEclip ...
- Java文件与io——字节流
FileOutputStream用于写入诸如图像数据之类的原始字节的流 字节输出流:OutputStream 此抽象类表示输出字节流的所有类的超类.(写) 字节输入流:InputStream(读) p ...
- Murano 网址一览
[Murano_Meeting] http://eavesdrop.openstack.org/#Murano_Meeting [Murano_Meeting_Agenda] https://wiki ...
- AngularJs在ng-click函数中如何获取代表当前元素的DOM对象
<!DOCTYPE html> <html> <head> <title></title> <script src="lib ...
- CSS里的 no-repeat
简单来说,CSS里的 no-repeat是针对背景图片来说的.当你设置了no-repeat这个属性后,你的背景图片将不会被重复,再换一种说法,你在网站上所看到的背景图片就是你所添加的图片, 不会出现平 ...
- elasticsearch报错:None of the configured nodes are available: []
问题:在内网测试的时候可以正常访问,但是部署到外网上客户端连接elasticsearch报错:None of the configured nodes are available: [] 原因:默认情 ...
- java网络编程—TCP(1)
演示tcp的传输的客户端和服务端的互访. 需求:客户端给服务端发送数据,服务端收到后,给客户端反馈信息. 客户端: 1,建立socket服务.指定要连接主机和端口. 2,获取socket流中的输出流. ...
- /usr/local/sbin/arpspoof
/usr/local/sbin/arpspoof arpspoof -t 攻击者ip地址 网关ip地址 稍等系,被攻击者机器的arp的缓存就已经变了.
- nmap --script http-enum,http-headers,http-methods,http-php-version -p 80 目标域
从http服务器上收集到更多地信息 nmap --script http-enum,http-headers,http-methods,http-php-version -p 80 目标域
- 如何在Ubuntu server中修改IP
详细请移步至博客https://blog.csdn.net/shenzhen_zsw/article/details/74025066 方法一. sudo ifconfig eth0 100.100 ...