AWS Redhat RHEL Install LAMP

From Hawk Wiki
Revision as of 21:37, 17 March 2015 by Hall (Talk | contribs) (Sample apache virtual host config)

Jump to: navigation, search

Install LAMP on redhat 5.4, Cent OS 7

Install apache

sudo su
yum install httpd
apachectl start

Install mysql

Mysql is different in Cent OS 7
see https://www.digitalocean.com/community/questions/can-t-install-mysql-on-centos-7

yum -y install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation #to setup mysql password

Install PHP

yum install php php-mysql

See RHEL Yum for installing php-mbstring in centOS 7

Sample apache virtual host config

In /etc/httpd/conf.d, create new file sitename.conf

<VirtualHost *:80>
	ServerAdmin webmaster@hawkguide.com
	ServerName wiki.hawkguide.com
	DirectoryIndex index.php index.html
	DocumentRoot /var/www/wiki.hawkguide.com
	<Directory />
		Options Indexes FollowSymLinks
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
	ErrorLog logs/wiki_hawkguide_error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.

</VirtualHost>

Install gcc c and c++ compiler

yum group install "Development Tools"

Install php pear

yum install php-pear

Install php memcached

yum install memcached
yum install zlib-devel libmemcached libmemcached-devel #required for installing memcache
pecl install memcached
vim /etc/php.ini
#Add "extension=memcached.so" to php.ini
apachectl restart