AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[web](server)

Martin Hope
ltwally
Asked: 2022-04-04 04:17:15 +0800 CST

通过 Powershell 下载 Sharepoint Online 文件

  • -1

我接到了一个项目,我们的营销部门在该项目中生成图像,每个工作站和笔记本电脑都需要在启动或登录时下载这些图像。(壁纸文件夹、屏保图像等)

我想使用 Sharepoint Online 存储带有图像的可公开访问(无需登录)文件夹,然后使用 Powershell 获取内容。

我发现的每个示例都需要一个管理单元或模块。

有谁知道香草Powershell将公开可用的SO文件夹的内容复制到本地磁盘的直接方式?

谢谢!

sharepoint powershell web
  • 1 个回答
  • 366 Views
Martin Hope
Bashar Nassri
Asked: 2021-02-21 07:34:30 +0800 CST

我的网站上的 3306 端口已关闭,我该如何打开它?

  • 0

我有一个 vb.net 桌面应用程序。我需要在我的网站上向数据库中插入一些数据。尝试添加数据时出现此错误:“无法连接到任何指定的 MySQL 主机”

当我从其他网站尝试其他 IP 共享 IP 时,它可以工作。但它不适合我的网站..

我在这个https://www.yougetsignal.com/tools/open-ports/上检查了它,它告诉我端口 3306 在“我的 IP 地址”上已关闭

这是我的连接字符串如下所示:

服务器=我的网站IP;端口=3306;数据库=数据库名;Uid=用户名;密码=密码;

你能帮我吗..谢谢..

mysql web vb.net
  • 2 个回答
  • 1630 Views
Martin Hope
Elin Digente
Asked: 2020-07-25 14:03:13 +0800 CST

将 htaccess 转换为 Nginx ReWrite(自动转换不起作用)

  • 1

嗨,有人碰巧知道 Nginx 重写规则吗?

我正在尝试将此 Apache .htaccess 转换为 Nginx Rewrite,我已经尝试过使用在线转换器

登录后主页和仪表板工作正常,但:新闻、列表、视频、音乐、民意调查和测验部分无法正常工作,他们给出 404

我有 32 小时不间断不睡觉设置服务器它让我发疯

任何帮助将不胜感激

这是我要转换的 Apache .htaccess:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ index.php?link1=home [NC,QSA]
RewriteRule ^news/(.*)$ index.php?link1=news&id=$1 [NC,QSA]
RewriteRule ^lists/(.*)$ index.php?link1=lists&id=$1 [NC,QSA]
RewriteRule ^polls/(.*)$ index.php?link1=polls&id=$1 [NC,QSA]
RewriteRule ^quiz/(.*)$ index.php?link1=quiz&id=$1 [NC,QSA]
RewriteRule ^videos/(.*)$ index.php?link1=videos&id=$1 [NC,QSA]
RewriteRule ^music/(.*)$ index.php?link1=music&id=$1 [NC,QSA]
RewriteRule ^edit-post/(.*)$ index.php?link1=edit-post&id=$1 [NC,QSA]
RewriteRule ^delete-post/(.*)$ index.php?link1=delete-post&id=$1 [NC,QSA]
RewriteRule ^settings/(.*)/(.*)$ index.php?link1=settings&page=$1&user=$2 [NC,QSA]
RewriteRule ^settings/(.*)$ index.php?link1=settings&page=$1 [NC,QSA]
RewriteRule ^admin-cp$ admincp.php [NC,QSA]
RewriteRule ^admin-cp/(.*)$ admincp.php?page=$1 [NC,QSA]
RewriteRule ^admincp/(.*)$ index.php?link1=admincp&page=$1 [NC,QSA]
RewriteRule ^admin-cdn/(.*)$ admin-panel/$1 [L]
RewriteRule ^tags/(.*)$ index.php?link1=tags&tag=$1 [NC,QSA]
RewriteRule ^feeds/rss(/?|)$ index.php?link1=feeds&page=home [NC,QSA]
RewriteRule ^post_data/(.*)/(.*)(/?|)$ index.php?link1=post_data&post_type=$1&id=$2 [NC,QSA]

RewriteRule ^terms/(.*)$ index.php?link1=terms&type=$1 [NC,QSA]
RewriteRule ^go_pro(?:\/{0,1}|)$ index.php?link1=go_pro [NC,QSA]

RewriteRule ^latest-(.*)/(\d+)$ index.php?link1=latest-$1&c_id=$2 [NC,QSA]
RewriteRule ^latest-(.*)/rss(/?|)$ index.php?link1=rss&page=$1 [NC,QSA]

