Ubuntu mediawiki 1.27.0的多个apache端口
我已经运行Mediawiki好几年了。我的服务器运行两个端口:活动站点的端口Ubuntu mediawiki 1.27.0的多个apache端口,ubuntu,apache2,mediawiki,Ubuntu,Apache2,Mediawiki,我已经运行Mediawiki好几年了。我的服务器运行两个端口:活动站点的端口80,测试站点的端口81,在“上线”之前升级MW软件时使用。直到最近,我才发现这个设置有任何问题。两个端口都运行良好,包括在端口81上进行了MW 1.27 Alpha的早期测试。现在我正试图安装MW 1.27.0(稳定版),我遇到了一些问题 由于某些原因,我只能在一个端口上获得http服务。如果我重新启动Apache,任何一个端口都将提供内容,但只有该端口,而且它始终是我访问的第一个端口。另一个会给出一些PHP错误。例如
80
,测试站点的端口81
,在“上线”之前升级MW软件时使用。直到最近,我才发现这个设置有任何问题。两个端口都运行良好,包括在端口81上进行了MW 1.27 Alpha的早期测试。现在我正试图安装MW 1.27.0(稳定版),我遇到了一些问题
由于某些原因,我只能在一个端口上获得http服务。如果我重新启动Apache,任何一个端口都将提供内容,但只有该端口,而且它始终是我访问的第一个端口。另一个会给出一些PHP错误。例如:重新启动Apache并转到端口81上的站点。工作正常,但是端口80
站点给出了一个PHP错误。不做任何更改,但重新启动Apache并转到端口80站点;工作正常,但81端口站点现在出现PHP错误。两个站点都给出了不同的PHP错误,但总是相同的错误
这显然与我的Apache设置有关,但我不知道是什么。它在过去是有效的,没有改变。操作系统或Apache应用程序文件没有任何更改/更新。端口在apache2/Ports.conf
中定义,两个站点分别在VirtualHosts
conf文件中定义
这两个站点都已启用,Apache已读取配置文件(/usr/sbin/apache2-S
)
netstat-lep--tcp
显示端口80
和81
正在被积极监听,但这两个事实有些不相干,因为我已经证明两个端口都可以服务,只是不能同时服务。我已经检查了apache错误日志文件,但其中只记录了PHP错误
我应该补充一点,服务器有一个运行另一个端口(8083)的第三个站点,该端口工作正常。所有三种配置都是可比较的,只是在任何指定的路径(例如DocumentRoot
)和端口号上有所不同
有人有什么建议吗
代码:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 0.0.0.0:80
Listen 0.0.0.0:81
Listen 0.0.0.0:8083
Listen 0.0.0.0:8080
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
#Variable to store the top level server name
Define TL_ServerName lgsim
<VirtualHost *:81>
ServerAdmin abc@myDomain.com
DocumentRoot /var/www/wiki_test
# ServerName 44.80.10.2
ServerName ${TL_ServerName}
ServerAlias ${TL_ServerName}
DirectoryIndex index.php # lgsim_redirect.html
Alias /w /var/www/wiki_test
Alias /wiki /var/www/wiki_test/index.php
Alias /error_html/ /var/www/html/error_html/
Alias /addSearch/ /var/www/html/addSearch/
<Directory "/var/www/wiki_test">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# For security, deny access to the MW config directory.
# Comment this out if you're running an upgrade.
# <Directory "/var/www/wiki_test/mw-config">
# Order allow,deny
# Deny from all
# </Directory>
<Directory "/var/www/wiki_test/images">
Options -Indexes
</Directory>
ErrorDocument 404 /error_html/custom404.html
ErrorLog ${APACHE_LOG_DIR}/wiki_test_error.log
CustomLog ${APACHE_LOG_DIR}/wiki_test_access.log combined
</VirtualHost>
ports.conf:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 0.0.0.0:80
Listen 0.0.0.0:81
Listen 0.0.0.0:8083
Listen 0.0.0.0:8080
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
#Variable to store the top level server name
Define TL_ServerName lgsim
<VirtualHost *:81>
ServerAdmin abc@myDomain.com
DocumentRoot /var/www/wiki_test
# ServerName 44.80.10.2
ServerName ${TL_ServerName}
ServerAlias ${TL_ServerName}
DirectoryIndex index.php # lgsim_redirect.html
Alias /w /var/www/wiki_test
Alias /wiki /var/www/wiki_test/index.php
Alias /error_html/ /var/www/html/error_html/
Alias /addSearch/ /var/www/html/addSearch/
<Directory "/var/www/wiki_test">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# For security, deny access to the MW config directory.
# Comment this out if you're running an upgrade.
# <Directory "/var/www/wiki_test/mw-config">
# Order allow,deny
# Deny from all
# </Directory>
<Directory "/var/www/wiki_test/images">
Options -Indexes
</Directory>
ErrorDocument 404 /error_html/custom404.html
ErrorLog ${APACHE_LOG_DIR}/wiki_test_error.log
CustomLog ${APACHE_LOG_DIR}/wiki_test_access.log combined
</VirtualHost>
#如果您只是在此处更改端口或添加更多端口,您也可能
#必须更改中的VirtualHost语句
#/etc/apache2/sites enabled/000-default.conf
听0.0.0.0:80
听0.0.0.0:81
听0.0.0.0:8083
听0.0.0.0:8080
听我说
听我说
#vim:syntax=apachets=4sw=4sts=4srnoet
wiki.conf:
注意:出于业务/安全原因,ServerAdmin变量已被更改
#Variable to store the top level server name
Define TL_ServerName lgsim
<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.com
ServerAdmin abc@myDomain.com
DocumentRoot /var/www/wiki
ServerName ${TL_ServerName}
# ServerName 44.80.10.2
ServerAlias ${TL_ServerName}
DirectoryIndex index.php lgsim_redirect.html
Alias /w /var/www/wiki
Alias /wiki /var/www/wiki/index.php
Alias /error_html/ /var/www/html/error_html/
Alias /addSearch/ /var/www/html/addSearch/
<Directory "/var/www/wiki">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# For security, deny access to the MW config directory.
# Comment this out if you're running an upgrade.
<Directory "/var/www/wiki/mw-config">
Order allow,deny
Deny from all
</Directory>
<Directory "/var/www/wiki/images">
Options -Indexes
</Directory>
ErrorDocument 404 /error_html/custom404.html
#ErrorLog ${APACHE_LOG_DIR}/error.log
#CustomLog ${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.conf
</VirtualHost>
# Template for the virtual host alias currently in use
<Macro VHost $name $redirectURL>
<VirtualHost *:80>
DocumentRoot "/var/www/wiki"
ServerName $name
Redirect permanent / $redirectURL
</VirtualHost>
</Macro>
#
#Landing Gear Virtual Hosts
#
Use VHost LG http://${TL_ServerName}/wiki/LG:Main_Page
Use VHost LGSIM http://${TL_ServerName}/wiki/LGSIM:Main_Page
Use VHost LGMS http://${TL_ServerName}/wiki/LGMS:Main_Page
UndefMacro VHost
#用于存储顶级服务器名称的变量
定义TL_服务器名lgsim
#ServerName指令设置请求方案、主机名和端口
#服务器使用来标识自身。这在创建时使用
#重定向URL。在虚拟主机的上下文中,服务器名
#指定必须在请求的主机:标头中显示的主机名
#匹配此虚拟主机。对于默认虚拟主机(此文件),此
#该值不是决定性的,因为它被用作最后的宿主。
#但是,必须为任何其他虚拟主机显式设置它。
#服务器名www.example.com
服务器管理员abc@myDomain.com
DocumentRoot/var/www/wiki
ServerName${TL_ServerName}
#服务器名44.80.10.2
服务器别名${TL_ServerName}
DirectoryIndex.php lgsim_redirect.html
别名/w/var/www/wiki
别名/wiki/var/www/wiki/index.php
别名/error\u html//var/www/html/error\u html/
别名/addSearch//var/www/html/addSearch/
选项索引如下SYMLINKS包括ExecCGI
允许超越所有
命令允许,拒绝
通融
#为了安全起见,请拒绝对MW config目录的访问。
#如果您正在运行升级,请将其注释掉。
命令允许,拒绝
全盘否定
选项-索引
ErrorDocument 404/error\u html/custom404.html
#ErrorLog${APACHE_LOG_DIR}/error.LOG
#CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
#对于conf/available/中的大多数配置文件
#在全局级别启用或禁用,可以
#仅包含一个特定虚拟主机的行。例如
#以下行仅为此主机启用CGI配置
#在使用“A2F”全局禁用后。
#包括conf available/service-cgi-bin.conf
#当前正在使用的虚拟主机别名的模板
DocumentRoot“/var/www/wiki”
ServerName$name
重定向永久/$redirectURL
#
#起落架虚拟主机
#
使用VHost LG http://${TL_ServerName}/wiki/LG:Main_页面
使用VHost-LGSIM http://${TL_-ServerName}/wiki/LGSIM:Main_页面
使用VHost-LGMS http://${TL_-ServerName}/wiki/LGMS:Main_页面
未定义宏VHost
newWiki.conf:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 0.0.0.0:80
Listen 0.0.0.0:81
Listen 0.0.0.0:8083
Listen 0.0.0.0:8080
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
#Variable to store the top level server name
Define TL_ServerName lgsim
<VirtualHost *:81>
ServerAdmin abc@myDomain.com
DocumentRoot /var/www/wiki_test
# ServerName 44.80.10.2
ServerName ${TL_ServerName}
ServerAlias ${TL_ServerName}
DirectoryIndex index.php # lgsim_redirect.html
Alias /w /var/www/wiki_test
Alias /wiki /var/www/wiki_test/index.php
Alias /error_html/ /var/www/html/error_html/
Alias /addSearch/ /var/www/html/addSearch/
<Directory "/var/www/wiki_test">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# For security, deny access to the MW config directory.
# Comment this out if you're running an upgrade.
# <Directory "/var/www/wiki_test/mw-config">
# Order allow,deny
# Deny from all
# </Directory>
<Directory "/var/www/wiki_test/images">
Options -Indexes
</Directory>
ErrorDocument 404 /error_html/custom404.html
ErrorLog ${APACHE_LOG_DIR}/wiki_test_error.log
CustomLog ${APACHE_LOG_DIR}/wiki_test_access.log combined
</VirtualHost>
#用于存储顶级服务器名称的变量
定义TL_服务器名lgsim
服务器管理员abc@myDomain.com
DocumentRoot/var/www/wiki\u test
#服务器名44.80.10.2
ServerName${TL_ServerName}
服务器别名${TL_ServerName}
DirectoryIndex.php#lgsim_redirect.html
别名/w/var/www/wiki\u test
别名/wiki/var/www/wiki_test/index.php
别名/error\u html//var/www/html/error\u html/
别名/addSearch//var/www/html/addSearch/
选项索引如下SYMLINKS包括ExecCGI
允许超越所有
命令允许,拒绝
通融
#为了安全起见,请拒绝对MW config目录的访问。
#如果您正在运行升级,请将其注释掉。
#
#命令允许,拒绝
#全盘否定
#
选项-索引
ErrorDocument 404/error\u html/custom404.html
ErrorLog${APACHE\u LOG\u DIR}/wiki\u test\u error.LOG
CustomLog${APACHE\u LOG\u DIR}/wiki\u test\u access.LOG组合
显示什么php错误?也许你也应该粘贴你的VirtualHosts配置:)我稍后会添加PHP错误,因为这涉及到将网站离线。