搭建过程中遇到的问题记录:
1、ubuntu更改端口号
sudo vi /etc/apache2/ports.conf
- 修改监听端口以及主机端口为8080
NameVirtualHost *:8080
Listen 8080
sudo vi /etc/apache2/sites-enabled/000-default.conf
- 修改端口为8080
<VirtualHost *:8080> - 重启apache2
2、apache2 前端页面目录层级太深配置方法:
多目录:
- 先在/etc/apache2下新建一个httpd.conf配置文件
cd /etc/apache2
sudo vim httpd.conf
编辑httpd.conf内容
<VirtualHost *:80>
DocumentRoot /var/www/html/Web1
DirectoryIndex index.html
</VirtualHost>
- 在/etc/apache2 修改 apache2.conf,添加一行:
Include httpd.conf
- 重启 apache2 服务
sudo service apache2 restart
- 修改/etc/apache2/sites-enabled/000-default.conf文件,配置目录指向
Alias "/api" "/var/www/html/api/xxx"
3、nginx反向代理配置
server {
listen 80;
server_name xxx.top;
rewrite ^(.*) https://$server_name$1 permanent;
}
server {
listen 443 ssl;
server_name xxx.top;
#charset koi8-r;
#ssl
ssl_certificate /usr/local/nginx/ssl/9393727_xxx.top.pem;
ssl_certificate_key /usr/local/nginx/ssl/9393727_xxx.top.key;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
#access_log logs/host.access.log main;
location /api {
proxy_pass http://127.0.0.1:9000;
}
标签:web,xxx,nginx,etc,apache2,ssl,反向,conf,server
From: https://www.cnblogs.com/hikk/p/17170149.html