RewriteRule ^ads(?:\/?|)$ index.php?link1=ads [NC,QSA]
RewriteRule ^ads/create-new(?:\/?|)$ index.php?link1=create_ad [NC,QSA]
RewriteRule ^ads/edit/([0-9]+)(?:\/?|)$ index.php?link1=edit_ad&ad_id=$1 [NC,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^@([^\/]+)(\/|)$ index.php?link1=profile&u=$1 [QSA]
RewriteRule ^@([^\/]+)(\/|)/(.*)$ index.php?link1=profile&u=$1&page=$2 [QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\/]+)(\/|)$ index.php?link1=$1 [QSA]

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>

这是自动转换的文件(部分工作,在我的一些版本之后,基于 3 小时阅读 Nginx 文档)

location / {
  if (!-e $request_filename){
    rewrite ^/$ /index.php?link1=home;
  }
  rewrite "^/go_pro(?:\/{0,1}|)$" /index.php?link1=go_pro;
  if (!-e $request_filename){
    rewrite ^/@([^\/]+)(\/|)$ /index.php?link1=profile&u=$1;
  }
  rewrite ^/@([^\/]+)(\/|)/(.*)$ /index.php?link1=profile&u=$1&page=$2;
  if (!-e $request_filename){
    rewrite ^/([^\/]+)(\/|)$ /index.php?link1=$1;
  }
}


(**_not working from here and below news, list, video, music, polls and quiz sections_**)

location /news {
  rewrite ^/news/(.*)$ /index.php?link1=news&id=$1;
}

location /lists {
  rewrite ^/lists/(.*)$ /index.php?link1=lists&id=$1;
}

location /polls {
  rewrite ^/polls/(.*)$ /index.php?link1=polls&id=$1;
}

location /quiz {
  rewrite ^/quiz/(.*)$ /index.php?link1=quiz&id=$1;
}

location /videos {
  rewrite ^/videos/(.*)$ /index.php?link1=videos&id=$1;
}

location /music {
  rewrite ^/music/(.*)$ /index.php?link1=music&id=$1;
}

location /edit {
  rewrite ^/edit-post/(.*)$ /index.php?link1=edit-post&id=$1;
}

location /delete {
  rewrite ^/delete-post/(.*)$ /index.php?link1=delete-post&id=$1;
}

location /settings {
  rewrite ^/settings/(.*)/(.*)$ /index.php?link1=settings&page=$1&user=$2;
  rewrite ^/settings/(.*)$ /index.php?link1=settings&page=$1;
}

(**_admin panel and the other admin, term, ads, latest,tags and feed and all rest sections below this line work fine_**)

location /admin {
  rewrite ^/admin-cp$ /admincp.php;
  rewrite ^/admin-cp/(.*)$ /admincp.php?page=$1;
}

location /admincp {
  rewrite ^/admincp/(.*)$ /index.php?link1=admincp&page=$1;
}

location /admin-cdn/ {
  alias /admin-panel/;
}

location /tags {
  rewrite ^/tags/(.*)$ /index.php?link1=tags&tag=$1;
}

location /feeds {
  rewrite ^/feeds/rss(/?|)$ /index.php?link1=feeds&page=home;
}

location /post_data {
  rewrite ^/post_data/(.*)/(.*)(/?|)$ /index.php?link1=post_data&post_type=$1&id=$2;
}

location /terms {
  rewrite ^/terms/(.*)$ /index.php?link1=terms&type=$1;
}

location /latest {
  rewrite ^/latest-(.*)/(\d+)$ /index.php?link1=latest-$1&c_id=$2;
  rewrite ^/latest-(.*)/rss(/?|)$ /index.php?link1=rss&page=$1;
}

location /ads {
  rewrite ^/ads(?:\/?|)$ /index.php?link1=ads;
  rewrite ^/ads/create-new(?:\/?|)$ /index.php?link1=create_ad;
  rewrite ^/ads/edit/([0-9]+)(?:\/?|)$ /index.php?link1=edit_ad&ad_id=$1;
}

如果我在问题中犯了任何错误;请原谅我几乎没有醒来,我是一名电子工程师,正在尝试为我的物联网设备设置服务器前端和后端;我不是程序员,但我非常钦佩他们,学习了一些基本的 WebDeV,但这是我第一次使用 Nginx 编码不是我的强项,并不是每个人都对我很好https://stackoverflow.com/questions/63078446/converting -htaccess-to-nginx-rewrite-autoconverting-not-working?noredirect=1#comment111550833_63078446

任何帮助将不胜感激提前谢谢

rewrite .htaccess web nginx ngx-http-rewrite-module
  • 1 个回答
  • 299 Views
