Building a LAMP Stack on Amazon Linux AMI 2015.09 (HVM)

Restart MySQL:

  • ServerTokens OS → ServerTokens Prod (suppress OS name in error pages)
  • ServerSignature On → ServerSignature Off (hide Apache version in error pages)
  • DirectoryIndex index.html index.html.var → DirectoryIndex index.html index.htm Default.html Default.htm index.php Default.php index.html.var (add index.php to default index files)
  • Options Indexes FollowSymLinks → Options Includes ExecCGI FollowSymLinks (enable CGI/SSI, disable directory listing)
  • #AddHandler cgi-script .cgi → AddHandler cgi-script .cgi .pl (allow .pl CGI scripts)
  • AllowOverride None → AllowOverride All (permit .htaccess overrides)
  • AddDefaultCharset UTF-8 → AddDefaultCharset GB2312 (set GB2312 as default encoding)
  • Options Indexes MultiViews FollowSymLinks → Options MultiViews FollowSymLinks (hide directory tree in browser)
  • KeepAlive Off → KeepAlive On (enable keep-alive connections)
  • MaxKeepAliveRequests 100 → MaxKeepAliveRequests 1000 (increase concurrent connection limit)

Save the file and restart Apache:

Tags: Amazon Linux LAMP Apache HTTP Server MySQL PHP

Posted on Wed, 27 May 2026 16:01:25 +0000 by shauns2007