lamp=====linux + apache + mysql +php
lnmp ==== linux + nginx + mysql + python
一.部署LAMP架构
1.永久关闭selinux,美国航空安全局,开发的linux内置防火墙
看到此状态表示运行中
[root@localhost ~]# getenforce
Enforcing
修改selinux的配置文件,永久禁止它开机自启,然后reboot
[root@localhost ~]# cat /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=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
看到此状态表示永久关闭
[root@localhost ~]# getenforce
Disabled
备注:
修改selinux状态,enforcing > permissive
setenforce 0
运行中
# enforcing – SELinux security policy is enforced.
临时关闭中,下次开机还会启动
# permissive – SELinux prints warnings instead of enforcing.
永久关闭了
# disabled – No SELinux policy is loaded.
2.关闭内置的firewalld,以及清空iptables规则
清空防火墙规则
[root@loca服务器托管网lhost ~]# iptables -F
永久关闭防火墙
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
3.用简易方式安装
apache在Linux中软件包的名字,叫httpd
[root@localhost ~]#服务器托管网 yum -y install httpd
改配置,如果需要绑定域名的话,我这里改成了127.0.0.1:80
vim /etc/httpd/conf/httpd.conf
启动
systemctl start httpd
验证是否运行
[root@localhost ~]# yum install -y net-tools
[root@localhost ~]# netstat -tnlp|grep httpd
tcp6 0 0 :::80 :::* LISTEN 4172/httpd
测试端口是否运行
[root@localhost ~]# curl -I 127.0.0.1:80
HTTP/1.1 403 Forbidden
Date: Mon, 20 Nov 2023 13:04:49 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Thu, 16 Oct 2014 13:20:58 GMT
ETag: "1321-5058a1e728280"
Accept-Ranges: bytes
Content-Length: 4897
Content-Type: text/html; charset=UTF-8
4.可以通过apache的公网ip访问到这个服务器
查看公网ip的方式有俩:
一.你可以去阿里云控台看
二.技巧如下,我们现实在2个公网中的机器互相访问
[root@localhost ~]# curl ifconfig.me
39.144.44.227[root@localhost ~]#
5.打开阿里云的安全组,允许80端口请求通过
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: 基于Java web的旅游路线的设计与实现-计算机毕业设计源码+LW文档
摘 要 随着时代的发展,人们对旅游也越来越重视,近些年来我国的旅游产业也发生了翻天覆地的变化,但是很多人在出去旅游的时候不知道去哪里旅游,在预订酒店和机票的时候也没有一个综合性的旅游网站,为了让人们的旅游变的更加的方便,为此我开发了本基于Java web的旅游…