This commit is contained in:
Bozhidar Slaveykov 2024-04-02 18:22:15 +03:00
parent aac86a0b8f
commit 166582490f
3 changed files with 10 additions and 4 deletions

View file

@ -60,12 +60,13 @@ class ApacheWebsiteApplySSLVirtualHost
];
$apache2SSLSample = view('actions.samples.ubuntu.apache2-ssl-conf',$settings)->render();
$apache2SSLOptionsSample = view('actions.samples.ubuntu.apache2-ssl-options-conf')->render();
$fileManagerApi = new FileManagerApi();
$apache2SSLOptionsSample = view('actions.samples.ubuntu.apache2-ssl-options-conf')->render();
$apache2SSLOptionsFilePath = '/etc/apache2/phyre/options-ssl-apache.conf';
if (!$fileManagerApi->isDir('/etc/apache2/phyre')) {
$fileManagerApi->mkdir('/etc/apache2/phyre');
}
if (!$fileManagerApi->fileExists($apache2SSLOptionsFilePath)) {
$fileManagerApi->filePutContents($apache2SSLOptionsFilePath, $apache2SSLOptionsSample);
}

View file

@ -4,6 +4,11 @@ namespace App;
class FileManagerApi
{
public function isDir($path)
{
return is_dir($path);
}
public function mkdir($path)
{
ShellApi::exec('mkdir -p '.$path);

View file

@ -16,6 +16,6 @@
SSLCertificateKeyFile {{$sslCertificateKeyFilePath}}
SSLCertificateChainFile {{$sslCertificateChainFilePath}}
Include /etc/letsencrypt/options-ssl-apache.conf
Include /etc/apache2/phyre/options-ssl-apache.conf
</VirtualHost>
</IfModule>