LAMP Basic Training
Appearance
PHP based service:
TO run a website the basic prerequisites are:
- Network access ,i.e, static ip
- DNS to resolve the for name server lookup problems.
- LAMP= Linux,Apache.Mysql,Perl/PHP
Functions:
- Monitoring
- Basic configuration (PHP/MY SQL)
- Log analysis/Understanding
- Basic perimeters and understandings
- PHP.ini
- 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 :
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:
In reference to T.I.S, monitoring is used to monitor URLs. Service configured in respect of URL may be following:
- http = to monitor header mapping, page size, number of sessions.
- CPU= to monitor memory services and all.
- Disk = to check lvm, disk usage etc.
IMPORTANT NOTE:
- ‘top’ command informs only about the maximum utilization of resources by applications.
- To check number of sessions, use following:
-
-
- ‘ps aux | grep httpd’
- ‘netstat –a | grep httpd –established'
- 'lsof
-
- ‘whois’ is a tool to know about detail information about domains. Same way SSL certificates can be verified too by site
Benchmark & tuning:
- In httpd tuning can be done through the command ‘ab’. Similarly in case of MySql tool is ‘mysqltuning.pl’
- 70% of tuning is resides within the code itself, rest 30% can be manually configured.