lamp架构之centos6+apache2.4+.mysql5.6+php5.6.30
1ifconfig2vi /etc/sysconfig/network-scripts/ifcfg-eth0
3service network restart
4ping www.baidu.com
5mkdir /root/.ssh
6chmod 700 /root/.ssh
7cd /root/.ssh
8vi authorized_keys
9reboot
10vi /etc/selinux/config
11reboot
12ifconfig
13init 0
14ifconfig
15uanme -a
16uname
17uname -a
18servcie stop iptables
19service iptable status
20service iptables status
21service iptables stop
22chkconfig iptables off
23cd /usr/local/src
24ll
25wget
26yum install wget
27yum install epe
28yum install epel
29ping www.baidu.com
30ping www.baidu.o
31ping www.baidu.com
32cd /usr/local/src
33ll
34yum install wget -y
35wget http://mirrors.sohu.com/apache/httpd-2.4.29.tar.gz
36wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
37cd /usr/local/src/
38ll
39wget http://mirrors.sohu.com/php/php-5.6.9.tar.gz
40wget http://mirrors.sohu.com/nginx/nginx-1.9.3.tar.gz
41history
420
43init 0
44history
45cd /usr/local/src
46 yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers make
47wget https://netix.dl.sourceforge.net/project/pcre/pcre/8.42/pcre-8.42.tar.gz
48 wget https://jaist.dl.sourceforge.net/project/pcre/pcre/8.41/pcre-8.41.tar.gz
49wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.bz2
50history
51wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
52ll
53rm mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
54cp mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz.1 mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
55ll
56rm mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz.1
57ll
58rm wget-log
59ll
60wget http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
61wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2
62ll
63init 0
.一、mysql5.6安装
64cd /usr/local/src
68wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
71tar zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
72mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql
73cd /usr/local/mysql/
75mkdir -p /data/mysql
76useradd mysql
77./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
79cp support-files/my-default.cnf /etc/my.cnf
80vi /etc/my.cnf
81cp support-files/mysql.server /etc/init.d/mysqld
82vi /etc/init.d/mysqld
83chmod 755 /etc/init.d/mysqld
84chkconfig --add mysqld
85chkconfig --list
86service mysqld start
87netstat -lnp
88ps aux |grep mysqld
90cd src
二、apache2.4安装
92tar zxvf httpd-2.4.29.tar.gz
94tar zxvfapr-1.6.3.tar.gz
96tar jxvf apr-util-1.6.1.tar.bz2
97cd apr-1.6.3
98./configure --prefix=/usr/local/apr
99yum install libtool -y
100./configure --prefix=/usr/local/apr
101echo $?
102make && make install
103echo $?
104cd ..
105cd apr-util-1.6.1
107./configure --prefix=/usr/local/apr-util
108./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
109echo $?
110make && make install
111yum install expat -y
112make && make install
113echo %?
118cd /usr/local/src
119cp -r apr-1.6.3 /usr/local/src/httpd-2.4.29/srclib/apr
120cp -r apr-util-1.6.1 /usr/local/src/httpd-2.4.29/srclib/apr-util
121cd httpd-2.4.29
122./configure --with-included-apr --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
123cd ..
125tar jxvf pcre-8.41.tar.bz2
126cd pcre-8.41
127./configure --prefix=/usr/local/pcre
128echo $?
131cd httpd-2.4.29
134yum install -y pcre-devel
135./configure --with-included-apr --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most --with-pcre=/usr/local/pcre
136echo $?
137make
138echo $?
139make install
140echo $?
141cd /usr/local/apache2.4/conf/
142vi httpd.conf
ServerName localhost:80
143/usr/local/apache2.4/bin/apachectl start
144netstat -lnp
145service stop iptables
146service iptables stop
147service iptables disable
148chkconfig iptabes off
149chkconfig iptables off
三、php安装
158wget http://mirrors.sohu.com/php/php-5.6.30.tar.gz
160tar zxvf php-5.6.30.tar.gz
161cd php-5.6.30
165cd ..
166wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
167tar zxvf libmcrypt-2.5.7.tar.gz
168cd libmcrypt-2.5.7
169./configure --prefix=/usr/local/libmcrypt
170make && make install
171echo $?
174cd php-5.6.30
178yum install epel*
179yum install -y libmcrypt-devel
180./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
182make
184make install
186cp php.ini-production /usr/local/php/etc/php.ini
188vi /usr/local/apache2.4/conf/httpd.conf
1
AllowOverride none
Require all granted
2AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
3
DirectoryIndex index.html index.php
189/usr/local/apache2.4/bin/apachectl -t
191vi /usr/local/apache2.4/htdocs/1.php
192ls /usr/local/apache2.4/modules/libphp5.so
193cd /usr/local/apache2.4/htdocs/
195chmod 755 index.html
199/usr/local/apache2.4/bin/apachectl -M
205/usr/local/apache2.4/bin/apachectl restart
若打不开测试页,就重启一下电脑。再开启HTTP服务
/usr/local/apache2.4/bin/apachectl start
页:
[1]