我最近使用Mapserver建立了一个网站进行学术课程。该课程已经完成,但我想继续开发它。该网站使用在Debian 11上运行的Apache/2.4.53(Debian),该网站作为虚拟主机设置。
我最近使用Let's Encrypt安装了HTTP。
该网站使用http( http://kina3.net/ )或https( https://kina3.net/ ),所以我知道https正在工作。
使用: http:/// kina3.net/cgi-bin/mapserv?map=blueMarble&Amp;mode=map
但是,当我尝试使用 https://kina3.net/cgi-bin/mapserv?map=blueMarble&mode=map 它会生成以下错误:
MSLOADMAP():正则表达式错误。 。
MS_DEFAULT_MAPFILE_PATTERN验证失败 这个问题是因为“地图位置缺少或错误格式化” 。
但是,在Apache2中,VirtualHosts配置文件两个引用指向同一mapfile。请参阅下面的站点配置文件中的摘录:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName kina3.net
ServerAlias www.kina3.net
# Redirect permanent / https://kina3.net
DocumentRoot /var/www/kina3.net
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SetEnv bluemarble "/var/www/map/bluemarble.map"
</VirtualHost>
### ERROR LOGS IN /var/log/apache2/access.log ###
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName kina3.net
ServerAlias www.kina3.net
DocumentRoot /var/www/kina3.net
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /****
SSLCertificateKeyFile /****
Include /****
SetEnv bluemarble "/var/www/map/bluemarble.map"
</VirtualHost>
我缺少什么?
I have recently built a website using MapServer for an academic course. The course is finished, but I wanted to continue developing it. The website is using Apache/2.4.53 (Debian), running on Debian 11, set up as a Virtual Host.
I have recently installed https using Let's Encrypt.
The website works when using either http (http://kina3.net/) or https (https://kina3.net/), so I know that https is working.
I can serve up a example file through MapServer when using: http://kina3.net/cgi-bin/mapserv?map=bluemarble&mode=map
However when I try using https://kina3.net/cgi-bin/mapserv?map=bluemarble&mode=map it generates the following error:
msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed.
My research (MS_DEFAULT_MAPFILE_PATTERN validation failed) suggests that problem is because "The map location is missing or wrongly formatted".
However in the apache2 VirtualHosts config file both references point to the same mapfile. See extract from site configuration file below:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName kina3.net
ServerAlias www.kina3.net
# Redirect permanent / https://kina3.net
DocumentRoot /var/www/kina3.net
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SetEnv bluemarble "/var/www/map/bluemarble.map"
</VirtualHost>
### ERROR LOGS IN /var/log/apache2/access.log ###
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName kina3.net
ServerAlias www.kina3.net
DocumentRoot /var/www/kina3.net
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /****
SSLCertificateKeyFile /****
Include /****
SetEnv bluemarble "/var/www/map/bluemarble.map"
</VirtualHost>
What am i missing?
发布评论
评论(1)
我设法解决了这个问题……这不是光荣的。事实证明,我运行了两个VirtualHosts文件,另一个文件优先。因此,我在上面的VH示例中进行的任何更改都将没有任何效果,因为另一个优先考虑。
因此,如果您发现自己与我有类似的问题,请尝试运行:
并查看
VirtualHost配置:
指向的内容。另外,一旦您在Stackoverflow上发布了指向自己网站的链接,请期待Web刮板和各种阴暗的IP地址的定期访问。
I managed to fix this problem ... and it's not glorious. Turns out that I had two VirtualHosts files running, with the other one taking precedence. So whatever changes I made in the VH example above would have no effect as the other took precedence.
So if you find yourself with a similar problem to me, try running:
and see what the
VirtualHost configuration:
is pointing to.Also, once you post a link to your own website on StackOverflow, expect regular visits from web scrapers plus various shady IP addresses.