- 浏览: 105528 次
- 性别:
- 来自: 珠海
文章分类
最新评论
-
babyjun1987:
看了那么多帖子,这个对我电脑有用,感谢楼主,好人一生平安!
4741G BIOS修复工具,黑刷bios有需要的收藏 -
jetli1989:
看了那么多帖子,这个对我电脑有用,感谢楼主,好人一生平安!
4741G BIOS修复工具,黑刷bios有需要的收藏 -
jetli1989:
点个赞
4741G BIOS修复工具,黑刷bios有需要的收藏 -
meihaoderizi123:
thanks,this article is very he ...
PHP 对象克隆 clone 关键字与 __clone() 方法
一、安装所需:
注:我自己的安装环境为centos 5.5 64
1、类库:
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
wget http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz
wget http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz
wget http://pecl.php.net/get/memcache-2.2.6.tgz
wget http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
wget http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz
wget http://pecl.php.net/get/imagick-2.3.0.tgz
2、Apache2.2.23下载地址:点击打开链接
二、安装apache
cd /usr/local/src
tar -zxvf httpd-2.2.23
cd httpd-2.2.23
./configure -prefix=/usr/local/apache -enable-module=so
make
make install
在终端中输入:/usr/local/apache/bin/apachectl start 启动apache服务器
输入:/usr/local/apache/bin/apachectl restart 重新启动服务器
添加mod_rewrite模块
cd /usr/local/src/httpd-2.2.23/modules/mappers/
/usr/local/apache/bin/apxs -c mod_rewrite.c
/usr/local/apache/bin/apxs -i -a -n mod_rewrite mod_rewrite.la
三、安装PHP
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./configure --prefix=/usr/local
make
make install
cd ../
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../
tar zxvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17/
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-dist /usr/local/php/etc/php.ini
cd ../
tar zxvf memcache-2.2.6.tgz
cd memcache-2.2.6/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ../
tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1/
/usr/local/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ../
tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
make
make install
cd ../
tar zxvf ImageMagick.tar.gz
cd ImageMagick-6.5.1-2/
./configure
make
make install
cd ../
tar zxvf imagick-2.3.0.tgz
cd imagick-2.3.0/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ../
修改php.ini文件
手工修改:查找/usr/local/php/etc/php.ini中的extension_dir = "./"
修改为extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
并在此行后增加以下几行,然后保存:
extension = "memcache.so"
extension = "pdo_mysql.so"
extension = "imagick.so"
再查找output_buffering = Off
修改为output_buffering = On
配置eAccelerator加速PHP:
mkdir -p /home/eaccelerator_cache
vim /usr/local/php/etc/php.ini
按shift+g键跳到配置文件的最末尾,加上以下配置信息:
引用
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/home/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
创建php-fpm配置文件(php-fpm是为PHP打的一个FastCGI管理补丁,可以平滑变更php.ini配置而无需重启php-cgi):
在/usr/local/php/etc/目录中创建php-fpm.conf文件:
rm -f /usr/local/php/etc/php-fpm.conf
vi /usr/local/php/etc/php-fpm.conf
输入以下内容:
<?xml version="1.0" ?>
<configuration>
All relative paths in this config are relative to php's install prefix
<section name="global_options">
Pid file
<value name="pid_file">/usr/local/php/logs/php-fpm.pid</value>
Error log file
<value name="error_log">/usr/local/php/logs/php-fpm.log</value>
Log level
<value name="log_level">notice</value>
When this amount of php processes exited with SIGSEGV or SIGBUS ...
<value name="emergency_restart_threshold">10</value>
... in a less than this interval of time, a graceful restart will be initiated.
Useful to work around accidental curruptions in accelerator's shared memory.
<value name="emergency_restart_interval">1m</value>
Time limit on waiting child's reaction on signals from master
<value name="process_control_timeout">5s</value>
Set to 'no' to debug fpm
<value name="daemonize">yes</value>
</section>
<workers>
<section name="pool">
Name of pool. Used in logs and stats.
<value name="name">default</value>
Address to accept fastcgi requests on.
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
<value name="listen_address">127.0.0.1:9000</value>
<value name="listen_options">
Set listen(2) backlog
<value name="backlog">-1</value>
Set permissions for unix socket, if one used.
In Linux read/write permissions must be set in order to allow connections from web server.
Many BSD-derrived systems allow connections regardless of permissions.
<value name="owner"></value>
<value name="group"></value>
<value name="mode">0666</value>
</value>
Additional php.ini defines, specific to this pool of workers.
<value name="php_defines">
<value name="sendmail_path">/usr/sbin/sendmail -t -i</value>
<value name="display_errors">0</value>
</value>
Unix user of processes
<value name="user">www</value>
Unix group of processes
<value name="group">www</value>
Process manager settings
<value name="pm">
Sets style of controling worker process count.
Valid values are 'static' and 'apache-like'
<value name="style">static</value>
Sets the limit on the number of simultaneous requests that will be served.
Equivalent to Apache MaxClients directive.
Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
Used with any pm_style.
<value name="max_children">128</value>
Settings group for 'apache-like' pm style
<value name="apache_like">
Sets the number of server processes created on startup.
Used only when 'apache-like' pm_style is selected
<value name="StartServers">20</value>
Sets the desired minimum number of idle server processes.
Used only when 'apache-like' pm_style is selected
<value name="MinSpareServers">5</value>
Sets the desired maximum number of idle server processes.
Used only when 'apache-like' pm_style is selected
<value name="MaxSpareServers">35</value>
</value>
</value>
The timeout (in seconds) for serving a single request after which the worker process will be terminated
Should be used when 'max_execution_time' ini option does not stop script execution for some reason
'0s' means 'off'
<value name="request_terminate_timeout">0s</value>
The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
'0s' means 'off'
<value name="request_slowlog_timeout">0s</value>
The log file for slow requests
<value name="slowlog">logs/slow.log</value>
Set open file desc rlimit
<value name="rlimit_files">65535</value>
Set max core size rlimit
<value name="rlimit_core">0</value>
Chroot to this directory at the start, absolute path
<value name="chroot"></value>
Chdir to this directory at the start, absolute path
<value name="chdir"></value>
Redirect workers' stdout and stderr into main error log.
If not set, they will be redirected to /dev/null, according to FastCGI specs
<value name="catch_workers_output">yes</value>
How much requests each process should execute before respawn.
Useful to work around memory leaks in 3rd party libraries.
For endless request processing please specify 0
Equivalent to PHP_FCGI_MAX_REQUESTS
<value name="max_requests">1024</value>
Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
Makes sense only with AF_INET listening socket.
<value name="allowed_clients">127.0.0.1</value>
Pass environment variables like LD_LIBRARY_PATH
All $VARIABLEs are taken from current environment
<value name="environment">
<value name="HOSTNAME">$HOSTNAME</value>
<value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
<value name="TMP">/tmp</value>
<value name="TMPDIR">/tmp</value>
<value name="TEMP">/tmp</value>
<value name="OSTYPE">$OSTYPE</value>
<value name="MACHTYPE">$MACHTYPE</value>
<value name="MALLOC_CHECK_">2</value>
</value>
</section>
</workers>
</configuration>
四、配置httpd.conf
vim /usr/local/apache/conf/httpd.conf
ServerRoot:apache的安装目录
Listen: apache监听的端口
搜索LoadModule,如果有下面两句
LoadModule php5_module modules/libphp5.so
LoadModule rewrite_module modules/mod_rewrite.so
则将前面的注释删除掉,如果没有这两句,则添加上去
搜索AddType
添加:AddType application/x-httpd-php .php .phtml
添加以下配置:
<VirtualHost *:80>
DocumentRoot /home/htdocs/www --你的文档的根目录。默认情况下,所有的请求从这个目录进行应答。
ServerName test.yalv023.com --访问域名
<Directory /home/htdocs/www > --用于封装一组指令,使之仅对某个目录及其子目录生效。
Options FollowSymLinks
AllowOverride All
order allow,deny
Allow from all
</Directory>
</VirtualHost>
在<IfModule dir_module>
里面添加 index.php
至此配置完成.
注:
可能遇到的问题
httpd: Syntax error on line 54 of /usr/share/apache-2.2.11/conf/httpd.conf: Can't locate API module structure `mod_rewrite_module' in file /usr/share/apache-2.2.11/modules/mod_rewrite.so: /usr/share/apache-2.2.11/modules/mod_rewrite.so: undefined symbol: mod_rewrite_module
修改 httpd.conf,将
LoadModule mod_rewrite_module modules/mod_rewrite.so
改为
LoadModule mod_rewrite modules/mod_rewrite.so
如果出现这个错误
Syntax error on line 329 of /usr/local/apache2/conf/httpd.conf:
Can`t loacte API module staructure `mod_rewrite_module` in file
/usr/local/apache2/modules/mod_rewrite.so:/usr/local/apache2/lib/libapr-
0.so.0:undefined symbol:mod_rewrite_module
修改http.conf
原来:httpd.conf里面写的mod_rewrite_module
改成 rewrite_module
如果重启apache出现这个错误module rewrite_module is built-in and can`t be loaded
表示模块是内建的,不用再调入,注释掉
#LoadModule rewrite_module modules/mod_rewrite.so
发表评论
-
一个典型的iptables防火墙配置
2013-03-05 09:08 1007机房安全是必须考虑的事情。一些服务器设备必须暴露公网IP,很容 ... -
mysql无法启动,报错 Can't start server: can't create PID file: No space left on device
2013-01-04 16:55 1291最近在维护linux服务器时发现,网站打不开了,经过检查发现是 ... -
linux apf 防火墙 安装 配置
2012-12-21 16:36 906APF(Advanced Policy Firewall) ... -
Linux CentOS 如何防止CC攻击和DDOS攻击
2012-12-20 13:48 1103一、查看系统当前连接情况 使用netstat命令,查看VP ... -
Linux简单处理CC攻击shell脚本
2012-12-20 12:37 2070第一个脚本是通过查找日志中访问次数过多的ip,并用iptabl ... -
如何在Linux系统下查看apache的并发连接数
2012-12-20 12:34 926即查看httpd的进程数(即prefork模式下Apache能 ... -
Linux(Centos)下安装 Zend Optimizer 3.3.9 实例
2012-12-20 11:04 737在centos 5.3上安装好了php之后,下载文件 wge ... -
Linux添加pear开发包
2012-12-19 13:54 935以添加XML_Serializer为例,进行 http://p ... -
linux下LFTP mirror的高级应用
2012-12-19 09:21 1617在我刚刚发现LFTP的时候,我就注意到了它功能强大的mirro ... -
[转]linux下使用lftp的小结
2012-12-18 23:26 1050今天在解决一个远程服务器备份的问题时,用到了lftp的相关知识 ... -
rsync+inotify实现多台web数据动态同步
2012-12-18 21:06 798ps: 最新的可以从http://rsync.samba.or ... -
Centos5.5 php更新至5.2.17
2012-12-18 16:05 766先将以下地址导入。 # rpm --import http ... -
关于使用yum “The program package-cleanup is...” 的解决办法!
2012-12-18 14:18 842在使用yum 时总是有提示信息: The program p ... -
APCHE虚拟主机Conf配置
2012-11-16 13:48 997<VirtualHost *:80> ... -
VSFTP的虚拟用户配置方法
2012-11-12 16:09 12451、建立虚拟用户口令库 ... -
Linux服务器下用svn创建多个项目
2012-08-15 08:44 1497(1): 创建svn仓库路径 mkdir -p ... -
SVN源码自动发布至WEB目录
2012-06-14 10:13 1711一、cd /code/svndata/svn/hook,创建p ... -
Centos安装apache+svn结合的SVN服务器
2012-06-12 17:16 10401、yum安装下列的一些包: yum install apr ... -
使用sync进行服务器文件同步,并CRON定期执行
2012-05-02 15:46 1149一、创建sync.sh shell文件 #!/bin/sh ... -
快速开发一个PHP扩展(SO组件)教程
2012-05-01 18:44 2146本文通过非常快速的方式讲解了如何制作一个PHP 5.2 环境的 ...
相关推荐
在本文中,我们将深入探讨如何在CentOS 7操作系统上通过源代码编译来安装Apache 2.4、MySQL 5.6和PHP 7.1。这个过程对于那些希望自定义软件配置或在没有预装包的环境中部署这些服务的系统管理员来说非常有用。 首先...
`compat-libstdc++-33`是Red Hat Enterprise Linux (RHEL)及CentOS等基于RPM包管理系统的Linux发行版中的一个兼容库。这个库的主要功能是提供旧版的GNU C++标准库(libstdc++)接口,以便运行那些依赖较老版本C++库...
compat-libstdc++-33-3.2.3-47.3.i386.rpm Centos7 安装oracle 所需软件包
CentOS源码安装Apache Tomcat 8.0.21 Apache Tomcat是一款流行的Java Web服务器,广泛应用于企业级Web应用程序。CentOS是流行的Linux发行版,提供了稳定、安全的服务器环境。本文将指导您如何在CentOS系统上源码...
RH linux5.4 64位 系统包compat-libstdc++-33-3.2.3-61.x86_64.rpm
CentOS6.5安装64位Oracle11G R2依赖包
在给定的文件信息中,我们探讨了在CentOS 4.4环境下通过源码编译方式安装Apache、PHP和MySQL的过程。以下是基于文件提供的信息,深入解析与扩展的知识点: ### 一、系统环境 #### Linux版本及内核 在进行任何软件...
CentOS 源码安装 PHP 8.1.1 + PHPRedis 4.2.0 在本文中,我们将详细介绍如何在 CentOS 操作系统上从源码安装 PHP 8.1.1 和 PHPRedis 4.2.0。 安装依赖项 在安装 PHP 之前,我们需要安装一些依赖项。使用以下命令...
centos源码安装nginx-1.20.2+nginx负载均衡
### CentOS 下安装 Apache + MySQL + PHP5.5.0(源码安装) #### 知识点一:环境准备与配置 在开始安装之前,确保你的系统是 CentOS 6.3 64位版本,并且已经安装了必要的软件包管理工具 YUM (Yellowdog Updater ...
本安装文件修改了源码网的“CentOS 集成linux+php-cgi+nginx+mysql安装包“里面的部分文件,主要是修改了install.sh内的几个错误位置。目前我测试在centos 5.4下,安装一切正常! 使用这个安装之前请一定看一下本...
Centos7.6源码编译安装HTTP+PHP+Zabbix 5.2.2+PostgreSQL+TimescaleDB+Grafana
Linux上安装Oracle需要的包 很多教程上都用的这个版本
在CentOS系统中安装Apache需要下载Apache的源代码,使用wget命令下载Apache的tar.gz文件,然后解压缩文件,编译和安装Apache。在编译Apache时需要指定安装目录、支持CGI、追踪变量和配置文件路径等参数。编译成功后...
CentOS 6.x使用yum安装Apache+PHP+Tomcat(JSP)+MySQL教程,centos5及以下的教程比较多,本文档里面没有涉及
CentOS管理脚本-安装最新资源库-安装Apache+MySQL+PHP5.4 - 工具如 nload - netstat - lsof - iostat - systat 等_centos
`compat-libstdc++-33-3.2.3-61`是一个特定版本的兼容库,主要用于支持旧版的GNU C++标准库,它包含了两个不同架构的版本:`i386.rpm`适用于32位系统,而`x86_64.rpm`则适用于64位系统。 `libstdc++`是GNU项目的一...
5. 配置PHP,选择需要的模块(如mod_php模块以支持Apache),编译并安装。 6. 配置Apache以加载PHP模块,如在httpd.conf中添加LoadModule指令。 7. 启动Apache和MySQL服务。 8. 测试安装,通过访问一个简单的PHP页面...
本文将指导读者在 Centos7 版本下搭建一个完整的 Linux-Apache-PHP-Mysql 环境,涵盖网络规划、操作系统安装、Apache、PHP、Mysql 的安装和配置等步骤。 一、网络规划 在搭建 Linux-Apache-PHP-Mysql 环境之前,...
本安装文件修改了源码网的“CentOS 集成linux+php-cgi+nginx+mysql安装包“里面的部分文件,主要是修改了install.sh内的几个错误位置。目前我测试在centos 5.4下,安装一切正常! 使用这个安装之前请一定看一下本...