Martin Hope
DragShot
Asked: 2020-05-29 16:56:48 +0800 CST

如何在保持 8080 对 Internet 关闭的同时将端口 80 重定向到 8080?

  • 3

我有一个运行 CentOS 的虚拟机和一个用于托管我在那里部署的随机服务的 Web 服务器,所以为了使它可以从 Internet 访问,我使用iptables. 由于 Web 服务器本身在非root的专用用户下作为服务运行,因此无法直接使用端口 80。因此,在阅读完文档后,我添加了从端口 80 到 8080 的重定向,以便 Web 服务器可以绑定到该端口(我确实计划稍后添加对 HTTPS 的支持,也许我会购买一个合适的域,然后使用 Let's加密什么的)。

到目前为止它工作正常,但最近我注意到端口 8080 也保持开放状态,因此任何针对端口 80 或 8080 的请求都会得到相同的响应。问题是,我只需要从外部访问端口 80,因为我的提供商以某种方式考虑让端口 8080 开放某种潜在的滥用?无论哪种方式,我都不希望定向到端口 8080 的外部请求得到响应,只有那些以端口 80 为目标的请求才能得到响应。

到目前为止,这就是我的配置文件的iptables样子:

*nat
:PREROUTING ACCEPT [89:7936]
:INPUT ACCEPT [70:3812]
:OUTPUT ACCEPT [41:2756]
:POSTROUTING ACCEPT [41:2756]
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
COMMIT
*filter
:INPUT ACCEPT [916:134290]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [819:117300]
:f2b-sshd - [0:0]
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8080 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

我尝试删除打开端口 8080 的规则,但重新加载后iptables服务器也不会响应来自端口 80 的请求。最近,我一直在考虑添加另一个重定向规则,将源 IP 更改为特定的东西以在端口 8080 中接受,但我不确定这是否可行。我需要这里的指导。

注意:我对这个工具不太熟悉,这是我怀疑的主要来源。另外,也许我遗漏了一些可能有用的规则,因此我们将不胜感激下面评论中对新规则的任何建议。

http port-forwarding web iptables
  • 3 个回答
  • 5579 Views
Martin Hope
Yevgeniy Afanasyev
Asked: 2018-12-21 16:16:39 +0800 CST

使用 host = "><script>alert('quallys_xss_joomla_2.5.3')</script> 发布请求

  • 0

在我的网络服务器上,昨天我收到了一个POST带有以下文本的请求host

"><script>alert('qualys_xss_joomla_2.5.3')</script>

完全是这样的

headers
{
  ...
  "host": "%22%3e%3cscript%3ealert('qualys_xss_joomla_2.5.3')%3c%2fscript%3e",
  "x-forwarded-port": "443",
  "x-forwarded-proto": "https",
  ...
}
httpMethod
POST

是黑客攻击吗?它的目的是什么?

web
  • 1 个回答
  • 347 Views
Martin Hope
Dominique
Asked: 2017-03-18 11:33:56 +0800 CST

电子邮件可路由域?

  • 1

我正在考虑为我的 Microsoft Exchange 实验室设置购买一个域,因为我想了解一家实际公司的运作方式。我的意思是,我希望能够向/从外部来源发送和接收电子邮件。

我正在查看一些交易,最便宜的域名以 .xyz 或 .email 等结尾(其他非标准根)。我想知道这些是否实际上是可路由的电子邮件 - 例如,您可以从 .xyz 域发送/接收电子邮件吗?还是我应该考虑购买一个实际的 .com、.net 或 .co.uk 域?

我知道我还需要一个 SSL 证书才能工作,所以我试图将成本降到最低,因此我倾向于购买 .xyz 域,因为它更便宜。

谢谢你。

email exchange web godaddy domains
  • 1 个回答
  • 262 Views
Martin Hope
Andrey Melnik
Asked: 2017-03-16 03:52:12 +0800 CST

从 IPv6 地址连接到 IPv4 服务器

  • 4

我有一台同时具有 IPv6 和 IPv4 地址的服务器。是否可以通过IPv6接口通过 HTTP 连接到另一个 Web 服务器(我只知道它的 IPv4 地址),以便该服务器只能看到我的 IPv6 IP 作为源地址?

networking web ipv6
  • 2 个回答
  • 13748 Views
Martin Hope
jbrahy
Asked: 2017-03-11 11:26:10 +0800 CST

在命名中使用 ip 为每个客户端自动专用 access_log

  • 0

我们有一个内部应用程序,我想让 apache httpd 服务器根据每个客户端 ips 创建新的日志文件。在我看到的文档中,您可以有多个日志。

http://httpd.apache.org/docs/2.2/logs.html

LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common
CustomLog logs/referer_log "%{Referer}i -> %U"
CustomLog logs/agent_log "%{User-agent}i"

但我真正想要的是这样的。

CustomLog logs/%h-access_log common

其中 %h 被推断为 IP 地址,即 1.1.1.1-access_log

我想有一种 mod_perl 方法可以做到这一点,但只是想知道在我编写模块之前是否有人知道通过标准配置来做这样的事情。

http apache-2.2 configuration web mod-perl
  • 1 个回答
  • 86 Views
Martin Hope
Purlek
Asked: 2017-02-24 19:59:57 +0800 CST

全新的 Ubuntu 16.04 Nginx 配置服务于旧的静态文件

  • 2

我的域有一个非常基本的登录页面。在过去的几天里,我一直在与一个非常特殊的问题作斗争。

例如,该目录包含:

vanilla>
    ./files/
    ./index.html
    ./main_style.css

    files>
        ./back.gif
        ./back1.gif
        ./logo.png

index.html 的内容:

<!DOCTYPE html>
<html>

    <head>
        <title>Vanilla</title>
        <link rel="stylesheet" type="text/css" href="main_style.css"/>
    </head>

<body>

    <div>
        <img class="logo" src="files/logo.png" />
    </div>

</body>
</html>

main_style.css 的内容:

html {
    background-image: url("files/back1.gif");
    background-repeat: repeat;
}

img.logo {
    width: 471px;
    height: 384px;
    position: absolute;
    top: 50%;
    left:  50%;
    margin-left: -235px;
    margin-top: -192px;
}

我面临的问题是:

在重新启动或类似的事情之后,我打开网站,所有静态文件都正确加载到服务器上存在的版本。

但是,除此之外,例如,如果我对 main_style.css 进行更改,它不会反映任何更改。即使在我的浏览器中打开 main_style.css 也不会反映更改,它会显示文件的旧版本。

同样在最近,我将一张照片从 test.png 重命名为 logo.png,并在 index.html 中进行了相应的更改。index.html 文件反映了适当的更改,但是,它没有看到照片“logo.png”,并返回 404 错误……它显然在 web 根目录中,但没有提供。即便如此,我仍然可以通过 URL 访问旧照片“test.png”,即使服务器上不存在这样的文件。

我试过的:

我知道这个问题在某种程度上肯定与缓存有关,并且我在搜索中尝试了许多网络上的解决方案,但似乎都没有对我的系统产生任何影响。

我还看到,在许多情况下,这种情况可能是由 VirtualBox 或称为 Vagrant VM 的东西引起的。我的机器从来没有运行过这些东西,而我的服务器正在我办公桌下的物理 PC 上运行。

我认为这个问题可能是由于我运行了 100 多个更新引起的,因为我有一段时间没有运行我的服务器,所以我竟然从服务器备份了我的个人数据和 Web 数据并重新安装了操作系统到最新版本,然后从那里重新安装软件。

我刚刚完成,并重新配置了所有的网络软件,但可以肯定的是,它仍然有同样的问题。

重新安装操作系统后,我在机器上安装的唯一东西是:

  • openssh 服务器
  • 桑巴
  • nginx
  • mysql服务器
  • php-fpm
  • php-mysql

我读过这可以通过将nginx.conf 文件中的sendfile设置为off来解决,但这并没有解决任何问题。

我的 nginx.conf 文件和 php.ini 文件都是默认的。

nginx.conf:

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

站点配置:

server {
        listen 80;
        root /usr/share/nginx/vanilla/;
        index index.html index.php index.htm;
        server_name www.website.com website.com;
        keepalive_timeout 10000;
        client_max_body_size 1024M;

        location / {
                try_files $uri $uri/ =404;
                #try_files $uri $uri/ /index.php?$args;
        }


        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }

}
cache web-server web nginx static-files
  • 1 个回答
  • 797 Views
Martin Hope
tread
Asked: 2016-09-13 07:09:24 +0800 CST

为什么在 Apache 上创建新的 TCP 会话时,请求的 TTFB 长 5 倍?

  • 2

在对使用 提供的图像进行测试时apache,我注意到创建新会话时:

Waiting (TTFB): 1.09s Initial connection + SSL handshake: 370ms DNS Lookup:165ms

但随后使用持久连接:

Waiting (TTFB): 187ms Content Download:4ms

因此,我们发现TTFB新连接的平均时间是非持久连接的 5 倍。这是正常的吗?

附带问题:为什么只有在有新连接时才进行新的 DNS 查找?

web-server web apache-2.4
  • 1 个回答
  • 826 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve