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

Restart MySQL:

  • ServerTokens OSServerTokens Prod (suppress OS name in error pages)
  • ServerSignature OnServerSignature Off (hide Apache version in error pages)
  • DirectoryIndex index.html index.html.varDirectoryIndex index.html index.htm Default.html Default.htm index.php Default.php index.html.var (add index.php to default index files)
  • Options Indexes FollowSymLinksOptions Includes ExecCGI FollowSymLinks (enable CGI/SSI, disable directory listing)
  • #AddHandler cgi-script .cgiAddHandler cgi-script .cgi .pl (allow .pl CGI scripts)
  • AllowOverride NoneAllowOverride All (permit .htaccess overrides)
  • AddDefaultCharset UTF-8AddDefaultCharset GB2312 (set GB2312 as default encoding)
  • Options Indexes MultiViews FollowSymLinksOptions MultiViews FollowSymLinks (hide directory tree in browser)
  • KeepAlive OffKeepAlive On (enable keep-alive connections)
  • MaxKeepAliveRequests 100MaxKeepAliveRequests 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