virtualhost

VirtualHost always returns default host with Apache on Ubuntu 14.04

依然范特西╮ 提交于 2019-12-03 02:54:16
问题 I try to setup a virtual host besides the default localhost . Whenever I try to call my virtual host http://test I get the default Apache2 Index file that sits in the directory of http://localhost . Furthermore apache returns this page still after disabling ( a2dissite ) both VirtualHost files an reloading apache ( service apache2 reload ). What could go wrong that the virtual host is not working? Configuration: My directory structure is the following: /var/www/html # Default localhost dir

My websites running in docker containers, how to implement virtual host?

徘徊边缘 提交于 2019-12-03 02:51:45
问题 I am running two websites in two docker containers respectively in a vps. e.g. www.myblog.com and www.mybusiness.com How can I implement virtualhost in the vps so that the two websites can both use port 80. I asked this question somewhere else, and was suggested to take a look at: https://github.com/hipache/hipache and https://www.tutum.co/ They look a bit curving. I am trying to find if there is a straightforward way to achieve that. Thanks! In addition, forgot to mention my vps is a Ubuntu

How to setup mass dynamic virtual hosts in nginx?

风流意气都作罢 提交于 2019-12-03 02:46:19
问题 Been playing with nginx for about an hour trying to setup mass dynamic virtual hosts. If you ever done it in apache you know what I mean. Goal is to have dynamic subdomains for few people in the office (more than 50) 回答1: You will need some scripting knowladge to put this together, i would use php, but if you are good in bash scripting use that. I would do it like this: First create some folder ( /usr/local/etc/nginx/domain.com/ ). In main nginx.conf add command : include /usr/local/etc/nginx

Do I have to duplicate the Virtualhost directives for port 80 and 443?

ⅰ亾dé卋堺 提交于 2019-12-03 01:17:49
问题 I have a long and intricate list of <VirtualHost> directives, and I have to duplicate them into separate <VirtualHost> groups for ports 80 and 443 because I'm using SSL. Whenever I update my mod_rewrite rules I have to remember to do it in both places or else I'll break my app... this duplication is asking for trouble. Is there a way to combine or alias these -- the only difference between the two is that the port 443 version contains the SSLEngine, SSLCertificateFile and the like. My

Apache redirect from one subdomain to another

我的未来我决定 提交于 2019-12-02 18:42:56
问题 Does anyone know a way to do a permanent redirect from a.example.com to b.example.com? I have other subdomains that need to remain as they are though. so: first.example.com -> second.example.com third.example.com is fine fourth.example.com is fine I want to do this in the <VirtualHost> block rather than an .htaccess to avoid having to redeploy again. Any thoughts would be appreciated, thanks 回答1: Add the following RewriteRule to your VirtualHost RewriteEngine On RewriteCond %{HTTP_HOST}

Multiple Sites in Django

人走茶凉 提交于 2019-12-02 18:37:42
Does anyone know how to add multiple domains to Django. I've tried following the guides here Multiple Sites under single Django project with no luck. My configuration looks like this Settings /opt/django/project/settings.py /opt/django/project/domain1_settings.py Url /opt/django/project/urls.py /opt/django/project/domain1_urls.py wsgi /opt/django/project/domain1/domain1.wsgi Apache /etc/httpd/conf.d/django.conf <VirtualHost * > ServerName domain1.co.uk ServerAlias www.domain1.co.uk direct.domain1.co.uk WSGIDaemonProcess domain1 processes=5 python-path=/usr/bin/python threads=1 WSGIScriptAlias

Apache virtual host without domain name

孤街醉人 提交于 2019-12-02 18:25:41
I have a VPS with apache2 installed and I would like to access some PHP projects without a domain name just with the IP address. For example: http://162.243.93.216/projecta/index.php http://162.243.93.216/projectb/index.php I have other projects with domain like example.com, in my directory /var/www/ /html/ info.php /projecta/ /projectb/ /example/ When I go to http://162.243.93.216/info.php then /var/www/html/info.php is opened. My file 000-default.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html <Directory /var/www/> Options Indexes FollowSymLinks MultiViews

Proxying with SSL [closed]

好久不见. 提交于 2019-12-02 17:52:46
I have a Linux host running Apache and a Windows host running IIS. I have a domain that points to the Linux host and need to relay (proxy) requests for it to IIS; I thus have the following virtual host definition in Apache (which works just fine): <VirtualHost 192.168.0.2:80> ServerName www.acme.com DocumentRoot /var/www/acme.com RewriteEngine On RewriteOptions Inherit RewriteRule ^/(.*) http://win.acme.com/$1 [P] </VirtualHost> now I want to add SSL support; the definition becomes: <VirtualHost 192.168.0.2:443> ServerName www.acme.com DocumentRoot /var/www/acme.com GnuTLSEnable On

Does Apache2 support virtual hosting of subdomains?

允我心安 提交于 2019-12-02 17:21:21
Currently my Apache server is set up like so <VirtualHost *:80> ServerName www.example.com ServerAlias example.com DocumentRoot /var/www </VirtualHost> The problem is that everything below /var/www is accessible from everywhere else. If I have a web page /var/www/john/bio.html , then that web page could borrow scripts/pictures from var/www/jane/ I want to set up my Apache server like so <VirtualHost *:80> ServerName www.example.com ServerAlias example.com DocumentRoot /var/www </VirtualHost> <VirtualHost *:80> ServerName www.john.example.com ServerAlias john.example.com DocumentRoot /var/www

How to configure subdomains for Apache2 on Ubuntu?

隐身守侯 提交于 2019-12-02 17:19:20
I followed these instructions to configure subdomains for apache . I can access the subdomain using http://localhost/test though I cannot access it via http://test.localhost . How can I realize the latter? # /etc/apache2/sites-available/test.localhost <VirtualHost *:80> # Server name ServerName test.localhost # Document root DocumentRoot /var/www/test/ # Custom log file locations ErrorLog /var/www/test/logs/error.log CustomLog /var/www/test/logs/access.log combined </VirtualHost> As Mark B already answered correctly the problem was a misconfiguration in /etc/hosts . The correct configuration