LINUX-centos7服务器环境安装的那些坑

admin5年前IT技术1447


LINUX-centos7服务器环境安装的那些坑
亲自测试能用的

第一步 安装php

一定要加上--skip-broken,否则根本无法安装,依赖的程序实在是太多了,我走过这个弯路;
 yum -y install php*   --skip-broken

第二步 安装apache

 yum install httpd

设置HTTPD自动启动
systemctl enable httpd.service

yum安装的httpd,在/etc/httpd/conf.d/目录下添加vhosts.conf后重启即可,vhosts.conf文件格式如下


<VirtualHost *:80> 
 ServerName www.test.com 
 DocumentRoot "/website/siteone" 
 DirectoryIndex index.html index.php 
 
 <Directory "/website/siteone"> 
  Options -Indexes +FollowSymlinks 
  AllowOverride All 
  Require all granted 
 </Directory> 
 
</VirtualHost>

启动 service httpd start

注意了下面的是关键
 关闭关闭SELINUX

因为他不干人事,导致你们到处配置出问题,会导致APACHE站点目录出现无权限访问的提示

vi /etc/selinux/config

 # This file controls the state of SELinux on the system. 
# SELINUX= can take one of these three values: 
#     enforcing - SELinux security policy is enforced. 
#     permissive - SELinux prints warnings instead of enforcing. 
#     disabled - No SELinux policy is loaded. 
#SELINUX=enforcing 
SELINUX=disabled 
# SELINUXTYPE= can take one of three two values: 
#     targeted - Targeted processes are protected, 
#     minimum - Modification of targeted policy. Only selected processes are protected.  
#     mls - Multi Level Security protection. 
SELINUXTYPE=targeted  

:wq! #保存退出

setenforce 0 #使配置立即生效

第三步  安装MYSQL

千万不能简单的运行 yum install mysql,安装的根本不是mysql,而是变种的MariaDB

应该是rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

查看当前可用的mysql安装资源

yum repolist enabled | grep "mysql.*-community.*"

安装
 yum -y install mysql-community-server
设置将其开机启动
systemctl enable mysqld
启动
systemctl start mysqld
设置密码
mysql_secure_installation
进去MYSQL
mysql -uroot -p


mysql>use mysql;
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
      GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '962360' WITH GRANT OPTION; 

最后关闭防火墙
iptables -F

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

进行测试  

 

相关文章

Float引起div自适应高度解决办法。

Float引起div自适应高度解决办法。方法一:如果父元素没有设置高度,那么我们可以在父元素中添加:“overflow:hidden;”来清除浮动,即可通过浮动元素撑开父元素。...

pr的设置视频高度宽度的方法

1.在序列里设置具体的比例2.在"效果"-"视频效果"-"变换"---"裁剪"拖到视频里  然后在"...

汇成产品防伪系统V1.0

汇成产品防伪系统V1.0官方下载后台管理用户:admin后台管理密码:admin声明:本系统是商用系统,个人测试之后请及时删除!1、《添加管理员》选项,可以在本产品防伪查询系统中添加多个管理员。2、《...

火车头正则过滤emoji表情

由于火车头是C#开发的,所以大家写不了正则,就要在网上搜索C#正则过滤emoji表情 正则表达式如下\p{Cs}这个比较不错下面2个作为补充(\ud83c[\udf00-\udfff])|(...

关于jquery升级至1.8版本之后的兼容问题Uncaught TypeError: $(...).size is not a function

关于jquery升级至1.8版本之后的兼容问题Uncaught TypeError: $(...).size is not a function

之前也遇到过这种问题Uncaught TypeError: $(...).size is not a function  控制台报错如上图,打开Frame.js可以看到里面定义大小...

未命名

<?phpnamespace Article;class Comment { }namespace MessageBoard;class Comment { }//调用当前空间(MessageB...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。