AWS Redhat RHEL Install LAMP

From Hawk Wiki
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>

CentOS 7 Install php-mbstring

By default, Redhat repo does not contain php-mbstring in Amazon AWS. php-mbstring is required for phpMyAdmin, wordpress, etc.

To Install php-mbstring

yum repolist all
# found rhui-REGION-rhel-server-optional in the list
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
yum search php-
yum install php-mbstring

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