Difference between revisions of "Lamp Server Notes"

From OpenEMR Project Wiki
Line 1: Line 1:
==Apache Notes==
==Apache Notes==
[[Apache2 Notes]]
[[Apache2 Notes]]
<br>
=====General=====
*[http://help.ubuntu.com/14.04/serverguide/httpd.html Ubuntu Documentation - Server Guide - Apache2]
<br>
=====Files=====
{| style="margin: 0 0em 0 0em;"
|-
| width="250" | <tt style="font-size: 130%">/etc/apache2</tt>
| width="400" | Config File
|-
| <tt style="font-size: 130%">/usr/share/doc/apache2-doc</tt>
| Apache2 Manual.
|-
| <tt style="font-size: 130%">/var/www/html</tt>
| Default http home directory.
|} 
<br>
=====Commands=====
{| style="margin: 0 0em 0 0em;"
|-
| width="350" | <tt style="font-size: 130%">apache2 -v</tt>
| width="450" | Display apache version.
|-
| <tt style="font-size: 130%">sudo /etc/init.d/apache2 restart</tt>
| Restart apache.  This needs to be done after configuration changes.
|-
| <tt style="font-size: 130%">sudo a2enmod [MODULE NAME]</tt>
| Enable apache2 module.
|} 
<br>
=====Configuration File Settings=====
{| style="margin: 0 0em 0 0em;"
|-
| width="250" | <tt style="font-size: 130%">ServerSignature Off</tt>
| width="400" | Suppress identification of the Apache version.
|-
| <tt style="font-size: 130%">ServerTokens Prod</tt>
| Suppress identification of OS.
|- valign="top"
| <tt style="font-size: 130%"><Directory /var/www/html><br>&nbsp;&nbsp;&nbsp; Options -Indexes<br></Directory></tt>
| Turn off directory listing.
|} 
<br><br>
=====Configuration File - Directory DIrectives=====
{| style="margin: 0 0em 0 0em;"
|-
| width="250" | <tt style="font-size: 130%">Options None</tt>
| width="400" | 
|-
| <tt style="font-size: 130%">Order deny, allow</tt>
| Order of deny, allow directives.
|-
| <tt style="font-size: 130%">Deny from all.</tt>
| Deny request from everybody.
|-
| <tt style="font-size: 130%">Options -FollowSymLinks</tt>
| Disable following symbolic links.
|-
| <tt style="font-size: 130%">Options +FollowSymLinks</tt>
| Enable following symbolic links.
|-
| <tt style="font-size: 130%">AllowOverride All</tt>
| Allows override of directory directives with .htaccess files.
|-
| <tt style="font-size: 130%">Options -Includes</tt>
| Turn off server side includes (mod_includes).
|-
| <tt style="font-size: 130%">Options -ExecCGI</tt>
| Turn off CGI file executions.
|-
| <tt style="font-size: 130%">LimitRequestBody 512000</tt>
| Limits size of HTTP request.  Any value from 0 to 2147483647 (2GB).
|-
| <tt style="font-size: 130%">MaxClients 10</tt>
| Limits simultaneous connections.  Default is 256.
|}
<br>
=====Sample Virtual Host=====
<pre  style="font-size: 130%">
<VirtualHost *:80>
  DocumentRoot /var/www/html/example.com/
  ServerName www.example.com
  DirectoryIndex index.htm index.html index.php
  ServerAlias example.com
  ErrorDocument 404 /story.php
  ErrorLog /var/log/httpd/example.com_error_log
  CustomLog /var/log/httpd/example.com_access_log combined
</VirtualHost>
</pre>
<br>
=====SSL Certificate=====
Create a self signed certificate:
<pre  style="font-size: 130%">
openssl genrsa -des3 -out example.com.key 1024
openssl req -new -key example.com.key -out exmaple.csr
openssl x509 -req -days 365 -in example.com.com.csr -signkey example.com.com.key -out example.com.com.crt
</pre>
<br>
Sample Configuration:
<pre  style="font-size: 130%">
<VirtualHost 172.16.25.125:443>
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/example.com.crt
        SSLCertificateKeyFile /etc/pki/tls/certs/example.com.key
        SSLCertificateChainFile /etc/pki/tls/certs/sf_bundle.crt
        ServerAdmin ravi.saive@example.com
        ServerName example.com
        DocumentRoot /var/www/html/example/
        ErrorLog /var/log/httpd/example.com-error_log
        CustomLog /var/log/httpd/example.com-access_log common
</VirtualHost>
</pre>
*[http://httpd.apache.org/docs/2.2/misc/security_tips.html More Security Tips]
<br>
=====Proxy=====
*[http://serverfault.com/questions/273679/redirecting-to-other-internal-servers-based-on-sub-domain Redirecting To Other Internal Servers Based on Subdomain]
<br>
<br>



Revision as of 16:47, 28 May 2014

Apache Notes

Apache2 Notes

MySQL Notes



PHP Notes



Other Packages of Interest