阿里云搭建私有云盘第一步,搭建lamp环境

服务器小白一枚,租了个服务器,朋友送了个便宜域名,打算用来搭建一个私有云,本博客用来记录安装过程出现的问题以及解决方案。

本人打算利用Owncloud搭建私有云。第一步配置lamp便遇到很多问题。

第一步,搭建lamp环境

https://linuxtechlab.com/easiest-guide-creating-lamp-server/

1更新

$yum update

这一步没有问题

2安装apache

实际上centos上的Apache服务器便是httpd服务,

$ yum install httpd

这一步便是我问题所在,它提示我找不到httpd对应的安装包

[root@** yum.repos.d]# yum install httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * epel: mirrors.cloud.aliyuncs.com
No package httpd available.
Error: Nothing to do

第一点:我没有开启80端口(这一步具体这一步骤是否需要用到不清楚,但是以后是一定要用到的,用来测试是否已经安装Apache服务)

解决办法:进入阿里云控制台,打开云服务器->安全组->管理实例->安全组规则->添加安全组规则->在端口范围和授权对象分别写入80/80(这是用来设置端口范围,具体不是很清楚)、0.0.0.0/0

第二点:关闭防火墙

在没有关闭防火墙之前是没法安装iptables-service的

随便在命令行输入一条防火墙规则,例如iptables -P OUTPUT ACCEPT,然后使用service iptables save进行保存

[root@iz2ze21yntcr0clifsh3l4z ~]# iptables -P OUTPUT ACCEPT
[root@iz2ze21yntcr0clifsh3l4z ~]#  service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

它可能会报类似的错误,但是似乎对结果没有影响,可能只是用来新建iptables文件及规则吧(阿里云没有/etc/sysconfig/iptables这个文件)接着使用ystemctl stop firewalld关闭防火墙

[root@iz2ze21yntcr0clifsh3l4z ~]# systemctl stop firewalld

竟然没有报错TAT,快成功了,然后使用yum install iptables-services安装iptables-services成功了!

Installed:
  iptables-services.x86_64 0:1.4.21-28.el7                                                                                                                        

Complete!

但是我偏题了,我忘了一开始是要装httpd的,下次见吧

_____________________________________________________________________________________________________

更新:

上次刚把iptables-services安装成功好之后就下了,接着更新。

使用如下两条指令开启网络访问(80)以及数据库访问(3306),如果无法开启记得去阿里云控制台看看设置。

iptables -A INPUT -p tcp -m state --state NEW,RELATED,ESTABLISHED -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m state --state NEW,RELATED,ESTABLISHED -m tcp --dport 3306 -j ACCEPT
service iptables save
systemctl restart iptables

保存设置,重启iptables

修改selinux设置:

vim /etc/selinux/config

然后重启,reboot

reboot

之后便可以直接下载apache服务

yum -y install httpd

,到这,我已经完成了我新生服务器安装私有云最困难的一步了,安装好了apache服务。

猜你喜欢

转载自blog.csdn.net/MrBlind/article/details/86635158