当前位置: 首页 > news >正文

ubuntu apache2配置反向代理

1.Ubuntu安装apache

sudo apt-get update
sudo apt-get install apache2

2.apache2反向代理配置

sudo vim /etc/apache2/sites-available/000-default.conf 

添加内容如下:

<VirtualHost *:80># The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName www.example.comServerAdmin webmaster@localhostDocumentRoot /var/www/html# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warnErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with "a2disconf".#Include conf-available/serve-cgi-bin.confProxyPreserveHost OnProxyPass / http://localhost:8888/ProxyPassReverse / http://localhost:8888/
</VirtualHost># vim: syntax=apache ts=4 sw=4 sts=4 sr noet

3.web页面访问 输入localhost:8888弹出自己设计的界面

4.与web网页进行通讯则可以参考下面的连接

ubuntu http 服务器响应-CSDN博客

http://www.lryc.cn/news/261863.html

相关文章:

  • 【数据挖掘 | 关联规则】FP-grow算法详解(附详细代码、案例实战、学习资源)
  • 力扣题目学习笔记(OC + Swift) 11
  • JVM基础入门
  • 前端真的死了吗
  • 前后端分离开发
  • 向量数据库——AI时代的基座
  • 【️什么是分布式系统的一致性 ?】
  • 鸿蒙ArkTS Web组件加载空白的问题原因及解决方案
  • 【Java】网络编程-UDP回响服务器客户端简单代码编写
  • 【设计模式】之工厂模式
  • 70.爬楼梯
  • 【论文解读】ICLR 2024高分作:ViT需要寄存器
  • 【Redis】AOF 基础
  • C语言—每日选择题—Day50
  • [C/C++]——内存管理
  • PDF文件的限制编辑,如何设置?
  • Linux 中使用 docker 安装 Elasticsearch 及 Kibana
  • 在Flutter中使用PhotoViewGallery指南
  • c语言中的static静态(1)static修饰局部变量
  • 生信算法4 - 获取overlap序列索引和序列的算法
  • springboot 学习网站
  • 论文笔记:A review on multi-label learning
  • 接口文档 YAPI介绍
  • LeetCode 300最长递增子序列 674最长连续递增序列 718最长重复子数组 | 代码随想录25期训练营day52
  • Improving IP Geolocation with Target-Centric IP Graph (Student Abstract)
  • 华为技面三轮面试题
  • Linux arm架构下构建Electron安装包
  • 【CCF BDCI 2023】多模态多方对话场景下的发言人识别 Baseline 0.71 NLP 部分
  • 推免那些事
  • 华清远见嵌入式学习——QT——作业2