Difference between revisions of "AWS Redhat RHEL Install LAMP"

From Hawk Wiki
Jump to: navigation, search
(install PHP)
(Install gcc c and c++ compiler)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Install LAMP on redhat 5.4, Cent OS 7==
+
=Install LAMP on redhat 5.4, Cent OS 7=
 
==Install apache==
 
==Install apache==
 
<pre>
 
<pre>
Line 20: Line 20:
 
</pre>
 
</pre>
 
See [[RHEL Yum]] for installing php-mbstring in centOS 7
 
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
 +
<pre>
 +
<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>
 +
</pre>
 +
 +
==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
 +
<pre>
 +
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
 +
</pre>
 +
==Install gcc c and c++ compiler==
 +
<pre>
 +
yum group install "Development Tools"
 +
</pre>
 +
 +
==Install php pear==
 +
<pre>
 +
yum install php-pear
 +
</pre>
 +
==Install php memcached==
 +
<pre>
 +
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
 +
</pre>

Latest revision as of 04:22, 23 March 2015

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