This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Don't forget to change localhost to your local domain in (server_rootCA.csr.cnf & v3.ext) | |
## (( ONLY )) In localhost, you have need to change SSLCertificateFile & SSLCertificateKeyFile in vhosts-ssl.conf to new generated server.crt & server.key | |
## In other domains, you need to configure httpd-vhost.conf only. | |
# openssl genrsa -out server_rootCA.key 2048 | |
# openssl req -x509 -new -nodes -key server_rootCA.key -sha256 -days 3650 -out server_rootCA.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# v3.ext | |
authorityKeyIdentifier=keyid,issuer | |
basicConstraints=CA:FALSE | |
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment | |
subjectAltName = @alt_names | |
[alt_names] | |
DNS.1 = localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server_rootCA.csr.cnf | |
[req] | |
default_bits = 2048 | |
prompt = no | |
default_md = sha256 | |
distinguished_name = dn | |
[dn] | |
C=SA | |
ST=Makkah |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function word_limiter($str, $limit = 100, $end_char = '…'){ | |
$str2 = strip_tags($str); | |
//$str2 = $str; | |
if (trim($str2) == ''){ | |
return $str2; | |
} | |
preg_match('/^\s*+(?:\S++\s*+){1,'.(int) $limit.'}/', $str2, $matches); | |
if (strlen($str2) == strlen($matches[0])){ | |
$end_char = ''; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set /p domain="Enter Domain: " | |
set OPENSSL_CONF=../conf/openssl.cnf | |
REM | |
REM Read the "cert-template.conf" file and replace all {{DOMAIN}} placeholders by the entered domain. | |
REM Write the result into a new file called "cert.conf". | |
REM | |
REM @see https://stackoverflow.com/questions/5273937/how-to-replace-substrings-in-windows-batch-file#20227248 | |
REM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[req] | |
default_bits = 2048 | |
default_keyfile = server-key.pem | |
distinguished_name = subject | |
req_extensions = req_ext | |
x509_extensions = x509_ext | |
string_mask = utf8only | |
[subject] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Setup: | |
* 1- Create MySlugHelper.php inside app/Helper/MySlugHelper.php | |
* 2- Edit config/sluggable.php: | |
* replace line ('method' => null,) with ('method' => [App\Helper\MySlugHelper::class, 'slug'],) | |
*/ | |
<?php |