http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 安装mysql

rpm -qa | grep mysql  // 这个命令就会查看该操作系统上是否已经安装了mysql数据库

rpm -e --nodeps mysql  // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除

yum install -y mysql-server mysql mysql-deve

service mysqld start

service mysqld restart

mysqladmin -u root password 'root'  // 通过该命令给root账号设置密码为 root

此时我们就可以通过 mysql -u root -p 命令来登录我们的mysql数据库了

二 安装apache

yum install -y gcc gcc-c++

wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz

wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz

wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

2.编译安装:yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs

具体步骤如下:  a:解决apr not found问题>>>>>>

[root@xt test]# tar -zxf apr-1.4.5.tar.gz

[root@xt test]# cd  apr-1.4.5

[root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr

[root@xt apr-1.4.5]# make && make install

b:解决APR-util not found问题>>>>

[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz

[root@xt test]# cd apr-util-1.3.12

[root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config

[root@xt apr-util-1.3.12]# make && make install

c:解决pcre问题>>>>>>>>>

[root@xt test]#unzip -o pcre-8.10.zip

[root@xt test]#cd pcre-8.10

[root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre

[root@xt pcre-8.10]#make && make install

wget http://apache.fayea.com//httpd/httpd-2.4.10.tar.gz

执行命令 tar -zxvf httpd-2.4.10.tar.gz,解压缩后会生成httpd-2.4.10目录
cd httpd-2.4.10 进入httpd-2.4.10目录,搜寻设定内容,执行:

./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl --enable-ssl --enable-module=so --enable-rewrite --enable-cgid --enable-cgi

make

make install

/usr/local/apache/bin/apachectl start  开启

修改端口号 listen 81

ServerName localhost:81

三 PHP

1: wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz

tar -zxvf libiconv-1.13.1.tar.gz cd libiconv-1.13.1 ./configure --prefix=/usr/local/libiconv

make

make install

configure error xml2-config not found. please check your libxml2 installation

yum install libxml2

yum install libxml2-devel -y

[root@rh-linux /] # find / -name "xml2-config"
/usr/bin/xml2-config

如果安装成功以后,在/usr/local/libxml2/目录下将生成bin、include、lib、man和share五个目录。在后面安装PHP5源代码包的配置时,会通过在configure命令的选项中加上"--with-libxml-dir=/usr/ local/libxml2"选项,用于指定安装libxml2库文件的位置。

undefined reference to `libiconv_open 无法编译PHP libiconv

解决方法: #wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz #tar -zxvf libiconv-1.13.1.tar.gz #cd libiconv-1.13.1 # ./configure --prefix=/usr/local/libiconv # make # make install

加上一下这句

--with-iconv=/usr/local/libiconv

wget http://cn2.php.net/distributions/php-5.5.20.tar.gz

tar zvxf php-5.5.20.tar.gz
cd php-5.5.20
./configure --prefix=/usr/local/php --disable-fileinfo --enable-maintainer-zts --with-apxs2=/usr/local/apache/bin/apxs --with-iconv=/usr/local/libiconv --with-config-file-path=/usr/local/php/etc
 
make 
make install

4.重新配置apache2让他支持php

  • 配置 httpd.conf 让apache支持PHP:

  # vi /usr/local/apache/conf/httpd.conf

  找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容

  AddType application/x-httpd-php .php      (.前面有空格)

  AddType application/x-httpd-php-source .phps        (.前面有空格)

在LoadModule php5_module modules/libphp5.so这一行下面添加: AddType application/x-httpd-php .php  (注意:php .php这个点前面有一个空格)

找到:;open_basedir =
修改为:open_basedir = .:/tmp/   #防止php木马跨站
找到:;date.timezone =
修改为:date.timezone = PRC

  • 然后CPOPY PHP的配置文件

  cp php-5.3.8/php.ini.dist /usr/local/php/etc/php.ini

(如果没有php.ini.dist 则把php.ini-development php.ini-production中的任何一个重命名为php.ini.dist即可。)

  修改php.ini文件 register_globals = On

4: NGINX

yum install libtool yum install zlib zlib-devel

yum install openssl

configure: error: You need a C++ compiler for C++ support.  (解决办法: yum install -y gcc gcc-c++)

http://chenzhou123520.iteye.com/blog/1817563  [pcre]安装

http://nginx.org/  下载nginx

wget http://nginx.org/download/nginx-1.0.1.tar.gz

tar zxvf nginx-1.0.1.tar.gz

cd nginx-1.0.1/

./configure --prefix=/usr/local/nginx --with-http_stub_status_module   --with-pcre=这里是pcre的源代码目录 ,不是安装目录

make && make install

nginx的启动命令是:

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

# /usr/local/nginx/sbin/nginx -s  reload 
nginx已经重启成功

配置 :

location / {
            root   /usr/local/apache/htdocs;
            index  index.html index.htm;
        }

location ~ \.php$ {
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass   http://127.0.0.1:81;
        }
        location ~.*\.(jpg|jepg|png)$ {
            root   /usr/local/apache/htdocs;
            access_log off;
            expires  3d;
        }
        location ~.*\.(js|css)$ {
            root   /usr/local/apache/htdocs;
            access_log off;
            expires 3d;
        }

 

php+mysql+apache+nginx的更多相关文章

  1. 关于mysql/apache/nginx的配置文件配置

    2015.5.12 mysql中可以通过函数查看用户列表/查看当前用户以及删除用户,方法百度之,忘了 /etc/php5/fpm/php.ini memory_limit修改之前为128M apach ...

  2. 阿里云ECS Ubuntu安装PHP+Mysql+Apache+Nginx+Redis+Discuz

    http://www.linuxdiyf.com/linux/13662.html http://blog.csdn.net/wangnan537/article/details/47868659 h ...

  3. Centos上Apache重启,mysql重启,nginx重启方法

    转载:http://www.3lian.com/edu/2012/04-01/24278.html Centos上Apache重启,mysql重启, nginx 重启方法 1.重启 apache se ...

  4. centos7 配置 zabbix 3 & apache , nginx 与php, mysql 的交互(基本)

    #yum install -y https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-server-mysql-3.0.0 ...

  5. ***LANMP镜像手册(Apache&Nginx)-lanmp-oneinstack

    LANMP镜像手册(Apache&Nginx) Version PHP7.0.26  转自:http://docs.websoft9.com/xdocs/lanmp-oneinstack-im ...

  6. Apache+Nginx+php共存(一)

    在实际开发中个人的电脑中经常需要安装 WNMRP.WAMRP.LNMRP.LAMRP等各种开发环境来应对不同的开发需求. 此篇主要是对WINDOWS系统下 Apache+Nginx + PHP +My ...

  7. ubuntu apache nginx 启动 关闭

    转载自:http://www.comflag.com/2011/05/01/apache-web.htm 电影<社交网络>中,facebook创始人马克.扎克失恋后入侵哈佛大学宿舍楼服务器 ...

  8. 攻防环境配置大全(iss/apache/nginx/tomcat/jboss/weblogic)

    一.IIS/apache/nginx/tomcat 介绍 1.asp aspx 只能在微软系统的iis中间件运行 [asp+IIS+access(扩展名为mdb)].aspx+mssql+iis结合, ...

  9. web服务器【apache/nginx] 关闭目录的浏览权限

    web服务器[apache/nginx] 关闭目录的浏览权限 我的配置(将Options 中的Indexes干掉): <VirtualHost *:80> ServerAdmin webm ...

随机推荐

  1. 16.10.18学到的Java知识

    1. 突然间发现自己忘了关于自增自减运算符放在变量前后的区别是什么了? 于是乎,我查了资料. 如果只对自变量进行加1或减1的时候,放在前面和后面都是没有区别的. 但是,如果自增自减运算符使用在需要赋值 ...

  2. Send SqlParameter to Dapper

    Question: I' using Dapper in my project. I have a list of SqlParameters and I want to send it to Dap ...

  3. TCP协议学习记录 (二) Ping程序

    简单的实现了一个ping程序,没有做icmp差错报文的检查. 支持自定义字节数,支持发包个数 #pragma pack(4) #define ECHO_REQUEST 8 #define DATASI ...

  4. CSS盒子模型的理解

    标准的CSS盒子模型包括:内容(content).填充(padding).边框(border).边界(margin) 这些属性,可以把它转移到我们日常生活中的盒子(箱子)上来理解,日常生活中所见的盒子 ...

  5. 微信公众平台创建自定义菜单中文编码导致system error

    创建包含了中文的自定义菜单时总是返回{"errcode":-1,"errmsg":"system error"},要将编码方式设置为UTF- ...

  6. WinForm用户自定义控件,在主窗体加载时出现闪烁;调用用户控件出现闪烁,需要鼠标才能够显示

    转载自:http://www.dotblogs.com.tw/rainmaker/archive/2012/02/22/69811.aspx 解决方案: 在调用用户控件的窗体里面添加一下代码: pro ...

  7. 强连通分量的一二三 | | JZOJ【P1232】 | | 我也不知道我写的什么

    贴题: 在幻想乡,上白泽慧音是以知识渊博闻名的老师.春雪异变导致人间之里的很多道路都被大雪堵塞,使有的学生不能顺利地到达慧音所在的村庄.因此慧音决定换一个能够聚集最多人数的村庄作为新的教学地点.人间之 ...

  8. 2-6 Working with Lambdas

    在C++中使用匿名函数,格式如下:[] () {}; Using a Lambda to Print array Values #include <algorithm> #include ...

  9. PC和HOST之间文件传送

    从PC到HOST 文件传送表(*.srl) C:\123.txt text ~'LIANG.TEST.LIB.123' 批处理文件(*.bat) SEND "PC文件全路径" 'H ...

  10. Shell使用技巧

    巧用定界符delimiter 输入大段文本的地方 自动选择和输入的地方 访问数据库 Angel@DESKTOP-254LBLA ~ $ cat > out.txt << EOF &g ...