Skip to content

Instantly share code, notes, and snippets.

@sivankanat
Last active February 11, 2021 21:41
Show Gist options
  • Save sivankanat/517110273c0e74fbab43f5c83ec6dfc2 to your computer and use it in GitHub Desktop.
Save sivankanat/517110273c0e74fbab43f5c83ec6dfc2 to your computer and use it in GitHub Desktop.
Windows 10 apache, mariadb, php8, phpmyadmin manuel installation

Windows Apache, MariaDB, PhpMyAdmin, OpenSSL Manuel Installation

00. Start

  • Create web directory c:\web\

Needs

vc_redist x64 -> https://aka.ms/vs/16/release/vc_redist.x64.exe x86 -> https://aka.ms/vs/16/release/vc_redist.x86.exe

00. Apache

  • Download apache last version from: https://www.apachelounge.com/download/
  • Extract the downloaded zip to c:\web\apache\
  • Open the cmd as Administrator, type cd c:\web\apache\bin
  • Add Apache service httpd -k install

other

  • to check syntax httpd -t
  • to start - stop httpd -k start || stop

00. PHP

  • download, extract the downloaded zip to c:\web\php\
  • Open the cmd as Administrator, type: c:\>setx path "%PATH%, c:\web\php" /M
  • Rename php-ini-development.ini to php.ini

00. PHPMyAdmin

  • download, unzip, copy files to c:\web\phpmyadmin
  • rename config.sample.inc.php to config.inc.php
  • configure config.inc.php
  • run sql/create_tables.sql

00. MariaDB

  • Download, unzip, move to c:\web\mariadb
  • Set Path setx path %PATH%, C:\web\mariadb\bin install mysql_install_db.exe --datadir=..\data

args

other

  • Version mysqladmin --version || mysqld --version
  • Identify alter user 'root'@'localhost' identified by 'pass';
  • Show DBS show databases;
  • To login mysql -h localhost -u root -p

Windows Localhost Openssl

Creating ssl for all local domains

Start.

  • create ssl folder c:\web\apache\conf\ssl
  • create doms.conf doms.conf content:
      [ req ]
      default_bits       = 4096
      distinguished_name = req_distinguished_name
      req_extensions     = req_ext
    
      [ req_distinguished_name ]
      countryName                 = Country Name (2 letter code)
      countryName_default         = TR
      stateOrProvinceName         = State or Province Name 
      (full name)
      stateOrProvinceName_default = SIRNAK
      localityName                = Locality Name (eg, city)
      localityName_default        = SIRNAK
      organizationName            = Organization Name (eg, 
      company)
      organizationName_default    = Localhost Inc
      commonName                  = Common Name (e.g. server 
      FQDN or YOUR name)
      commonName_max              = 64
      commonName_default          = localhost
    
      [ req_ext ]
      subjectAltName = @alt_names
    
      [alt_names]
      DNS.1   = localhost
      DNS.2   = test.sw
      DNS.3   = sample.sw
    

openssl

  • create localhost.key

    ..\..\bin\openssl genrsa -out localhost.key 4096
  • localhost.csr

    ..\..\bin\openssl req -new -sha256 -out localhost.csr -key localhost.key -config doms.conf
    • localhost.crt
    ..\..\bin\openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt -extensions req_ext -extfile doms.conf

Add the certificate to the Trusted Root Certification Authorities

  certutil –addstore -enterprise –f "Root" C:\web\apache\conf\ssl\localhost.crt

for check run the certmgr command

httpd.vhosts.conf

# Virtual Hosts
#
<VirtualHost *:443>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${PUBLICDIR}/"
  <Directory "${PUBLICDIR}/">
    Options +Indexes +Includes +FollowSymLinks  +MultiViews +ExecCGI
    AllowOverride All
    Require all granted
  </Directory>

  SSLEngine on
  SSLCertificateFile "${SRVROOT}/conf/ssl/localhost.crt"
  SSLCertificateKeyFile "${SRVROOT}/conf/ssl/localhost.key"
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment