Mysql 安装(免编译版) shell> groupadd mysql shell> useradd -g mysql mysql shell> cd /usr/local shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> scripts/mysql_install_db shell> chown -R root . shell> chown -R mysql data shell> chgrp -R mysql . shell> bin/mysqld_safe --user=mysql & or shell> bin/mysqld_safe --user=mysql & mysql安装2(编译版)
安装apache ./configure --prefix=/usr/local/apache --enable-so make make install ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ --enable-so --enable-mods-shared='vhost_alias usertrack userdir unique_id suexec ssl speling rewrite mime mem_cache log_config log_forensic logio info include file_cache filter headers env example expires dir disk_cache dumpio dbd autoindex cache cern_meta authz_host authn_dbd authn_anon actions alias asis' 跳过APR的安装模式 ./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared='vhost_alias usertrack userdir unique_id suexec ssl speling rewrite mime mem_cache log_config log_forensic logio info include file_cache filter headers env example expires dir disk_cache dumpio dbd autoindex cache cern_meta authz_host authn_dbd authn_anon actions alias asis' mod_vhost_alias 提供大批量虚拟主机的动态配置支持 mod_usertrack 使用Session跟踪用户(会发送很多Cookie),以记录用户的点击流 mod_userdir 允许用户从自己的主目录中提供页面(使用"/~username") mod_unique_id 为每个请求生成唯一的标识以便跟踪 mod_suexec 使用与调用web服务器的用户不同的用户身份来运行CGI和SSI程序 mod_ssl 使用安全套接字层(SSL)和传输层安全(TLS)协议实现高强度加密传输 mod_speling 自动纠正URL中的拼写错误 mod_so 允许运行时加载DSO模块 mod_rewrite 一个基于一定规则的实时重写URL请求的引擎 mod_proxy 提供HTTP/1.1的代理/网关功能支持 mod_mime 根据文件扩展名决定应答的行为(处理器/过滤器)和内容(MIME类型/语言/字符集/编码) mod_mem_cache 基于内存的缓冲管理器 mod_log_config 允许记录日志和定制日志文件格式 mod_log_forensic 实现"对比日志",即在请求被处理之前和处理完成之后进行两次记录 mod_logio 对每个请求的输入/输出字节数以及HTTP头进行日志记录 mod_info 生成Apache配置情况的Web页面 mod_include 实现服务端包含文档(SSI)处理 mod_file_cache 提供文件描述符缓存支持,从而提高Apache性能 mod_filter 根据上下文实际情况对输出过滤器进行动态配置 mod_headers 允许通过配置文件控制任意的HTTP请求和应答头信息 mod_env 允许Apache修改或清除传送到CGI脚本和SSI页面的环境变量 mod_example 一个很简单的Apache模块API演示模块 mod_expires 允许通过配置文件控制HTTP的"Expires:"和"Cache-Control:"头内容 mod_dir 指定目录索引文件以及为目录提供"尾斜杠"重定向 mod_disk_cache 基于磁盘的缓冲管理器 mod_dumpio 将所有I/O操作转储到错误日志中 mod_dbd 管理SQL数据库连接,为需要数据库功能的模块提供支持 mod_autoindex 自动对目录中的内容生成列表,类似于"ls"或"dir"命令 mod_cache 基于URI键的内容动态缓冲(内存或磁盘) mod_cern_meta 允许Apache使用CERN httpd元文件,从而可以在发送文件时对头进行修改 mod_authz_host 供基于主机名、IP地址、请求特征的访问控制 mod_authn_dbd 使用SQL数据库为认证提供支持 mod_authn_anon 提供匿名用户认证支持 mod_actions 基于媒体类型或请求方法,为执行CGI脚本而提供 mod_alias 提供从文件系统的不同部分到文档树的映射和URL重定向 mod_asis 发送自己包含HTTP头内容的文件 gd库及一些支持库编译 A 安装jpeg mkdir /usr/local/libjpeg
#jpeg目录 mkdir /usr/local/libjpeg/jpeg6 mkdir /usr/local/libjpeg/jpeg6/bin mkdir /usr/local/libjpeg/jpeg6/lib mkdir /usr/local/libjpeg/jpeg6/include mkdir /usr/local/libjpeg/jpeg6/man
mkdir /usr/local/libjpeg/jpeg6/man/man1 tar xzvf jpegsrc.v6b.tar.gz ./configure --prefix=/usr/local/libjpeg/jpeg6 --enable-shared --enable-static make
make install B安装zlib
tar xzvf zlib- cd zlib- #不要用--prefix自定义安装目录,影响gd的安装 ./configure make
make install C 安装freetype
tar xzvf freetype- cd freetype- ./configure --prefix=/usr/local/freetype make
make install D 安装libpng
tar xzvf libpng- #不要用--prefix自定义安装目录,影响gd的安装 cd libpng- cp scripts/makefile.std makefile make test
make install E安装GD
tar xzvf gd- ./configure --prefix=/usr/local/include/gd --with-jpeg=/usr/local/libjpeg/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/freetype make make install
php 安装(加载gd库) ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-config-file-path=/usr/local/php/etc --with-gd=/usr/local/include/gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir=/usr/local/freetype/ --with-jpeg-dir=/usr/local/libjpeg/jpeg6/ --with-png-dir --with-zlib --enable-xml --enable-mbstring --with-curl=/usr/local/curl --with-php-config=/usr/local/php/bin/php-config make make install cp php.ini-dist /usr/local/php/etc/php.ini 安装jdk ./jdk-1_5_0_05-linux-i586.bin(运行目录/usr/local) ln –s jdk-1_5_05 java 安装Zend 解压后执行进入目录执行
./install.sh
一步一步下来,当出现: Enter the location of your php.ini file 的提示时,输入:/usr/local/php/etc
设当前目录为任意目录 j2dk 安装 ./jdk-1_5_0_06-linux-i586.bin mv jdk cd /usr/local/ ln -s jdk tomcat 安装 tar -zxvf apache-tomcat- cd apache-tomcat- mv apache-tomcat- cd /usr/local/ ln -s apache-tomcat- vi /usr/local/tomcat/bin/catalina.sh 加入以下代码 JAVA_HOME=/usr/local/java mo_jk 安装 tar -zxvf jakarta-tomcat-connectors- cd jakarta-tomcat-connectors- cd jk/native/ jk2 ./configure --exec-prefix=/usr/local/mo_jk --with-apxs2=/usr/local/apache/bin/apxs --with-java-home=/usr/local/java jk ./configure --exec-prefix=/usr/local/mo_jk --with-apxs=/usr/local/apache/bin/apxs --with-java-home=/usr/local/java cp ../conf/workers.properties /usr/local/apache/conf/ 编辑workers.properties vi /usr/local/apache/conf/workers.properties 修改以下两行 workers.tomcat_home=/usr/local/tomcat workers.java_home=/usr/loca/java 整合apache 和mo_jk、tomcat vi /usr/local/apache/conf/httpd.conf 添加以下代码 #Load mod_jk LoadModule jk_module modules/mod_jk.so # Configure mod_jk JkWorkersFile conf/workers.properties JkLogFile logs/mod_jk.log JkLogLevel info JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 JkMount /application/* ajp13 vi /usr/local/tomcat/conf/server.xml 添加以下代码//可以省略 在<Host> </Host>之间 <Context path="" docBase="/home/public/www" debug="0"/> tomcat虚拟主机配置 <Host appBase="/home/" name="chiran2"> //指定应用目录 <Context path="" docBase="/home/public/www" debug="0"/> //指定网页运行路径 <Alias>chiran2.unix59.cn4e.com</Alias> <Alias>www.chiran.net</Alias> <Alias>chiran.net</Alias> </Host> apache设置动态虚拟主机httpd-vhost UseCanonicalName off VirtualDocumentRoot /home/%0/www //整合php vi /usr/local/apache/conf/httpd.conf AddType application/x-httpd-php .php .htm .html httpd start --英文界面(与/USR/LOCAL/APACHE/BIN/APACHECTL START显示的界面不同---中文界面) 注解:/etc/init.d/httpd与/USR/LOCAL/APACHE/BIN/APACHECTL 启动的httpd.conf不同,httpd启动的是/etc/httpd/conf/httpd.conf,而APACHECTL 启动的是/USR/LOCAL/APACHE/conf/httpd.conf) vi /etc/rc.d/rc.local 加一行 /USR/LOCAL/APACHE/BIN/APACHECTL START 注: cannot restore segment prot after reloc: Permission denied chcon libphp4.so -t shlib_t 注:client denied by server configuration(apache err_log) vi /usr/local/apache/httpd.conf <Directory "/home/"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd./docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> 注:can't locate libapr 注:apache 运行出错 类似如下错误: Failed loading /usr/local/Zend/lib/Optimizer-2_6_2/php-4.4.x/ZendOptimizer.so: /usr/local/Zend/lib/Optimizer-2_6_2/php-4.4.x/ZendOptimizer.so: cannot restore segment prot after reloc: Permission denied 权限不足,设为755即可 chmod 755 /usr/local/Zend/lib/Optimizer-2_6_2/php-4.4.x/ZendOptimizer.so 注:如果重新安装MYSQL要重新编译PHP,否则会出错。 File `NONEXISTENT/charsets/?.conf` not found (Errcode: 2) |
|
来自: 昵称17511675 > 《PHP技术》