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

前端之家收集整理的这篇文章主要介绍了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端口不能用,请查看是否是防火墙屏蔽该端口,打开该端口即可。

原文链接:https://www.f2er.com/ubuntu/354679.html

猜你在找的Ubuntu相关文章