:: Generates a new server key file for a development server
ECHO OFF
TITLE Creating a Development Server Key
ECHO Creating a Development Server Key...
:: Generate server.key
openssl genrsa -des3 -out server.key 1024
:: Generate server.csr and server.pem
openssl req -config ../conf/openssl.cnf -new -out server.csr -keyout server.pem
:: Regenerate server.key from created server.pem
openssl rsa -in server.pem -out server.key
:: Signs the key file and outputs server.cert
openssl x509 -in server.csr -out server.cert -req -signkey server.key -days 365
:: Copy generated files to 'ssl' folder
ECHO Copying generated files to 'SSL' folder
copy "server.key" "../ssl/server.key"
copy "server.cert" "../ssl/server.cert"
copy "server.csr" "../ssl/server.csr"
copy "server.pem" "../ssl/server.pem"
ECHO Development Server Key Created and Copied to SSL folder
pause
mysql psa -e "SELECT REPLACE(sys_users.home,'/home/httpd/vhosts/','') AS domain,sys_users.login,accounts.password FROM sys_users LEFT JOIN accounts on sys_users.account_id=accounts.id ORDER BY sys_users.home ASC;"