ubuntu10.04编译安装LAMP以及简单wordpress的使用 : http://linuxme.blog.51cto.com/1850814/971631
一、源码安装LAMP
网上有一堆关于介绍lamp的在这里我就不罗嗦了,直接上配置过程
1.apr包的安装
apr简介:
The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations.
The primary goal is to provide an API to which software developers may code and be assured of predictable if not identical behaviour regardless of the platform on which their software is built, relieving them of the need to code special-case conditions to work around or take advantage of platform-specific deficiencies or features.
下载地址:
wget http://labs.mop.com/apache-mirror//apr/apr-1.4.6.tar.gz
wget http://labs.mop.com/apache-mirror//apr/apr-util-1.4.1.tar.gz
tar xvf apr-1.4.6.tar.gz
tar xvf apr-util-1.4.1.tar.gz
cd apr-1.4.6
./configure
make
make install
在编译时有可能会出现以下问题
cannot remove `libtoolT': No such file or directory
解决方法:
vim configure
把RM='$RM'改为RM='$RM -f',在configure里面 RM='$RM -f' 这里的$RM后面一定有一个空格。 如果后面没有空格,直接连接减号,就依然会报错。
cd apr-util-1.4.1
./configure --with-apr=/usr/local/apr
make
make install
安装Apache/httpd时可能会出现标题错误,
下载对应软件包安装:
http://archive.apache.org/dist/apr/apr-1.5.1.tar.gz
http://archive.apache.org/dist/apr/apr-util-1.5.1.tar.gz
http://jaist.dl.sourceforge.NET/project/pcre/pcre/8.35/pcre-8.35.tar.gz
然后在安装Httpd的./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,这个问题就解决
如果使用的是apt-get 安装apr
apt-get install libaprutil1-dev libapr1-dev
在编译安装apache是会报错:
rotatelogs.c:(.text+0x603): undefined reference to `apr_file_link'
collect2: ld returned 1 exit status
make[2]: *** [rotatelogs] Error 1
make[2]: Leaving directory `/root/lamp/httpd-2.4.2/support'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/root/lamp/httpd-2.4.2/support'
make: *** [install-recursive] Error 1
原因是apr的版本太低,解决办法:源码安装apr较新包
2.apache包的安装
下载地址:
wget http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.4.3.tar.bz2
tar xvf httpd-2.4.3.tar.bz2
cd httpd-2.4.3
./configure --prefix=/usr/local/apache2 --enable-modules=shared --enable-so --enable-deflate --enable-expires --enable-headers --enable-rewrite --with-included-apr=/usr/local/apr --with-included-apr-util
make
make install
编译过程中可能遇到
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
解决方法:apt-get install libpcre3-dev
checking for zlib location... not found
checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决方法:apt-get install zlib1g-dev
启动、重启和停止
/usr/local/apache2/bin/apachectl -k start
/usr/local/apache2/bin/apachectl -k restart
/usr/local/apache2/bin/apachectl -k stop
每次启动都输入那么长的命令是不是很烦,解决方法:
a.软连接的PATH路径,
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
ln -sv /usr/local/apache2/bin/* /usr/sbin (或者/usr/bin、/usr/local/bin等)
然后就可以直接在终端用:
apachectl -k start
apachectl -k restart
apachectl -k stop
b.把/usr/local/apache2/bin/加入PATH路径
vim /etc/profile
#增加
PATH="$PATH:/usr/local/apache2/bin"
source /etc/profile
apache配置文件的修改:
vim /usr/local/apache2/conf/httpd.conf
找到:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在后面添加:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
找到:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
添加:
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
找到:
#ServerName www.example.com:80
修改为:
ServerName yourhostip:80
重启apache: apachectl -k restart
通过浏览器访问:http://yourhostip
应该显示:It works!
3.mysql的安装
请参考:
初始化mysql数据库时可能会遇到:
./bin/mysqld: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
解决方法:apt-get install libstdc++5
4.php的安装
下载地址:
wget http://cn.php.net/get/php-5.4.6.tar.bz2/from/this/mirror
tar xvf php-5.4.6.tar.bz2
cd php-5.4.6
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-curl --with-mcrypt --enable-mbstring --enable-pdo --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-imap-ssl --with-gd --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ --enable-exif --enable-zip --enable-dba=shared --with-mysql=/usr/local/mysql
这一步可能会遇到:
/usr/bin/ld: cannot find -liconv
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
解决办法:
apt-get install libglobus-libtool-dev
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
解决办法:apt-get install libxml2-dev
configure: error: Cannot find OpenSSL's <evp.h>
解决方法:apt-get install libssl-dev
checking if we should use cURL for url streams... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
解决方法:apt-get install libcurl4-openssl-dev
configure: error: jpeglib.h not found.
解决方法:apt-get install libjpeg62-dev
configure: error: png.h not found.
解决方法:apt-get install libpng-dev
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决方法:apt-get install libmcrypt-dev
php 5.4.6 make 时在apprentice.c -o ext/fileinfo/libmagic/apprentice.lo 没反应了
在网上查了查是内存不足,这一步要编译过去至少要有1G内存,我只有300M的内存。
把该虚拟机内存调到1.2G,这一步就ok了
以上编译过程中产生的编译错误,当然如果你搭建过n边LAMP环境就可以直接以下操作,是不是省事很多
apt-get install -y curl libxml2 libxml2-dev libssl-dev sendmail libcurl4-openssl-dev libjpeg-dev libpng-dev libmcrypt-dev
不知道大家发现规律没有,一般在ubuntu下编译通过不了,根椐报错找到XXXX-dev的包安装即可。如果你人品差,apt-get 安装的包版本太低
那就需要下载更新的软件包编译安装了。
make
make test
make install
cp php.ini-production /usr/local/php/lib/php.ini
vim /etc/profile
PATH=$PATH:/usr/local/php/bin/
source /etc/profile
验证一下php是否正确安装:
apachectl -k restart
cd /usr/local/apache2/htdocs
vim index.php
<?php
phpinfo();
?>
通过浏览器访问:http://yourhostip/index.php
如果能正确访问说明php安装ok了
测试php与mysql的链接性
设置mysql的权限:允许通过本机或同一网段的主机链接mysql server,同一网段(192.168.12.0)如:192.168.12.%
mysql -uroot -predhat
mysql>grant all privileges on *.* to 'root'@'yourhostip_in_network';
测试链接脚本:
vim /usr/local/apache2/htdocs/index.php
<?php
$link=mysql_connect('yourhostip','root','redhat');
if(!$link)
echo "connect mysql failing...";
else
echo "connect mysql successful...";
mysql_close();
?>
通过浏览器访问:http://yourhostip/index.php
提示:500错误,这样也看不出具体哪出错了
在终端下直接用php执行index.php
php index.php
提示:PHP Fatal error: Call to undefined function mysql_connect()
google 了一下大部分说在php.ini中把,extension=msql.so 的注释去掉,改了之后还是不行而且还会有新的错误,有两种方法可以解决:
a.是在configure 时没有关联mysql导致的,在configure 后加 --with-mysql=/usr/local/mysql,重新编译安装php就行了
b.msql.so文件不存在,生成.so文件
cd php-5.4.6/ext/mysql
安装autoconf,因为phpize命令执行生成configure文件需要
apt-get install autoconf
执行命令
phpize
在当前目录下会生成configure文件
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysql=/usr/local/mysql
make
make install
在/usr/local/php/lib/php/extensions/no-debug-zts-20100525/目录下自动生成mysql.so文件
修改配置文件:vim /usr/local/php/lib/php.ini
去掉注释并修改extension=mysql.so
为什么会出现上述的问题?原因很简单你在编译时没有让php包含进mysql的一些库函数,那样在php脚本中就不能用mysql的函数去操作数据库。要么我们重新编译,要么不重新编译生成扩展文件xxx.so.
ok,到此LAMP的环境就搭建好了,下面我们基于LAMP环境搭建wordpress博客平台
二、安装wordpress
下载wordpress:wget http://cn.wordpress.org/wordpress-3.4.1-zh_CN.zip
apt-get install unzip
unzip wordpress-3.4.1-zh_CN.zip
mv wordpress /usr/local/apache2/htdocs/
数据库的设置:
mysql -uroot -predhat
mysql>create database wordpress;
mysql>grant all privileges on wordpress.* to 'wpuser'@'10.48.255.%' identified by "redhat";
mysql>flush privileges;
修改wordpress的配置文件:
cp /usr/local/apache2/htdocs/wordpress/wp-config-sample.php /usr/local/apache2/htdocs/wordpress/wp-config.php
vim /usr/local/apache2/htdocs/wordpress/wp-config.php
#修改一下几行
define('DB_NAME', 'wordpress');
/** MySQL 数据库用户名 */
define('DB_USER', 'wpuser');
/** MySQL 数据库密码 */
define('DB_PASSWORD', 'redhat');
/** MySQL 主机 */
define('DB_HOST', '10.48.255.244');
通过浏览器:http://yourhostip/wordpress/
完成剩余的配置
通过admin登入,在设置常规中开启,任何人都可以注册,然后访问wordpress就可以看到注册按钮了
实现用户注册,需邮件激活:
注册一个用户,发现他是把激活信息发到邮箱,打开邮箱但是没有邮件;手动找回密码,显示可能原因:您的主机禁用了 mail() 函数...
google是因为少了发邮件的插件:WP Mail SMTP,插件的下载:
wget http://downloads.wordpress.org/plugin/wp-mail-smtp.0.9.1.zip
unzip wp-mail-smtp.0.9.1.zip
wordpress插件的安装同cacti差不多,把插件copy到相应的目录下即可
mv wp-mail-smtp /usr/local/apache2/htdocs/wordpress/wp-content/plugins
以管理员的身份登入:插件--》启动WP-Mail——SMTP--》Settings
From Email example@126.com
From Name nsfocus
Mailer Send all WordPress emails via SMTP
Return Path 勾上
smtp host smtp.126.com
Authentication Yes
username example@126.com
password xxxxxxxxx
保存,再试,ok email 发过来了,但是点击激活信息时提示:抱歉,该 key 似乎无效
解决方法:
找到wordpress根目录下的的wp-login.php文件:找到下面的字符串:
$message .= ‘<' . network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user_login), ‘login’) . “>\r\n”;
改成
$message .= network_site_url(“wp-login.php?action=rp&key=$key&login=”. rawurlencode($user_login), ‘login’) . “\r\n”;
也就是把 左边的 '<'. 和最后的 > 删掉就解决了
一、源码安装LAMP
网上有一堆关于介绍lamp的在这里我就不罗嗦了,直接上配置过程
1.apr包的安装
apr简介:
The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations.
The primary goal is to provide an API to which software developers may code and be assured of predictable if not identical behaviour regardless of the platform on which their software is built, relieving them of the need to code special-case conditions to work around or take advantage of platform-specific deficiencies or features.
下载地址:
wget http://labs.mop.com/apache-mirror//apr/apr-1.4.6.tar.gz
wget http://labs.mop.com/apache-mirror//apr/apr-util-1.4.1.tar.gz
tar xvf apr-1.4.6.tar.gz
tar xvf apr-util-1.4.1.tar.gz
cd apr-1.4.6
./configure
make
make install
在编译时有可能会出现以下问题
cannot remove `libtoolT': No such file or directory
解决方法:
vim configure
把RM='$RM'改为RM='$RM -f',在configure里面 RM='$RM -f' 这里的$RM后面一定有一个空格。 如果后面没有空格,直接连接减号,就依然会报错。
cd apr-util-1.4.1
./configure --with-apr=/usr/local/apr
make
make install
如果使用的是apt-get 安装apr
apt-get install libaprutil1-dev libapr1-dev
在编译安装apache是会报错:
rotatelogs.c:(.text+0x603): undefined reference to `apr_file_link'
collect2: ld returned 1 exit status
make[2]: *** [rotatelogs] Error 1
make[2]: Leaving directory `/root/lamp/httpd-2.4.2/support'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/root/lamp/httpd-2.4.2/support'
make: *** [install-recursive] Error 1
原因是apr的版本太低,解决办法:源码安装apr较新包
2.apache包的安装
下载地址:
wget http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.4.3.tar.bz2
tar xvf httpd-2.4.3.tar.bz2
cd httpd-2.4.3
./configure --prefix=/usr/local/apache2 --enable-modules=shared --enable-so --enable-deflate --enable-expires --enable-headers --enable-rewrite --with-included-apr=/usr/local/apr --with-included-apr-util
make
make install
编译过程中可能遇到
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
解决方法:apt-get install libpcre3-dev
checking for zlib location... not found
checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决方法:apt-get install zlib1g-dev
启动、重启和停止
/usr/local/apache2/bin/apachectl -k start
/usr/local/apache2/bin/apachectl -k restart
/usr/local/apache2/bin/apachectl -k stop
每次启动都输入那么长的命令是不是很烦,解决方法:
a.软连接的PATH路径,
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
ln -sv /usr/local/apache2/bin/* /usr/sbin (或者/usr/bin、/usr/local/bin等)
然后就可以直接在终端用:
apachectl -k start
apachectl -k restart
apachectl -k stop
b.把/usr/local/apache2/bin/加入PATH路径
vim /etc/profile
#增加
PATH="$PATH:/usr/local/apache2/bin"
source /etc/profile
apache配置文件的修改:
vim /usr/local/apache2/conf/httpd.conf
找到:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在后面添加:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
找到:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
添加:
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
找到:
#ServerName www.example.com:80
修改为:
ServerName yourhostip:80
重启apache: apachectl -k restart
通过浏览器访问:http://yourhostip
应该显示:It works!
3.mysql的安装
请参考:
初始化mysql数据库时可能会遇到:
./bin/mysqld: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
解决方法:apt-get install libstdc++5
4.php的安装
下载地址:
wget http://cn.php.net/get/php-5.4.6.tar.bz2/from/this/mirror
tar xvf php-5.4.6.tar.bz2
cd php-5.4.6
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-curl --with-mcrypt --enable-mbstring --enable-pdo --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-imap-ssl --with-gd --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ --enable-exif --enable-zip --enable-dba=shared --with-mysql=/usr/local/mysql
这一步可能会遇到:
/usr/bin/ld: cannot find -liconv
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
解决办法:
apt-get install libglobus-libtool-dev
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
解决办法:apt-get install libxml2-dev
configure: error: Cannot find OpenSSL's <evp.h>
解决方法:apt-get install libssl-dev
checking if we should use cURL for url streams... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
解决方法:apt-get install libcurl4-openssl-dev
configure: error: jpeglib.h not found.
解决方法:apt-get install libjpeg62-dev
configure: error: png.h not found.
解决方法:apt-get install libpng-dev
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决方法:apt-get install libmcrypt-dev
php 5.4.6 make 时在apprentice.c -o ext/fileinfo/libmagic/apprentice.lo 没反应了
在网上查了查是内存不足,这一步要编译过去至少要有1G内存,我只有300M的内存。
把该虚拟机内存调到1.2G,这一步就ok了
以上编译过程中产生的编译错误,当然如果你搭建过n边LAMP环境就可以直接以下操作,是不是省事很多
apt-get install -y curl libxml2 libxml2-dev libssl-dev sendmail libcurl4-openssl-dev libjpeg-dev libpng-dev libmcrypt-dev
不知道大家发现规律没有,一般在ubuntu下编译通过不了,根椐报错找到XXXX-dev的包安装即可。如果你人品差,apt-get 安装的包版本太低
那就需要下载更新的软件包编译安装了。
make
make test
make install
cp php.ini-production /usr/local/php/lib/php.ini
vim /etc/profile
PATH=$PATH:/usr/local/php/bin/
source /etc/profile
验证一下php是否正确安装:
apachectl -k restart
cd /usr/local/apache2/htdocs
vim index.php
<?php
phpinfo();
?>
通过浏览器访问:http://yourhostip/index.php
如果能正确访问说明php安装ok了
测试php与mysql的链接性
设置mysql的权限:允许通过本机或同一网段的主机链接mysql server,同一网段(192.168.12.0)如:192.168.12.%
mysql -uroot -predhat
mysql>grant all privileges on *.* to 'root'@'yourhostip_in_network';
测试链接脚本:
vim /usr/local/apache2/htdocs/index.php
<?php
$link=mysql_connect('yourhostip','root','redhat');
if(!$link)
echo "connect mysql failing...";
else
echo "connect mysql successful...";
mysql_close();
?>
通过浏览器访问:http://yourhostip/index.php
提示:500错误,这样也看不出具体哪出错了
在终端下直接用php执行index.php
php index.php
提示:PHP Fatal error: Call to undefined function mysql_connect()
google 了一下大部分说在php.ini中把,extension=msql.so 的注释去掉,改了之后还是不行而且还会有新的错误,有两种方法可以解决:
a.是在configure 时没有关联mysql导致的,在configure 后加 --with-mysql=/usr/local/mysql,重新编译安装php就行了
b.msql.so文件不存在,生成.so文件
cd php-5.4.6/ext/mysql
安装autoconf,因为phpize命令执行生成configure文件需要
apt-get install autoconf
执行命令
phpize
在当前目录下会生成configure文件
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysql=/usr/local/mysql
make
make install
在/usr/local/php/lib/php/extensions/no-debug-zts-20100525/目录下自动生成mysql.so文件
修改配置文件:vim /usr/local/php/lib/php.ini
去掉注释并修改extension=mysql.so
为什么会出现上述的问题?原因很简单你在编译时没有让php包含进mysql的一些库函数,那样在php脚本中就不能用mysql的函数去操作数据库。要么我们重新编译,要么不重新编译生成扩展文件xxx.so.
ok,到此LAMP的环境就搭建好了,下面我们基于LAMP环境搭建wordpress博客平台
二、安装wordpress
下载wordpress:wget http://cn.wordpress.org/wordpress-3.4.1-zh_CN.zip
apt-get install unzip
unzip wordpress-3.4.1-zh_CN.zip
mv wordpress /usr/local/apache2/htdocs/
数据库的设置:
mysql -uroot -predhat
mysql>create database wordpress;
mysql>grant all privileges on wordpress.* to 'wpuser'@'10.48.255.%' identified by "redhat";
mysql>flush privileges;
修改wordpress的配置文件:
cp /usr/local/apache2/htdocs/wordpress/wp-config-sample.php /usr/local/apache2/htdocs/wordpress/wp-config.php
vim /usr/local/apache2/htdocs/wordpress/wp-config.php
#修改一下几行
define('DB_NAME', 'wordpress');
/** MySQL 数据库用户名 */
define('DB_USER', 'wpuser');
/** MySQL 数据库密码 */
define('DB_PASSWORD', 'redhat');
/** MySQL 主机 */
define('DB_HOST', '10.48.255.244');
通过浏览器:http://yourhostip/wordpress/
完成剩余的配置
通过admin登入,在设置常规中开启,任何人都可以注册,然后访问wordpress就可以看到注册按钮了
实现用户注册,需邮件激活:
注册一个用户,发现他是把激活信息发到邮箱,打开邮箱但是没有邮件;手动找回密码,显示可能原因:您的主机禁用了 mail() 函数...
google是因为少了发邮件的插件:WP Mail SMTP,插件的下载:
wget http://downloads.wordpress.org/plugin/wp-mail-smtp.0.9.1.zip
unzip wp-mail-smtp.0.9.1.zip
wordpress插件的安装同cacti差不多,把插件copy到相应的目录下即可
mv wp-mail-smtp /usr/local/apache2/htdocs/wordpress/wp-content/plugins
以管理员的身份登入:插件--》启动WP-Mail——SMTP--》Settings
From Email example@126.com
From Name nsfocus
Mailer Send all WordPress emails via SMTP
Return Path 勾上
smtp host smtp.126.com
Authentication Yes
username example@126.com
password xxxxxxxxx
保存,再试,ok email 发过来了,但是点击激活信息时提示:抱歉,该 key 似乎无效
解决方法:
找到wordpress根目录下的的wp-login.php文件:找到下面的字符串:
$message .= ‘<' . network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user_login), ‘login’) . “>\r\n”;
改成
$message .= network_site_url(“wp-login.php?action=rp&key=$key&login=”. rawurlencode($user_login), ‘login’) . “\r\n”;
也就是把 左边的 '<'. 和最后的 > 删掉就解决了
----------------------------------------
apt-get install build-essential
apt-get install libtool
一、从网上下载的源码我们放置在/urs/local/src中
二、解压后都放在/usr/local中进行安装
三、接下来需要分别安装
1、安装 zlib1g-dev和libpcre3-dev
apt-get install zlib1g-dev libpcre3-dev -y
2、安装pcre
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz
tar -xzf pcre-8.21.tar.gz
./configure
make
make install
3、安装openssl
wget http://www.openssl.org/source/openssl-0.0.1c.tar.gz
./config
make
make install
4、安装zlib
wget http://www.zlib.NET/zlib-1.2.8.tar.gz
./configure
make
make install
5、下载nginx和编译安装
(1)执行下面编译设置
./configure --prefix=/usr/local/nginx-1.2.3 \
--conf-path=/usr/local/nginx-1.2.3/nginx.conf \
--openssl-path=/usr/local/openssl-1.0.1c \
--with-http_ssl_module \
--with-pcre=/usr/local/pcre-8.21 \
--with-http-stub-status-module
(说明:很多编译安装的说明都没有设置conf-path,但是我没有设置的话,在make install 阶段会出现
cp: `conf/koi-win' and `/usr/local/nginx/conf/koi-win' are the same file错误)
(2)make
(3)make install
编译参数说明:
--prefix=path
—
Nginx安装路径。如果没有指定,默认为 /usr/local/nginx。
--sbin-path=path
—
Nginx可执行文件安装路径。只能安装时指定,如果没有指定,默认为<prefix>/sbin/nginx。
--conf-path=path
—
在没有给定-c选项下默认的nginx.conf的路径。如果没有指定,默认为<prefix>/conf/nginx.conf。
--pid-path=path
—
指定nginx.pid的文件名,安装后该名字可以在nginx.cong文件中修改。如果没有指定,默认为 <prefix>/logs/nginx.pid。
--error-log-path=path
—
在nginx.conf中没有指定error_log指令的情况下,默认的错误日志的路径。如果没有指定,默认为 <prefix>/logs/error.log。
--user=name
—
在nginx.conf中没有指定user指令的情况下,默认的nginx使用的用户。如果没有指定,默认为 nobody。
--group=name
—
在nginx.conf中没有指定user指令的情况下,默认的nginx使用的组。如果没有指定,默认为 nobody。
--with-http_ssl_module
—
开启HTTP SSL模块,使NGINX可以支持HTTPS请求。这个模块需要已经安装了OPENSSL
--with-pcre=path
—
指定PCRE库路径。(PCRE为正则表达式库)
--with-pcre-jit
— builds the PCRE library with “just-in-time compilation” support.
- 2-21-源码编译安装LAMP
编译安装LAMP所需要及其所使用的源码版本: httpd version:httpd-2.4.16 apr version:apr-1.5.2 pcre version:pcre-8.37 apr ...
- CentOS 6编译安装lamp,并分别安装event模块方式和FPM方式的PHP
任务目标: 编译安装LAMP 要求(1) 安装一个模块化的PHP 要求(2) 安装一个FPM的PHP 注意PHP需要最后一个安装,因为需要前两者的支持. 所以这里的安装次序为 1.httpd 2.Ma ...
- CentOS6.3 编译安装LAMP(1):准备工作
卸载yum或rpm安装的amp软件 #在编译安装lamp之前,首先先卸载已存在的rpm包. rpm -e httpd rpm -e mysql rpm -e php yum -y remove htt ...
- CentOS6.3 编译安装LAMP(2):编译安装 Apache2.2.25
所需源码包: /usr/local/src/Apache-2.2.25/httpd-2.2.25.tar.gz 编译安装 Apache2.2.25 #切换到源码目录 cd /usr/local/src ...
- CentOS6.3 编译安装LAMP(2):编译安装 Apache2.4.6
Apache官方说: 与Apache 2.2.x相比,Apache 2.4.x提供了很多性能方面的提升,包括支持更大流量.更好地支持云计算.利用更少的内存处理更多的并发等.除此之外,还包括性能提升.内 ...
- CentOS6.3 编译安装LAMP(3):编译安装 MySQL5.5.25
所需源码包: /usr/local/src/MySQL-5.5.25/cmake-2.8.8.tar.gz /usr/local/src/MySQL-5.5.25/mysql-5.5.25.tar.g ...
- CentOS6.3 编译安装LAMP(4):编译安装 PHP5.2.17
所需源码包: /usr/local/src/PHP-5.2.17/libmcrypt-2.5.8.tar.gz /usr/local/src/PHP-5.2.17/mhash-0.9.9.9.tar. ...
- CentOS6.3 编译安装LAMP(4):编译安装 PHP5.3.27
所需源码包: /usr/local/src/PHP-5.3.27/libmcrypt-2.5.8.tar.gz /usr/local/src/PHP-5.3.27/mhash-0.9.9.9.tar. ...
- Ubuntu14.04编译安装mysql5.6.26
Ubuntu14.04编译安装mysql5.6.26 (1)安装编译源码需要的包 sudo apt-get install make cmake gcc g++ bison libncurses5-d ...
随机推荐
- iOS从零开始学习直播之音频3.歌曲切换
上周迟到了,周末去参加OSC源创会了,还是有点启发的.但这不是重点,重点是 上一篇我只是实现了一首歌曲的在线播放,这肯定是不够的.这一篇博客主要是实现了多首歌曲的顺序播放以及上一首和下一首切换. ...
- WebViewJavascriptBridge源码探究--看OC和JS交互过程
今天把实现OC代码和JS代码交互的第三方库WebViewJavascriptBridge源码看了下,oc调用js方法我们是知道的,系统提供了stringByEvaluatingJavaScriptFr ...
- Angular版本1.2.4在IE11的IE8模式下出错解决方案
今天,群里一个兄弟抛出一个问题(如上),截图说明. 打断点调试下,貌似是console里面的log方法出错了,如下: 这个是console的log方法,为什么错呢,继续: 我们会发现,在这里是检测fu ...
- 静态库介绍与简单演练及同名资源冲突解决(.a格式的静态库)
1.静态库和动态库都是闭源库,不公开源代码. 静态库:.a和.framework 动态库:.dylib和.framework(iOS9取消了.dylib,使用.tbd替代) 2.静态库和动态库在使用上 ...
- minSdkVersion maxSdkVersion targetSdkVersion target 的区别
minSdkVersion 描述:app最低支持的sdk版本号 作用:如果手机SdkVersion小于app中定义的minSdkVersion,则android系统不允许安装该app 定义位置:And ...
- 原创 C++应用程序在Windows下的编译、链接:第三部分 静态链接(二)
3.5.2动态链接库的创建 3.5.2.1动态链接库的创建流程 动态链接库的创建流程如下图所示: 在系统设计阶段,主要的设计内容包括:类结构的设计以及功能类之间的关系,动态链接库的接口.在动态链接库中 ...
- 排序 order by 的用法
order by 跟在select* from 后面 order by 默认的是升序, asc 升序 desc 降序 select * from 表名 order by 字段名 asc 在带有 ...
- Linux下查看系统版本号信息的方法
一.查看Linux内核版本命令(两种方法): 1.cat /proc/version 2.uname -a 二.查看Linux系统版本的命令(3种方法): 1.lsb_release -a,即可列出所 ...
- .NET中集合已修改;可能无法执行枚举操作 的解决办法
foreach是取只读的,在取的时候数据不能变(包括修改,删除,添加等).要避免这个问题,就应该使用for循环. https://msdn.microsoft.com/zh-cn/library/tt ...
- EL表达式杂项
1.<%@ page isELIgnored="false" %> 是否忽略EL表达式,如果值为ture,那么 ${..}这样的会直接原样输出,不会进行EL表达式计算 ...