Articles of virtualhost

Apache,从不同于webroot的目录提供子域名

我试图通过Apache从Ubuntu服务器上的共享目录中单独提供两个项目。 整个工具包和kaboodle的目录如下所示: /project /api /app 现在,我想这一切都适合一个VHOST指令,其中api.domain.com服务于/project/api而*.domain.com服务于/app内的目录(它可能会结束public或webroot )。 这可能有点雄心勃勃(或愚蠢的,或不可能)在一个VHOST指令内做到这一点,但我有兴趣看到人们如何去做这样的事情。 也许我只是需要把它分开。 我想合并的理由是两者之间会有共享的Apache指令,唯一真正不同的就是DocumentRoot。 如果可能的话,我宁愿不要在两个VHost中重复这些设置。

Ubuntu 12.10虚拟主机冲突

我在我的服务器上有2个网站。 一个我通过我的IP, xxxx / site1访问 。 另一个是注册域名www.mysite.com。 最初,我只有我的/ etc / apache / sites-available / default文件可用,但是当我尝试加载上面的任何一个网站时,我只是得到了我的/var/www/index.html输出。 我使用下面的代码为mysite.com添加了一个新的虚拟主机: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/mysite <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/mysite> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order […]

configuration2个虚拟主机后,Apache失败

在更改configuration后,Apache不会重新启动。 错误:(98)已经在使用的地址:AH00072:make_sock:无法绑定到地址[::]:80 文件:/etc/apache2/sites-enabled/000-default.conf: Listen 80 <VirtualHost *:80> DocumentRoot /var/www/html ServerName sladie.myserver.com # Other directives here </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html/mydomain.com ServerName www.mydomain.com # Other directives here </VirtualHost> 从Apache Docs获得了这个configuration。 任何想法,为什么这是行不通的?

为什么Apache需要在suEXEC下运行的虚拟主机需要o + x权限?

在Arch Linux上运行Apache 2.4.10。 我试图限制一个SFTP用户只能访问他的主目录,在虚拟主机目录下的一个公用文件夹,而不能访问该虚拟主机目录。 现在,当我以用户身份login时,我仍然可以遍历目录树,并且浏览整个文件系统。 以下是当前权限: drwxr-xr– 6 vhostname vhostname 4096 Apr 23 19:17 . drwxrwxr-x 25 root root 4096 Apr 23 18:43 .. -rw-r–r– 1 vhostname vhostname 21 Apr 23 18:43 .bash_logout -rw-r–r– 1 vhostname vhostname 57 Apr 23 18:43 .bash_profile -rw-r–r– 1 vhostname vhostname 141 Apr 23 18:43 .bashrc drwx–x–x 2 vhostname vhostname […]

VirtualDocumentRoot和CNAME

我们有一个使用VirtualDocumentRoot的apache安装程序。 这是虚拟主机文件 <VirtualHost *:80> ServerName vsweb005.[domain].local ServerAlias *.*.*.vsweb005.[domain].local ServerAlias *.*.*.[domain].co.uk ServerAlias *.*.*.[clientdomain].co.uk UseCanonicalName Off VirtualDocumentRoot /var/www/html/client/%3/%2/%1 SetEnv FX_ENVIRONMENT staging SetEnv FX_CORE_PATH /var/www/master SetEnv FX_CLIENT_PATH /var/www/html/client <Directory /var/www/html/client/*> Options -Indexes +FollowSymlinks +Multiviews Allowoverride All Order allow,deny Allow from All <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Headers "X-Requested-With" </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} […]

在创build虚拟主机时,Apache主服务器不会像httpd.conf中所述的那样默认 – 为什么?

设置Apache服务器时,主服务器部分指出以下内容: # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition. These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All […]

从同一个VirtualHost运行多个站点

我怎样才能使用Apache,从同一个域运行两个不同的网站? 我有两个“部分”的网站是build在不同的东西。 我们有一些内容pipe理,在wordpress中制作的公共组件以及在laravel中制作的网站类似于webapp的部分。 该网站的头版必须击中WordPress的网站,但还有其他部分,如“www.xyz.com/design”,需要击中laravel应用程序。 我怎样才能将某些url指向WordPress的网站以及某些url到laravel网站?

浏览器警告无效的证书,但redirect正确

我在AWS实例上运行apache httpd 2.4。 我有以下的httpdconfiguration: <VirtualHost *:443> ServerName jenkins.example.com SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP SSLCertificateFile /var/lib/jenkins/secrets/test-cert.pem SSLCertificateKeyFile /var/lib/jenkins/secrets/test-key.pem JkMount /* ajp13 </VirtualHost> <VirtualHost *:80> ServerName jenkins.example.com Redirect / https://jenkins.example.com/ </VirtualHost> <VirtualHost *:80> RewriteEngine on RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] </VirtualHost> <VirtualHost *:443> ServerName backoffice.another-example.com SSLEngine on SSLProxyEngine On SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS SSLCertificateFile /etc/certificates/backoffice.another-example.com/cert.pem SSLCertificateChainFile /etc/certificates/backoffice.another-example.com/chain.pem SSLCertificateKeyFile […]

htaccess不工作在Apache 2.4虚拟主机

这是我的apache 2.4虚拟主机configuration <VirtualHost *:80> DocumentRoot /var/www/fd-pro/app-api/public_html ServerName subdomain.domain.com.au ServerAlias subdomain.domain.com.au <Directory /var/www/fd-pro/app-api/public_html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/subdomain-error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/subdomain-access.log combined </VirtualHost> 我也启用了重写模块。 在/ var / www / fd-pro / app-api / public_html中有一个htaccess 话 Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" Header set […]

无法从客户端Ubuntu 16.04 ping主机osx

我在我的osx机器上通过VirtualBox创build了一个Ubuntu-16.04虚拟机。 我正在使用2个networking适配器: Bridged Adapter [en0: Wi-Fi (Airport)]和Host-only Adapter (vboxnet0) 。 这是来自2台机器的ifconfig o / p,首先是osx: en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 3c:15:c2:c8:27:d0 inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255 media: autoselect status: active bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=63<RXCSUM,TXCSUM,TSO4,TSO6> ether 3e:15:c2:8c:a2:00 Configuration: id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0 maxage 0 holdcnt 0 proto stp maxaddr 100 timeout […]