argument('dir');
$project = base_path();
$project = explode('/', $project);
array_pop($project);
$project[] = $dir;
$project = implode('/', $project);
$conf =
'
DocumentRoot "'.$project.'/public/"
ServerName '.$host.'
Alias "/resources/" "'.$project.'/resources/upload/"
Alias "/admin" "'.$project.'/public/dist"
Alias "/static/" "'.$project.'/public/dist/static/"
ErrorLog logs/mp-website-admin-error_log
CustomLog logs/mp-website-admin-access_log combined
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{QUERY_STRING} responseContentType=application%2Foctet-stream [NC]
RewriteRule .* - [E=DOWNLOAD:yes]
Header set Content-Disposition "attachment" env=DOWNLOAD
AllowOverride All
Require all granted
AllowOverride All
DirectoryIndex index.html
Require all granted
AllowOverride All
Require all granted
DocumentRoot "'.$project.'/public/"
ServerName '.$host.'
Alias "/resources/" "'.$project.'/resources/upload/"
Alias "/admin" "'.$project.'/public/dist"
Alias "/static/" "'.$project.'/public/dist/static/"
LimitRequestLine 40940
LimitRequestFieldSize 40940
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "/etc/httpd/cert/matchexpo.cn/matchexpo.cn.crt"
SSLCertificateKeyFile "/etc/httpd/cert/matchexpo.cn/matchexpo.cn.key"
SSLCertificateChainFile "/etc/httpd/cert/matchexpo.cn/CA-Bundle.crt"
#SSLCACertificateFile "/etc/httpd/cert/call/TencentQQAuthCA.crt"
#SSLVerifyClient require
SSLOptions +StdEnvVars
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{QUERY_STRING} responseContentType=application%2Foctet-stream [NC]
RewriteRule .* - [E=DOWNLOAD:yes]
Header set Content-Disposition "attachment" env=DOWNLOAD
AllowOverride All
Require all granted
AllowOverride All
DirectoryIndex index.html
Require all granted
AllowOverride All
Require all granted
';
$path = resource_path('conf/');
if (!is_dir($path)) {
mkDirs($path);
}
$fileName = $path . $dir .'_apache.conf';
file_put_contents($fileName, $conf);
echo 'echo IncludeOptional '.$fileName.' >> /etc/httpd/conf/httpd.conf'.PHP_EOL;
}
}