Jump to content

LAMP Basic Training

From TetraWiki
Revision as of 10:38, 17 December 2014 by Amit (talk | contribs) (IMPORTANT NOTE:)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

PHP based service:


TO run a website the basic prerequisites are:

  1. Network access ,i.e, static ip
  2. DNS to resolve the for name server lookup problems.
  3. LAMP= Linux,Apache.Mysql,Perl/PHP

Functions:

  1. Monitoring
  2. Basic configuration (PHP/MY SQL)
  3. Log analysis/Understanding
  4. Basic perimeters and understandings
  5. PHP.ini
  6. PHPMyadmin

Tips:

  • While configuring basic apache server, all we need is ‘Documentary Root’.
  • In case Apache needs to be run on different predefined port then firstly it should be free secondly it should be assign with <virtualhost: *__>
  • Don’t ignore the ‘conf.d’ directory, it contains the crucial files which are necessary to up the service.
  • Production sites are virtual hosted with configuration file generally named as “configuration.php”.
  • CMS is usually integrated with MySql. MySql should be provided with separate user for access for security reasons.
  • Allowance should be given to localhost only.
  • In MySql,’ /etc/my.conf’ is used for linking PHPMyAdmin. And the 4 IPs of T.I.S should be allowed in the argument “allow from” to hold the access with tetra only.
  • Remember: PHPMyadmin is not recommended but is used for convenient purpose of developers.

PHPMyadmin:

  • Its a tool used used for integration purpose (usually with mySql and Ldap).
  • It ease the administration of the services.

MySql Engines:

  • MyISAM- Default working engines.
  • INNODB- used for tuning and performance .
  • FEDRA- used in huge federated environment.
  • NDB- used for clustering purpose.
  • ARCHIVE - used for storing large amounts of data without indexes with a very small footprint.
  • CSV - stores data in text files using comma-separated values format.

Log Analysis :[edit]

Logs gives us the right mechanism to diagnose and troubleshoot the problem.

Tips:

  • ‘.htaccess’ is basically used for over-writing the rules and thus can only be applicable when ‘allowoverride’ argument is passed in httpd.conf file.
  • Log rotation is basically the concept use in the log analysis.

Infrastructure Monitoring:[edit]

In reference to T.I.S, monitoring is used to monitor URLs. Service configured in respect of URL may be following:

  1. http = to monitor header mapping, page size, number of sessions.
  2. CPU= to monitor memory services and all.
  3. Disk = to check lvm, disk usage etc.

IMPORTANT NOTE:[edit]

  • ‘top’ command informs only about the maximum utilization of resources by applications.
  • To check number of sessions, use following:
      1. ‘ps aux | grep httpd’
      2. ‘netstat –a | grep httpd –established'
      3. 'lsof
  • ‘whois’ is a tool to know about detail information about domains. Same way SSL certificates can be verified too by site

Benchmark & tuning:

  1. In httpd tuning can be done through the command ‘ab’. Similarly in case of MySql tool is ‘mysqltuning.pl’
  2. 70% of tuning is resides within the code itself, rest 30% can be manually configured.