728x90
Port in a micro site URL not supported
Steps to reproduce:
1. Create 2 Apache virtual hosts:
<VirtualHost *:8087>
DocumentRoot "/Users/myuser/sites/drupal-micro_site/web"
ServerName micro.site
ServerAlias www.micro.site
ErrorLog "/usr/local/var/log/httpd/sites.local-error_log"
CustomLog "/usr/local/var/log/httpd/sites.local-access_log" common
DirectoryIndex index.php
<Directory "/Users/myuser/sites/drupal-micro_site/web">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:8087>
DocumentRoot "/Users/myuser/sites/drupal-micro_site/web"
ServerName site-one.com
ServerAlias www.site-one.com
ErrorLog "/usr/local/var/log/httpd/sites.local-error_log"
CustomLog "/usr/local/var/log/httpd/sites.local-access_log" common
DirectoryIndex index.php
<Directory "/Users/myuser/sites/drupal-micro_site/web">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
2. Add the following in the /etc/hosts file:
127.0.0.1 micro.site
127.0.0.1 site-one.com
3. Install a fresh Drupal installation with composer:
composer create-project drupal/recommended-project drupal-micro_site --no-interaction
Install micro_site and micro_node with composer:
composer require drupal/micro_site
composer require drupal/micro_node
Enable micro_site and micro_node
4. Add the following code in settings.php:
$dir_hosts = $app_root . '/' . $site_path . '/hosts';
if (file_exists($dir_hosts) && is_dir($dir_hosts)) {
foreach (glob($dir_hosts . '/*.host.php') as $filename) {
include $filename;
}
}
5. Add the base URL, the base scheme and the public URL in /admin/config/micro_site/settings
6. Rebuild permissions
7. Add a site type "Generic" in /admin/structure/sites/add
8. Add a registered site "Site One" in /admin/content/site
9. Get the following:
While ping site-one.com is OK.
I'm wondering if using a different port from 80 could cause the issue (I can't test it on my machine).
728x90
반응형
'컴퓨터 활용(한글, 오피스 등) > 50_2.운영체제_리눅스' 카테고리의 다른 글
리눅스_우분투_PAAS-TA BOSH (0) | 2022.12.02 |
---|---|
리눅스_우분투_PaaS-Ta 구축 (0) | 2022.12.02 |
리눅스_아파치 포트 변경 (0) | 2022.12.01 |
리눅스_우분투_두루팔9 설치 (1) | 2022.12.01 |
리눅스_쉘 스크립트_반복문(for 문) (0) | 2022.12.01 |