1、lamp环境部署IPOS-web服务器配置软件源代码包存放位置 /usr/local/src源码包编译安装位置(prefix) /usr/local/脚本以及维护程序存放位置 /注意:ipos程序的 cron 和temp/caches 和temp/static_caches 这三个文件夹必须可写1、移除系统自带的rpm包的http mysql phpyum remove httpd mysql mysql-server php php-cli php-common php-devel php-gd -y2.安装编译环境及依赖库文件yum -y install ntp vim-enhanced
2、gcc gcc-c+ flex bison autoconf automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel pam-devel libtool libtool-ltdl openssl openssl-devel fontconfig-devel libxml2-devel curl-devel libicu libicu-devel libmcrypt libmcrypt-devel
3、 libmhash libxml2 libmhash-devel mysql-devel libxslt libxslt-devel libtool libtool-ltdl-devel 3.更新时间service ntpd stopntpdate cn.pool.ntp.orgservice ntpd startchkconfig ntpd on#先安装iconv字符集转换包#cd /usr/local/srctar zxvf libiconv-1.14.tar.gzcd libiconv-1.14./configure -prefix=/usr/local/libiconvmakemake
4、 install*(configure: error: no acceptable cc found in $PATH 该错误提示:安装gcc不成功,重新安装)一、 apache安装cd /usr/local/src -找到包的路径tar -zxvf httpd-2.2.21.tar.gzcd httpd-2.2.21./configure -prefix=/usr/local/apache -enable-so -enable-rewrite -enable-mods-shared=most make make install /usr/local/apache/bin/apachectl
5、startnetstat -tnlp |grep httpdcp /usr/local/apache/bin/apachectl /etc/init.d/httpd/etc/init.d/httpd restartnetstat -tnlp |grep 80vim /etc/init.d/httpd / (第二行添加注释信息,添加为系统服务,黄色为添加的内容,#号也要)# chkconfig: 35 61 61# description: Apache :wq 保存退出/sbin/chkconfig -add httpd/sbin/chkconfig httpd onService httpd
6、 stopService httpd startService iptables stop测试:http:/localhost:80 或者 http:/IP:80二、MYSQL 的安装cd /usr/local/srcwget http:/www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz (这个是在线下载,put的话就不用下载)tar zxvf cmake-2.8.6.tar.gzcd cmake-2.8.6./configure (Error when bootstrapping CMake:Cannot find appropriate C+ comp
7、iler on this system.该错误原因是C+未安装成功)解决办法、:yum y install gcc-c+makemake install-创建数据库、日志文件夹mkdir -p /data/mysql/datamkdir -p /data/mysql/logtar zxvf mysql-5.5.17.tar.gzcd mysql-5.5.17.tar.gzcmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data -DWITH_MYISAM_STORAGE_ENGINE=1 -DW
8、ITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306 (Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Er
9、ror at cmake/readline.cmake:83 (MESSAGE): Curses library not found. Please install appropriate package,该问题原因:未安装成功ncurses-devel)-解决办法: yum y install ncurses-develmakemake install-建帐户/usr/sbin/groupadd -r -g 3306 mysql/usr/sbin/useradd -u 3306 -g mysql -r -M -s /sbin/nologin mysql-更改数据文件属组及权限chown -R
10、 mysql:mysql /data/mysqlchmod -R 755 /data/mysql/-建立cnf文件cp support-files/my-f /etc/f -初使化数据库/usr/local/mysql/scripts/mysql_install_db -user=mysql -basedir=/usr/local/mysql -datadir=/data/mysql/data & # cp support-files/mysql.server /etc/init.d/mysqld #chmod +x /etc/init.d/mysqld #/sbin/chkconfig -a
11、dd mysqld #/sbin/chkconfig mysqld on# /sbin/service mysqld start# netstat -tnlp|grep 3306# cd /usr/local/bin /进入用户的默认搜索路径下建立mysql命令的软连接,可以直接执行mysql命令 # ln -s /usr/local/mysql/bin/mysql mysql # ln -s /usr/local/mysql/bin/mysqldump mysqldump # ln -s /usr/local/mysql/bin/mysqladmin mysqladmin # ln -s /
12、usr/local/mysql/bin/mysqlbinlog # mysqladmin -u root -p password /设置数据库密码 # mysql -u root -p 以下的优化可以最后做 (以下的灰色可以先不做)sudo vim /etc/f /Mysql 优化,在mysqld配置参数下面添加下面几行(大概37行下面),根据服务器不同配置进行不同的设置#先修改刚开始的几个参数#key_buffer_size = 32Mmax_allowed_packet = 100Mtable_open_cache = 3000Msort_buffer_size = 16Mnet_buff
13、er_length = 8Kread_buffer_size = 8Mread_rnd_buffer_size = 16Mmyisam_sort_buffer_size = 256Mbulk_insert_buffer_size = 64Mmyisam_max_sort_file_size = 8Gmyisam_repair_threads = 1myisam_recover #下面这些是添加的默认没有#innodb_file_per_tablelog-bin-trust-function-creators=1skip-name-resolvlower_case_table_names=1ma
14、x_connections = 512max_connect_errors = 10log-error=/data/mysql/log/mysql.err.logmax_heap_table_size = 256Mjoin_buffer_size = 128Mthread_cache_size = 32Mthread_stack = 256Kquery_cache_type = 1query_cache_size =1024Mquery_cache_limit = 4Mtmp_table_size = 128Mback_log = 1024open_files_limit = 20480int
15、eractive_timeout = 120wait_timeout = 120external-locking = FALSEtable_cache = 512Mslow_query_loglong_query_time = 2character-set-server = utf8ft_min_word_len = 4#下面的都去掉注释#innodb_data_home_dir = /data/mysql/datainnodb_data_file_path = ibdata1:10M:autoextendinnodb_log_group_home_dir = /data/mysql/data
16、# You can set ._buffer_pool_size up to 50 - 80 %# of RAM but beware of setting memory usage too highinnodb_buffer_pool_size = 16Ginnodb_additional_mem_pool_size = 32M# Set ._log_file_size to 25 % of buffer pool sizeinnodb_log_file_size = 1024Minnodb_log_buffer_size = 512Minnodb_flush_log_at_trx_comm
17、it = 1innodb_lock_wait_timeout = 50innodb_write_io_threads = 8innodb_read_io_threads = 8innodb_thread_concurrency = 16 :wq /保存退出sudo rm -rvf /data/mysql/data/ib_logfile* /删除原来的默认文件sudo /sbin/service mysqld restartMysql grant all privileges on *.* to ipos% identified by 123456;Mysqlflush privileges;s
18、ervice iptables stop用Navicat for MySQL软件测试是否mysql连接正常-安装PHP-cd /usr/local/srctar xvf php-5.2.17.tar.gzexport LDFLAGS=-L/usr/lib64/mysql cd php-5.2.17#mysql 在不同服务器上的时候使用下面的参数#./configure -prefix=/usr/local/php -with-apxs2=/usr/local/apache/bin/apxs -enable-cgi -with-mysql=/usr/lib/mysql/ -with-config
19、-file-path=/usr/local/php/etc -with-pdo-mysql=/usr/bin/mysql -with-mysqli=/usr/bin/mysql_config -enable-zip -enable-sqlite-utf8 -enable-sockets -enable-soap -enable-pcntl -enable-mbstring -enable-calendar -enable-bcmath -with-iconv=/usr/local/libiconv/ -enable-exif -with-mcrypt -with-mhash -with-gd
20、-with-png-dir -with-jpeg-dir -with-freetype-dir -with-libxml-dir -with-curl -with-curlwrappers -with-zlib -with-openssl -with-kerberos=shared -with-gettext=shared -with-xmlrpc=shared -with-xsl makemake install#当mysql 在同一台服务器上 的时候使用下面的参数#./configure -prefix=/usr/local/php -with-apxs2=/usr/local/apach
21、e/bin/apxs -enable-cgi -with-mysql=/usr/local/mysql -with-config-file-path=/usr/local/php/etc -with-pdo-mysql=/usr/local/mysql/ -with-mysqli=/usr/local/mysql/bin/mysql_config -enable-zip -enable-sqlite-utf8 -enable-sockets -enable-soap -enable-pcntl -enable-mbstring -enable-calendar -enable-bcmath -
22、with-iconv=/usr/local/libiconv/ -enable-exif -with-mcrypt -with-mhash -with-gd -with-png-dir -with-jpeg-dir -with-freetype-dir -with-libxml-dir -with-curl -with-curlwrappers -with-zlib -with-openssl -with-kerberos=shared -with-gettext=shared -with-xmlrpc=shared -with-xsl makemake install# cp php.ini
23、-dist /usr/local/php/etc/php.ini /拷贝配置文件-整合Apache与PHP及系统初始化配置 vim /usr/local/apache/conf/httpd.conf-查找AddType application/x-gzip .gz .tgz,在该行下面添加AddType application/x-httpd-php .php-查找DirectoryIndex index.html 把该行修改成DirectoryIndex index.html index.htm index.php :wq /保存退出-测试apache和php是否整合成功,下面我们测试apa
24、che和php是否整合成功,在apache文档跟目录下新建一个小小的php程序 cd /usr/local/apache/htdocsvi test.php /在test.php文件中写入下面三行 -重启apache服务service httpd restartservice iptables stop-访问,在浏览器中输入http:/ip/test.php 出现php信息界面则说明整合成功安装freeTDS进入需要安装的路径-下载最新的freetds 编译安装tar xvf freetds-stable.tgzcd freetds-0.91/./configure -prefix=/usr/
25、local/freetds -with-tdsver=7.1 -enable-msdblib -with-gnu-ld -enable-shared -enable-staticmake make install vim /usr/local/freetds/etc/freetds.conf /修改最后的文件内容global # TDS protocol version tds version = 8.0 # Whether to write a TDSDUMP file for diagnostic purposes # (setting this to /tmp is insecure o
26、n a multi-user system) dump file = /tmp/freetds.log debug flags = 0xffff # Command and connection timeouts timeout = 10 connect timeout = 10mysqlserverhost =127.0.0.1port = 1433tds version = 8.0client charset=utf-8 cd /usr/local/src/php-5.2.17/ext/mssql/ / /进入php解压目录(不一定在该路径下)/usr/local/php/bin/phpi
27、ze ./configure -with-php-config=/usr/local/php/bin/php-config -with-mssql=/usr/local/freetds/-返回TDS路径make make install #zend install#tar xvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gzcd ZendOptimizer-3.3.9-linux-glibc23-x86_6-进入ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp路径/执行cp /us
28、r/local/src/ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/vim /usr/local/php/etc/php.ini /修改添加extension_dir = “./” /修改为下面的内容extension_dir = /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613”-在配置文件结尾添加下面
29、二行extension=mssql.somssql.charset = GBKextension=ZendOptimizer.soextension=memcache.so 为避免缓存服务器配置重复操作,在此处加入缓存服务器配置信息service httpd stopservice httpd startphp m 检查php加载的模块Memcache服务端Cd /usr/local/src-装了Memcache的服务端还不行, 还要安装PHP 支持memcache的扩展模块 view sourcetar -zxvf memcache-2.2.6.tgzcd memcache-2.2.6-配置并安装/usr/local/php/bin/phpize /第一次可能找不到Cannot find config.m4./configure -enable-memcache -with-php-config=/usr/local/php/bin/php-config -with-zlib-dirmake
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1