Ubuntu 14.04 使用Apache2虚拟主机配置Mantis和Testlink

在同一台服务器上使用Apache2配置多个网站,有三种方式:

(1)基于IP

(2)基于主机名

(3)基于端口

本次配置是基于端口的方式实现的。

1、Mantis和Testlink的配置文件

在目录/etc/apache2/sites-available下复制 000-default.conf分别为 mantis-default.conf testlink-default.conf,修改配置文件内容

mantis-default.conf 如下:

<VirtualHost 192.168.1.22:80>

ServerAdmin webmaster@localhost
ServerName bug.corp.com
DocumentRoot /var/www/mantis


ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

testlink-default.conf如下:

<VirtualHost 192.168.1.22:8081>

ServerAdmin webmaster@localhost
ServerName testlink.corp.com
DocumentRoot /var/www/testlink

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

2、使能Mantis和Testlink虚拟主机配置

配置文件建立使能链接文件

sudo ln -s /etc/apache2/sites-enable/testlink-default.conf /etc/apache2/sites-available/testlink-default.conf

sudo ln -s /etc/apache2/sites-enable/mantis-default.conf /etc/apache2/sites-available/mantis-default.conf

3、增加监听端口

在/etc/apache2/ports.conf中增加listen 8081的端口监听配置,具体如下:

Listen 8081
Listen 80

<IfModule ssl_module>
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>

4、启用Mantis和Testlink虚拟主机配置

使用如下命令:

sudo a2dissite 000-default.conf sudo a2ensite mantis-default.conf sudo a2ensite testlink-default.conf

5、重启Apache2服务,通过浏览器访问服务器对应的端口即可,如果访问80端口可用用,8081端口不能用,请查看是否是防火墙屏蔽该端口,打开该端口即可。

相关文章

1.安装过程出现0x00000000指令引用的0x00000000内存该内存不能为written 如果你安装的是inux系统 需要在...
写在全面:如果根据以下教程涉及到只读文件需要更改文件权限才能需修改文件内容,参考我的另一篇博客:...
写在前面:以下步骤中需要在终端输入命令,电脑端查看博客的朋友可以直接复制粘贴到终端,手机端查看的...
ubuntu16.04和18.04更换国内源 写在前面:安装好ubuntu双系统后,默认的软件更新源是国外的,在国内使用...
ubuntu双系统启动时卡死解决办法(在ubuntu16.04和18.04测试无误) 问题描述: 在安装完ubuntu双系统后...
又来造轮子了。。。。。。。。。。。。。。。。 今天使用w3af向文件中写入的时候,发现没有write权限,...