baiyunjn 发表于 2019-2-17 06:58:17

Centos 6.5 部署 LAMP

Apache HTTP Server
# rpm -ivh epel-release-6-8.noarch.rpm
# yum install -y expat-devel openssl openssl-devel pcre pcre-devel
# groupadd apache
# useradd apache -g apache -s /bin/nologin
# tar zxvf apr-1.6.3.tar.gz
# cd apr-1.6.3
# ./configure --prefix=/usr/local/apr
# make
# make install
# tar zxvf apr-util-1.6.1.tar.gz
# cd apr-util-1.6.1
# ./configure --with-apr=/usr/local/apr/bin/apr-1-config
# make
# make install
# tar zxvf httpd-2.4.29.tar.gz
# cd httpd-2.4.29
# ./configure --prefix=/usr/local/apache \
--sysconfdir=/etc/httpd \
--enable-ssl \
--enable-so \
--enable-cgi \
--enable-rewrite \
--with-pcre \
--with-zlib \
--enable-modules=most \
--enable-mods-shared=most \
--enable-mpms-shared=all \
--with-mpm=worker \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config
# make
# make install
# cd build/rpm
# cp httpd.init /etc/init.d/httpd
# vi /etc/init.d/httpd
httpd=${HTTPD-/usr/local/apache/bin/httpd}
pidfile=${PIDFILE-/usr/local/apache/logs/${prog}.pid}
CONFFILE=/etc/httpd/httpd.conf
# vim /etc/httpd/httpd.conf
ServerName 192.168.1.201:80
User apache
Group apache
# vim /etc/man.config
MANPATH /usr/local/apache/man
# chkconfig --add httpd
# chkconfig --level 345 httpd on
# chkconfig --list |grep http
httpd         0:off   1:off   2:off   3:on    4:on    5:on    6:off
# service httpd start
Starting httpd:                                          
# service httpd status
httpd (pid8954) is running...
# netstat -tupln |grep http
tcp      0      0 :::80                     :::*                        LISTEN      7858/httpdMySQL Server
http://blog.运维网.com/13598811/2069680PHP
# yum install libjpeg libpng freetype libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel
# tar zxvf php-5.5.30.tar.gz
# cd php-5.5.30
# ./configure --prefix=/usr/local/php \
--with-config-file-path=/etc \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-zlib \
--with-bz2 \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-openssl \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql \
--without-sqlite3 \
--without-pdo-sqlite \
--enable-xml \
--enable-sockets \
--enable-mbstring \
--disable-ipv6
# make
# make install
# cp php.ini-production /etc/php.ini
# vi /etc/php.ini
date.timezone = Asia/Shanghai
# vi /etc/httpd/httpd.conf
LoadModule php5_module      modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

    DirectoryIndex index.php index.html

# service httpd restart
Stopping httpd:                                          
Starting httpd:                                          验证
# cd /usr/local/apache/htdocs
# mv index.html index.php
# vi index.php



页: [1]
查看完整版本: Centos 6.5 部署 LAMP