LAMP环境配置安装注意安装步骤及说明事项。

LAMP安装各种问题解决

1. 访问ftp报错

解决:

关闭selinux

vi /etc/selinux/config

内容修改为: selinux=disable

之后重启reboot。

下图分别为selinux关闭前 和 关闭后:

2. 依赖软件查询

http://rpmfind.net

一.安装gcc

gcc

cloog-ppl

ppl(libppl.so.7/libppl_c.so.2)

cpp

mpfr(libmpfr.so.1)

gcc-c++

libstdc++-devel

mpfr-2.4.1-6.el6.i686.rpm和ppl-0.10.2-11.el6.i686.rpm

快捷键rz sz:

rz、sz命令没找到?

安装lrzsz即可:

shell># yum -y install lrzsz

二.安装zlib压缩库

shell>## cd /home/jinnan/tar

shell># tar –zxvf zlib-1.2.5.tar.gz

shell># cd zlib-1.2.5

shell># ./configure     //这个配置编译命令不要加目录参数

shell># make && make install

三.安装apache

shell># cd /home/jinnan/tar

shell># tar -jxvf httpd-2.2.19.tar.bz2

shell># cd httpd-2.2.19

shell>#./configure --prefix=/usr/local/http2 \

--enable-modules=all \

--enable-mods-shared=all \

--enable-so

shell># make && make install

启动Apache

shell># /usr/local/http2/bin/apachectl start

#测试apache

浏览器打开: http://虚拟机IP

看到 "it works!",即为成功

配置虚拟主机

1)配置host文件

打开C:/windows/system32/drivers/etc/hosts 文件

增加域名记录

如:

192.168.9.38    www.ec1.com

192.168.9.38    www.ec2.com

2) 增加虚拟主机

vi /usr/local/http2/conf/httpd.conf

取消# Include conf/extra/httpd-vhosts.conf

这一行前面的#号

保存退出

vi /usr/local/http2/conf/extra/httpd-vhosts.conf

增加虚拟主机记录

<VirtualHost *:80>

ServerAdmin webmaster@dummy-host.example.com

DocumentRoot "/usr/local/http2/htdocs/ec1"

ServerName www.ec1.com

ServerAlias www.dummy-host.example.com

ErrorLog "logs/dummy-host.example.com-error_log"

CustomLog "logs/dummy-host.example.com-access_log" common

</VirtualHost>

<VirtualHost *:80>

ServerAdmin webmaster@dummy-host2.example.com

DocumentRoot "/usr/local/http2/htdocs/ec2"

ServerName www.ec2.com

ErrorLog "logs/dummy-host2.example.com-error_log"

CustomLog "logs/dummy-host2.example.com-access_log" common

</VirtualHost>

<VirtualHost *:80>

DocumentRoot "/var/www/shop"

ServerName www.ec1.com

</VirtualHost>

注意:/var/www/shop 以上三个目录var www shop 的其他用户必须有x可执行权限

3)

shell># cd /usr/local/http2/htdocs

shell># mkdir ec1 ec2

shell># echo this is ec1.com > ec1/index.html

shell># echo this is ec2.com > ec2/index.html

4)重启apache

/usr/local/http2/bin/apachectl restart

5)浏览器打开www.ec1.com,和www.ec2.com

看到不同的网站内容,虚拟主机创建完毕!

安装图形库,为编译PHP做准备

libxml2-2.7.2.tar.gz

jpegsrc.v8b.tar.gz

libpng-1.4.3.tar.gz

freetype-2.4.1.tar.gz

gd-2.0.35.tar.gz

四.安装libxml2

shell># cd /home/jinnan/tar

shell># tar zxvf libxml2-2.7.2.tar.gz

shell># cd libxml2-2.7.2

shell>#./configure --prefix=/usr/local/libxml2 \

--without-zlib

shell># make && make install

五.安装jpeg8

shell># cd /home/jinnan/tar

shell># tar -zxvf jpegsrc.v8b.tar.gz

