1 Installing the Apache server
Yum-y Install httpd Httpd-devel
2 Installing MySQL
Yum-y install MySQL mysql-server mysql-devel
3 Installing PHP and its extensions
Yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
4 starting MySQL
Service mysqld Start
Connect to MySQL
Mysql-uroot-p
Log in later to view MySQL
show databases;
5 Modifying firewall rules
[Email protected] ~]# iptables-f
[[Email protected] ~]# service Iptables Save
Iptables: Save firewall rules to/etc/sysconfig/iptables:[OK]
[[Email protected] ~]# service iptables stop
Iptables: Set the chain to policy accept:filter [OK]
Iptables: Clear Firewall rule: [OK]
Iptables: Uninstalling module: [OK]
[Email protected] ~]# Vi/etc/selinux/config
Set up
Selinux=disabled
6 launch Apache
Apche Boot, prompt error
[[email protected] ~]# apachectl start
Httpd:could not reliably determine the server ' s fully qualified domain name, using Localhost.localdomain for ServerName
HTTPD (PID 18265) already running
Modifying a configuration file
[Email protected] ~]# vi/etc/httpd/conf/httpd.conf
Set line number: Set Nu about 276 lines
ServerName www.example.com:80 Uncomment
[Email protected] ~]# apachectl restart
Test address: 192.168.214.42, OK
7 Testing PHP
[Email protected] ~]# cd/var/www/html
[Email protected] html]# VI index.php
<?php
Phpinfo ();
?>
Test address: 192.168.214.42, OK
Done!
Improve performance, install Zend
[Email protected] yum.repos.d]# Wget-q-o-http://www.atomicorp.com/installers/atomic.sh | SH Note: Yes Big O
[[email protected] yum.repos.d]# Yum install Php-zend-optimizer, installation failed
Linux lamp Server Installation configuration