Difference between revisions of "AWS Redhat RHEL Install LAMP"

From Hawk Wiki
Jump to: navigation, search
(install PHP)
(Install LAMP on redhat 5.4, Cent OS 7=)
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>

Revision as of 18:21, 16 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>