mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-24 00:20:25 +00:00
update
This commit is contained in:
parent
f611f3d36b
commit
f76130934e
2 changed files with 16 additions and 9 deletions
|
@ -67,11 +67,14 @@ class WildcardMasterDomain extends BaseSettings
|
|||
|
||||
$amePHPPharFile = base_path().'/Modules/LetsEncrypt/Actions/acmephp.phar';
|
||||
|
||||
//$phyrePHP = ApiClient::getPhyrePHP();
|
||||
$phyrePHP = 'php';
|
||||
$command = $phyrePHP.' '.$amePHPPharFile.' run '.$masterDomain->domainRoot.'/acme-wildcard-config.yaml >> ' . $this->installLogFilePath . ' &';
|
||||
if (!is_dir(dirname($this->installLogFilePath))) {
|
||||
shell_exec('mkdir -p ' . dirname($this->installLogFilePath));
|
||||
}
|
||||
|
||||
$execSSL = shell_exec($command);
|
||||
//$phyrePHP = ApiClient::getPhyrePHP();
|
||||
$phyrePHP = 'phyre-php';
|
||||
$command = $phyrePHP.' '.$amePHPPharFile.' run '.$masterDomain->domainRoot.'/acme-wildcard-config.yaml >> ' . $this->installLogFilePath . ' &';
|
||||
shell_exec($command);
|
||||
|
||||
$validateCertificates = [];
|
||||
$sslCertificateFilePath = '/root/.acmephp/master/certs/*.'.$masterDomain->domain.'/public/cert.pem';
|
||||
|
|
|
@ -32,7 +32,11 @@ class MasterDomain
|
|||
|
||||
public function configureVirtualHost()
|
||||
{
|
||||
return; // TODO
|
||||
// check is valid domain
|
||||
if (!filter_var($this->domain, FILTER_VALIDATE_DOMAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$apacheVirtualHostBuilder = new \App\VirtualHosts\ApacheVirtualHostBuilder();
|
||||
$apacheVirtualHostBuilder->setDomain($this->domain);
|
||||
$apacheVirtualHostBuilder->setDomainPublic($this->domainPublic);
|
||||
|
@ -43,8 +47,8 @@ class MasterDomain
|
|||
$apacheBaseConfig = $apacheVirtualHostBuilder->buildConfig();
|
||||
|
||||
if (!empty($apacheBaseConfig)) {
|
||||
file_put_contents('/etc/apache2/sites-available/000-default.conf', $apacheBaseConfig);
|
||||
shell_exec('ln -s /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf');
|
||||
file_put_contents('/etc/apache2/sites-available/'.$this->domain.'.conf', $apacheBaseConfig);
|
||||
shell_exec('ln -s /etc/apache2/sites-available/'.$this->domain.'-default.conf /etc/apache2/sites-enabled/'.$this->domain.'-default.conf');
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,8 +113,8 @@ class MasterDomain
|
|||
file_put_contents($apache2SSLOptionsFilePath, $apache2SSLOptionsSample);
|
||||
}
|
||||
|
||||
file_put_contents('/etc/apache2/sites-available/000-default-ssl.conf', $apacheBaseConfigWithSSL);
|
||||
shell_exec('ln -s /etc/apache2/sites-available/000-default-ssl.conf /etc/apache2/sites-enabled/000-default-ssl.conf');
|
||||
file_put_contents('/etc/apache2/sites-available/'.$this->domain.'-ssl.conf', $apacheBaseConfigWithSSL);
|
||||
shell_exec('ln -s /etc/apache2/sites-available/'.$this->domain.'-ssl.conf /etc/apache2/sites-enabled/'.$this->domain.'-ssl.conf');
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue