源码包搭建lamp

lamp环境搭建

1、apahce安装

(1)安装相关的依赖包

[[email protected]~]#yum–y install gcc make openssl-devel c++ libxml2-devel

(2).编译安装apahce

[[email protected]]# tar -zxf httpd-2.2.25

[[email protected]]#cd httpd-2.2.25

[[email protected] src]# ./configure--prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-cgi--enable-ssl --enable-charset-lite --enable-suexec --with-suexec-caller=daemon--with-suexec-docroot=/usr/local/httpd/htdocs

[[email protected] src]#make&& make install

(3)、编译安装完之后启动apache测试

[[email protected]]# /usr/local/httpd/bin/apachectl start

[[email protected] httpd-2.2.25]# netstat-tlnp | grep :80

tcp        0     0 :::80                       :::*                        LISTEN      56629/httpd

(4)、把apache加为系统服务

[[email protected] init.d]# cp/usr/local/httpd/bin/apachectl /etc/init.d/myhttpd

[[email protected] init.d]# vim/etc/init.d/myhttpd

在#!/bin/bash下面加上如下两行:

# chkconfig: 35 85 15

# description: 描述信息

[[email protected] init.d]# chkconfig --add myhttpd

2、安装mysql

(1)、解压并编译安装

[[email protected] src]# useradd -M -u 49 -s/sbin/nolog mysql

[[email protected] src]# tar -zxfmysql-5.1.62.tar.gz

[[email protected]]# cd mysql-5.1.62

[[email protected] mysql-5.1.62]# ./configure--prefix=/usr/local/mysql --with-charset=utf8 --with-collation=utf8_general_ci--with-extra-charsets=gbk,gb2312

[[email protected] mysql-5.1.62]# make&& make install

(2)、数据库配置

[[email protected]]# cp support-files/my-medium.cnf /etc/my.cnf

[[email protected]]# cd /usr/local/mysql/bin/

[[email protected]]# ./mysql_install_db --user=mysql

[[email protected] bin]#chown -R root:mysql /usr/local/mysql/

[[email protected] bin]#chown -R mysql /usr/local/mysql/var/

[[email protected] bin]#ln -s /usr/local/mysql/bin/* /usr/local/bin/

[[email protected] bin]#ln -s /usr/local/mysql/lib/mysql/* /usr/lib64/

[[email protected] bin]#ln -s /usr/local/mysql/include/mysql/* /usr/include/

(3)、把mysqld加为系统服务

[[email protected] bin]#cd  /usr/src/mysql-5.1.62/support-files/

[[email protected]]# cp  mysql.server  /etc/init.d/mysqld

[[email protected] support-files]# chmod  +x /etc/rc.d/init.d/mysqld

[[email protected]]# chkconfig  --add  mysqld

(4)、启动mysql测试

[[email protected] support-files]# servicemysqld start

[[email protected] support-files]# netstat-tlnp | grep :3306

tcp       0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      18314/mysqld

[[email protected] support-files]#

3、php源码包安装

(1)、解压并编译安装

1、  [[email protected] src]# tar -zxf php-5.4.19.tar.gz

2、   [[email protected] src]# cdphp-5.4.19

3、  [[email protected] php-5.4.19]# ./configure --prefix=/usr/local/php--enable-mbstring --enable-sockets  --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php

[[email protected] php-5.4.19]# make  && make install

[[email protected] php-5.4.19]# cpphp.ini-development /usr/local/php/php.ini

(2)、修改httpd配置文件,以便支持php格式文件

[[email protected] httpd]# vim/usr/local/httpd/conf/httpd.conf,添加一行:

AddType application/x-httpd-php  .php

[[email protected] httpd]#vim /var/www/html/index.php

<?

php phpinfo();

?>

源码包搭建lamp

时间: 2024-10-24 05:34:53

源码包搭建lamp的相关文章

源码包搭建LAMP环境

第一步 1.安装编译工具 gcc* 安装数据库编译工具  cmake   bison yum -y install gcc* cmake  bison 2.下载LAMP压缩包:lamp.zip ,使用脚本批量解压 tar.sh 3.关闭防火墙.Selinux 第二步 分别编译安装各个源码包(共有17个包) 1.可以直接安装的源码包 2.1. # 安装libxml2 先安装   yum -yinstall python-devel mkdir /usr/local/libxml2/ cd /lam

源码编译搭建LAMP环境&#160;

源码编译搭建LAMP环境  一.将 LAMP 相关软件包上传刡 linux 上 [[email protected] ~]# ls anaconda-ks.cfg      install.log         mysql-5.5.30.tar.gz  公共的  视频  文档  音乐 httpd-2.2.25.tar.gz  install.log.syslog  php-5.4.14.tar.bz2   模板    图片  下载  桌面 1. 安装apache [[email protect

源码编译搭建LAMP架构

前述: 本次源码编译安装LAMP平台架构在一台CentOs 7虚拟机完成(穿插叙述叙述mariadb在另一台主机上配置方法),php5以模块形式编译安装到httpd服务器上,httpd服务器Apace多路处理模块(MPM)采用prefork机制. 下面为安装所用的的以下软件叙述: CentOS  7 IP:172.16.49.2:Kernel:3.10.0-229.el7.x86_64 MariaDB 通用二进制格式mariadb-5.5.46-linux-x86_64.tar httpd 编译

CentOS 7.0源码包搭建LNMP 实际环境搭建

Centos7+Nginx1.11.7+MySQL5.7.16+PHP7.1.0+openssl-1.1.0c 一.linux 系统限制配置 1.关闭系统防火墙 systemctl stop firewalld.service 关闭防火墙 systemctl disable firewalld.service  禁用防火墙 2.关闭SElinux sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config  setenforce 0 

CentOS 7.0源码包搭建LNMP方法分享(实际环境下)

CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14 一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2.安装iptables防火墙 yum ins

CentOS7最小化安装下源码编译搭建LAMP环境

CentOS7最小化安装 CentOS7官网下载:http://www.centos.org 1.为了方便与主机交换文件建立共享文件夹:点击对话框顶部"选项",选择"共享文件夹",右侧点击"总是启用"点击"添加"按提示添加自己想要添加的目录,然后点击"确认",完成虚拟机设置. 2.按"Enter"建,选择"install CentOS 7".选择"中文 Ch

dockerfile用源码包搭建nginx服务器

一.Dockerfile内容如下 FROM centos:latest MAINTAINER [email protected] ENV TIME_ZONE Asia/Shanghai COPY ./nginx-1.9.3.tar.gz /usr/src #RUN set -x \ #? ? ? ? \ #&& yum -y update \ #&& yum -y install gcc make pcre zlib zlib-devel openssl-devel \ #

源码包搭建LNMP环境

1.将LNMP.ISO镜像文件下载到 /root 下 2.挂载光盘镜像,并将LNMP.ISO内容拷贝到 /soft 里面 mkdir  /soft mount  -o  loop LNMP.ISO  /media cd  /media cp   –a  * /soft 3.安装 3.1.解压所有的软件 tar -xvf nginx-1.0.8.tar.gz tar -xvf ncurses-5.9.tar.gz tar -xvf mysql-5.5.23.tar.gz tar -xvf php-

Linux服务篇之十二:源码包构建LAMP服务器

实验环境:Apache服务器一台.Mysql服务器一台.PHP服务器一台 步骤一:安装Apache服务器 1.安装apr yum install gcc-c++ -y yum -y install epel-release tar zxf apr-1.5.2.tar.gz cd apr-1.5.2 ./configure --prefix=/usr/local/apr;echo $? make && make install;echo $? cd .. 2.安装apr-util yum -