shell># cd jpeg-8b

shell>#./configure --prefix=/usr/local/jpeg \

--enable-shared --enable-static

shell># make && make install

--enable-shared 把jpeg需要的函数库程序都编译到该软件里边

优点:函数调用速度快

缺点:软件本身比较大

--enable-static 静态方式函数处理,需要什么函数,马上include来

优点:软件本身比较小

缺点:函数调用速度慢

六.安装libpng

shell># cd /home/jinnan/tar

shell># tar zxvf libpng-1.4.3.tar.gz

shell># cd libpng-1.4.3

shell>#./configure #和zlib一样不要带参数,让它默认安装到相应目录

shell># make && make install

七.安装freetype(字体库)

shell># cd /home/jinnan/tar

shell># tar zxvf freetype-2.4.1.tar.gz

shell># cd freetype-2.4.1

shell>#./configure --prefix=/usr/local/freetype

shell># make && make install

八.安装GD库

shell># cd /home/jinnan/tar

shell># tar -zvxf gd-2.0.35.tar.gz

shell># mkdir -p /usr/local/gd

shell># cd gd-2.0.35

shell>#./configure --prefix=/usr/local/gd \

--with-jpeg=/usr/local/jpeg/     \

--with-png --with-zlib \

--with-freetype=/usr/local/freetype

shell># make && make install

九.安装 php5

shell># cd /home/jinnan/tar

shell># tar -jxvf php-5.3.6.tar.bz2

shell># cd php-5.3.6

shell>#./configure --prefix=/usr/local/php \

--with-apxs2=/usr/local/http2/bin/apxs \

--with-mysql=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-mysqli=mysqlnd \

--with-freetype-dir=/usr/local/freetype \

--with-gd=/usr/local/gd \

--with-zlib --with-libxml-dir=/usr/local/libxml2 \

--with-jpeg-dir=/usr/local/jpeg \

--with-png-dir \

--enable-mbstring=all \

--enable-mbregex \

--enable-shared

shell># make && make install

复制php.ini配置文件到指定目录

shell># cp php.ini-development /usr/local/php/lib/php.ini

配置Apache使其支持php

vi /usr/local/http2/conf/httpd.conf

AddType application/x-httpd-php .php

<IfModule dir_module>

DirectoryIndex index.html

</IfModule>

在index.html 前面添加index.php

vi /usr/local/apache2/htdocs/index.php

输入如下内容:

<?php

phpinfo();

?>

shell># /usr/local/http2/bin/apachectl restart

