I need help setting up a drupal 7 multisite. I used vhosts-gen template and I hardcoded the virtual hosts.
I added the DNS entries. Where shall I create the htdocs symbolic link?
This is my vhosts template:
vhost: |
<VirtualHost *:80>
ServerName site1.loc
ServerAlias site1.loc
ErrorLog /var/log/apache/site1-error_log
CustomLog /var/log/apache/site1-access_log combined
DirectoryIndex /index.php index.php
DocumentRoot /shared/httpd/multisites/htdocs
Allow from all
Order Deny,Allow
<Directory /shared/httpd/multisites/htdocs>
DirectoryIndex index.php
AddType application/x-httpd-php .php
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
Require all granted
<VirtualHost *:80>
ServerName site2.loc
ServerAlias site2.loc
ErrorLog /var/log/apache/site2-error_log
CustomLog /var/log/apache/site2-access_log combined
DirectoryIndex /index.php index.php
DocumentRoot /shared/httpd/multisites/htdocs
Allow from all
Order Deny,Allow
<Directory /shared/httpd/multisites/htdocs>
DirectoryIndex index.php
AddType application/x-httpd-php .php
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
Require all granted
<VirtualHost *:80>
ServerName site3.loc
ServerAlias site3.loc
ErrorLog /var/log/apache/site3-error_log
CustomLog /var/log/apache/site3-access_log combined
DirectoryIndex /index.php index.php
DocumentRoot /shared/httpd/multisites/htdocs
Allow from all
Order Deny,Allow
<Directory /shared/httpd/multisites/htdocs>
DirectoryIndex index.php
AddType application/x-httpd-php .php
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
Require all granted
vHost Type (normal or reverse proxy)
vhost_type:
Normal vHost (-p)
docroot: |
# Define the vhost to serve files
DocumentRoot “DOCUMENT_ROOT”
<Directory “DOCUMENT_ROOT”>
DirectoryIndex INDEX
AllowOverride All
Options All
RewriteEngine on
RewriteBase /
Order allow,deny
Allow from all
Require all granted
</Directory>
Reverse Proxy (-r)
rproxy: |
# Define the vhost to reverse proxy
ProxyRequests On
ProxyPreserveHost On
ProxyPass LOCATION PROXY_PROTO://PROXY_ADDR:PROXY_PORT____LOCATION
ProxyPassReverse LOCATION PROXY_PROTO://PROXY_ADDR:PROXY_PORT____LOCATION
Optional features to be enabled in vHost
features:
SSL Configuration
ssl: |
SSLEngine on
SSLCertificateFile “SSL_PATH_CRT”
SSLCertificateKeyFile “SSL_PATH_KEY”
SSLProtocol SSL_PROTOCOLS
SSLHonorCipherOrder SSL_HONOR_CIPHER_ORDER
SSLCipherSuite SSL_CIPHERS
Redirect to SSL directive
redirect: |
RedirectMatch (.*) https://VHOST_NAME:SSL_PORT$1
PHP-FPM will not be applied to a reverse proxy!
php_fpm: |
# In case for PHP-FPM 5.2 compatibility use ‘GENERIC’ instead of ‘FPM’
# https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html#proxyfcgibackendtype
ProxyFCGIBackendType FPM
# PHP-FPM Definition
<FilesMatch \.php$>
Require all granted
SetHandler proxy:fcgi://__PHP_ADDR__:__PHP_PORT__
</FilesMatch>
<Proxy "fcgi://__PHP_ADDR__:__PHP_PORT__/">
ProxySet timeout=__PHP_TIMEOUT__
ProxySet connectiontimeout=__PHP_TIMEOUT__
</Proxy>
# If the php file doesn't exist, disable the proxy handler.
# This will allow .htaccess rewrite rules to work and
# the client will see the default 404 page of Apache
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
RewriteRule (.*) - [H=text/html]
alias: |
# Alias Definition
Alias “ALIAS” “PATH____ALIAS”
<Location “ALIAS”>
XDOMAIN_REQ
<Directory “PATH____ALIAS”>
Order allow,deny
Allow from all
Require all granted
deny: |
# Deny Definition
<FilesMatch “REGEX”>
Order allow,deny
Deny from all
server_status: |
# Status Page
SetHandler server-status
Order allow,deny
Allow from all
Require all granted
xdomain_request: |
# Allow cross domain request from these hosts
SetEnvIf Origin “REGEX” AccessControlAllowOrigin=0
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "0"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*) $1 [R=200,L]