如果看到php信息,工作就完成了!

  1. 1.安装cmake

    shell># cd /home/jinnan/tar

    shell># tar zxvf cmake-2.8.5.tar.gz

    shell># cd cmake-2.8.5

    shell># ./bootstrap

    shell># make && make install

    2.编译安装MySQL

    shell># cd /home/jinnan/tar

    shell># tar zxvf mysql-5.5.17.tar.gz

    shell># cd mysql-5.5.17

    shell># cmake \

    -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

    -DMYSQL_DATADIR=/usr/local/mysql/data \

    -DDEFAULT_CHARSET=utf8 \

    -DDEFAULT_COLLATION=utf8_general_ci

    (准备安装到那里

    数据存储目录

    默认的字符集

    校对字符集)

    (报错就安装ncurses-devel)

    shell># mount .....挂载光盘/

    shell># rpm -ivh ncurses-devel-5.7-3.20090208.el6.i686.rpm

    shell># rm -f CMakeCache.txt //删除该文件

    shell># cmake 。。。
    。。。
    //重新cmake

    shell># make && make install

    shell># cp support-files/my-medium.cnf /etc/my.cnf

    3.配置并初始化MySQL

    shell># useradd mysql    (该mysql用户会存在于同名的组下)

    shell># chmod +x /usr/local/mysql

    (数据库用户信息不小心删除光了,删除data目录,从此开始执行以下指令,直至结束)

    shell># chown -R mysql.mysql /usr/local/mysql

    初始化mysql数据库

    shell># /usr/local/mysql/scripts/mysql_install_db \

    --user=mysql \

    --basedir=/usr/local/mysql \

    --datadir=/usr/local/mysql/data &

    把mysql安装文件(除了data)的主人都改为root,避免数据库恢复为出厂设置。

    shell># chown -R root /usr/local/mysql

    shell># chown -R mysql /usr/local/mysql/data

    & 后台运行mysql服务

    shell># /usr/local/mysql/bin/mysqld_safe --user=mysql &

    //查看mysql是否有启动

    shell># ps –A | grep mysql

    测试数据库

    shell># /usr/local/mysql/bin/mysql –u root

    mysql> show databases;

    接上步,修改mysql密码(可不做此步,默认无密码)

    mysql> UPDATE user SET Password=password('123456') WHERE user='root';

    mysql>
    flush privileges;

  2. shell># cp 安装包解压目录/support-files/mysql.server /etc/init.d/mysqld

    shell># chmod +x /etc/init.d/mysqld

    shell># chkconfig --add mysqld

    shell># chkconfig mysqld on //设置开机自启动

    配置文件路径:

    shell>#
    vi /etc/rc.d/rc.local


    文件中增加启动相关服务的命令如下:

    /usr/local/http2/bin/apachectl start

    /usr/local/mysql/bin/mysqld_safe --user=mysql &

    service vsftpd start

    重新安装apache启动失败

    [root@localhost httpd-2.2.19]# /usr/local/http2/bin/apachectl restart

    httpd not running, trying to start

    (98)Address already in use: make_sock: could not bind to address [::]:80

    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80

    no listening sockets available, shutting down

    Unable to open logs

    原因是80端口被占用

    解决:

    查看80端口使用情况

    [root@localhost httpd-2.2.19]# netstat -lnp|grep 80

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

    unix 2 [ ACC ] STREAM LISTENING 6580 1957/gpm /dev/gpmctl

    unix 2 [ ACC ] STREAM LISTENING 5422 1800/pcscd /var/run/pcscd.comm

    查看80的使用者是谁端口

    [root@localhost httpd-2.2.19]# ps 28195

    PID TTY STAT TIME COMMAND

    28195 ? Ss 0:00 /usr/local/http2/bin/httpd -k restart

    经过分析知道了80端口被系统的一个进程占用,这个进程是旧的apache服务

    将这个进程杀之

    [root@localhost httpd-2.2.19]# kill -9 28195

    [root@localhost httpd-2.2.19]#

    十一.卸载操作系统自带apache

killall httpd 杀死全部的httpd进程

LAMP安装各种问题解决方案的更多相关文章

  1. HHvm建站环境搭建方法:Nginx,Mariadb,hhvm及lnmp/lamp安装部署

    HHVM起源于Facebook公司,是一个开源的PHP虚拟机,使用JIT的编译方式以及其他技术,让PHP代码的执行性能大幅提升.HHVM提升PHP性能的途径,采用的方式就是替代Zend引擎来生成和执行 ...

  2. Lamp安装 php-v5.6【ZendGuardLoader】的问题

    Lamp安装 php-v5.6[ZendGuardLoader]的问题 标签(空格分隔):php,linux Apache日志: 就这个问题导致无法解析运行php文件.下面是网上找的解决方案 Zend ...

  3. CentOS7 lamp安装 centoOS6 lamp

    快速lamp安装 How To Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 7 Introduction A "LAMP ...

  4. 关于MySQL-python-1.2.3.tar.gz安装失败的解决方案

    关于MySQL-python-1.2.3.tar.gz安装失败的解决方案 RHEL6.4升级到python2.7.9,然后安装 MySQL-python-1.2.3.tar.gz, 报错.解决错误之后 ...

  5. Linux(lamp安装)

    网络配置 1. 配置ip地址和子网掩码 编辑配置文件: > cd  /etc/sysconfig/network-scripts > cp  ifcfg-eth0  ./ifcfg-eth ...

  6. QT5.4.0安装以及与VS2010整合安装---64bit操作系统解决方案

    QT5.4.0安装以及与VS2010整合安装---64bit操作系统解决方案 注意,目前QT官网不能下载,必须提供注册,然后才可以下载. 网上不同版本安装的细节有差异,特将我的安装相关操作贴出来,希望 ...

  7. lamp 安装 apache

    lamp安装 httpd-2.2.4.tar.gz :http://download.csdn.net/detail/wulvla020311/8046141 先检查一下装的东西都在不在:rpm -q ...

  8. linux基础——文件挂载,lamp安装

    一. 文件挂载 lsblk -f 显示文件系统信息 mount -t vfat UUID="ffffffffff" /mnt   挂载到/mnt目录 Linux针对于各式U盘挂载方 ...

  9. iOS7.1企业版发布后用户通过sarafi浏览器安装无效的解决方案

    关于iOS7.1企业版发布后,用户通过sarafi浏览器安装无效的解决方案: 通过测试,已经完美解决. 方案一: iOS7.1企业应用无法安装应用程序 因为证书无效的解决方案 http://blog. ...

随机推荐

  1. Microsoft.Bcl.Build 1.0.10 稳定版发布

    Microsoft.Bcl.Build 1.0.10 稳定版发布 解决了之前 1.0.8 在未下载相应的Nuget Package 的情况下项目无法加载的情况 但由于 Microsoft.Net.Ht ...

  2. java编程思想读书笔记三(11-21)

    十一:持有对象 >持有对象实例 ●数组将数字与对象联系起来.它保存类型明确的对象,查询对象时,不需要对结果做类型转换.他可以是多维的. 可以保存基本的数据类型.但是,数组一旦生成,容量就不会在变 ...

  3. jquery.roundabout.js实现3D图片层叠旋转木马切换

    最近项目中需要实现3D图片层叠旋转木马切换的效果,于是用到了jquery.roundabout.js. 兼容性如图: html结构代码: <div id="featured-area& ...

  4. 网格弹簧质点系统模拟(Spring-Mass System by Verlet Integration)附源码

    模拟物体变形最简单的方法就是采用弹簧质点系统(Spring-Mass System),由于模型简单并且实用,它已被广泛应用于服饰.毛发以及弹性固体的动态模拟.对于三角网格而言,弹簧质点系统将网格中的顶 ...

  5. Android驱动入门-LED--测试APP编写③

    硬件平台: FriendlyARM Tiny4412 Cortex-A9 操作系统: UBUNTU 14.04 LTS 时间:2016-09-24  10:47:03 在Android Studio中 ...

  6. Quartz集群配置

    先看看quartz的持久化基本介绍: 引用 1 大家都清楚quartz最基本的概念就是job,在job内调用具体service完成具体功能,quartz需要把每个job存储起来,方便调度,quartz ...

  7. Linq语法详细(转)

    原文地址:http://www.cnblogs.com/knowledgesea/p/3897665.html 开门见山 读这篇文章之前,我先说下,每一种搜索结果集,我都以三种方式变现出来,为啦更好的 ...

  8. Mysql备份系列(4)--lvm-snapshot备份mysql数据(全量+增量)操作记录

    Mysql最常用的三种备份工具分别是mysqldump.Xtrabackup(innobackupex工具).lvm-snapshot快照.前面分别介绍了:Mysql备份系列(1)--备份方案总结性梳 ...

  9. Kali linux渗透测试常用工具汇总2-渗透攻击

    渗透攻击的思路一般是扫描漏洞,然后利用不同的漏洞,才有针对的渗透攻击. 漏洞扫描的工具有Nessus,该工具可同时在本地或远端遥控,对系统的漏洞分析扫描.Nessus通过新建扫描策略,并添加对应的插件 ...

  10. Java 日志性能优化

    1. 选择合理的日志级别.合理控制日志内容 2. 控制日志的输出内容和格式 logger.debug("Entry number: " + i + " is " ...