LAMPefast-编译安装-new.doc_第1页
LAMPefast-编译安装-new.doc_第2页
LAMPefast-编译安装-new.doc_第3页
LAMPefast-编译安装-new.doc_第4页
LAMPefast-编译安装-new.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

CentOS 5.7(X64)下编译安装LAMP平台源码包编译安装位置(prefix) /usr/local/src1、移除系统自带的rpm包的http mysql phpyum remove httpd mysql mysql-server php php-cli php-common php-devel php-gd -y 2 安装必备的开发包yum -y install ntp vim-enhanced 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 libmhash libmhash-devel 3 sudo权限配置,为了系统的安装生产环境下一般为普通用户配置sudo权限,进行系统管理#useradd baison /创建baison用户#passwd baison /为baison用户设置密码#rpm -q sudo /确认软件包安装#visudo /在配置文件最后一行添加下面一行,授予baison用户具有管理员权限 baison ALL=(ALL) ALL 保存退出我们一般登录系统进行维护的时候不适用root,防止权限过大误操作造成系统数据丢失,所以我们一般使用普通用户登录系统,然后需要root权限加上sudo就会有root权限#su baison /切换baison用户进行编译安装 4同步系统时间:#sudo vim /etc/ntp.conf /添加下面三行内容(19行下面添加) server 3.server 3.server 0. #sudo /sbin/service ntpd stop#sudo /usr/sbin/ntpdate /更新时间#sudo /sbin/service ntpd startsudo /sbin/chkconfig ntpd on 5 Install mysql编译安装mysql 编译环境前提(mysql 5.5.x 不再用 configure,而用cmake)#cd /usr/local/srcwget /files/v2.8/cmake-2.8.4.tar.gz #tar xvf cmake-2.8.4.tar.gz # cd cmake-2.8.4 # ./configure sudo makesudo make install cd /usr/local/src # tar zxvf mysql-5.5.23.tar.gz # cd mysql-5.5.23 # cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_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 # sudo make # sudo make install mysql 配置 #userdel -r mysql # sudo groupadd -g 3306 mysql # sudo useradd -u 3306 -g mysql -M -s /sbin/nologin mysql #sudo mkdir -p /data/mysql/data # sudo mkdir -p /data/mysql/log # sudo chown -R mysql:mysql /data/mysql # sudo chmod -R 755 /data/mysql # sudo cp support-files/f /etc/f #sudo /usr/local/mysql/scripts/mysql_install_db -user=mysql -basedir=/usr/local/mysql datadir=/data/mysql/data & /初始化数据库 # sudo cp support-files/mysql.server /etc/init.d/mysqld # chmod +x /etc/init.d/mysqld # sudo /sbin/chkconfig -add mysqld # sudo /sbin/chkconfig mysqld on #sudo /sbin/service mysqld start # netstat -tnlp |grep 3306 # cd /usr/local/bin /进入用户的默认搜索路径下建立mysql命令的软连接,可以直接执行mysql命令 # sudo ln -s /usr/local/mysql/bin/mysql mysql # sudo ln -s /usr/local/mysql/bin/mysqldump mysqldump # sudo ln -s /usr/local/mysql/bin/mysqladmin mysqladmin # mysqladmin -u root -p password 123456 /设置数据库密码 # mysql -u root -p mysql flush privileges; sudo vim /etc/f /Mysql 优化,在mysqld配置参数下面添加下面几行(大概37行下面),根据服务器不同配置进行不同的设置max_allowed_packet = 500M /先找到这行内容,修改成500innodb_file_per_tablelog-bin-trust-function-creators=1skip-name-resolv/禁用DNS解析sync-binlog=1lower_case_table_names=1max_connections = 1500 (默认100)log-error=/data/mysql/log/mysql.err.log /指定错误日志位置max_heap_table_size = 256Mjoin_buffer_size = 128Mthread_cache_size = 1200 /线程缓存thread_concurrency = 4 /设置成cpu数x2,只有一个设置2thread_stack = 256K query_cache_type = 1 /指定是否使用查询缓冲,可以设置为0、1、2,该变量是SESSION级的变量query_cache_size = 512M /查询缓冲大小query_cache_limit = 4M /单个查询缓冲大小。默认1Mquery_cache_min_res_unit = 4k /指定分配缓冲区空间的最小单位,缺省为4K tmp_table_size = 256M myisam_sort_buffer_size = 64Mback_log = 1024/设定缓存队列数,节省连接开销long_query_time = 3 open_files_limit = 10240interactive_timeout = 120wait_timeout = 120external-locking = FALSE/禁用文件系统外部锁table_cache = 1024/高速缓存大小,4G内存设置为2048修改配置文件里下面的参数,去掉前面的#innodb_buffer_pool_size = 2048M (默认16M,可以为系统内存50%70%)innodb_additional_mem_pool_size = 256M (默认2M)innodb_log_file_size = 512M (默认5M,innodb_buffer_pool_size的四分之一)innodb_log_buffer_size = 16M /设置位每秒的数据量innodb_max_dirty_pages_pct = 90innodb_file_io_threads = 4innodb_thread_concurrency = 16innodb_flush_log_at_trx_commit = 0innodb_flush_method=O_DIRECTinnodb_open_files=4096innodb_lock_wait_timeout = 120innodb_file_per_table=1 :wq /保存退出sudo rm -rvf /data/mysql/data/ib_logfile* /删除原来的默认文件sudo /sbin/service mysqld restart netstart -tnlp | grep 3306检查是否有mysql的3306端口 6、apache安装cd /usr/local/srctar xvf httpd-2.2.22.tar.gzcd httpd-2.2.22./configure -prefix=/usr/local/apache -enable-so -enable-rewrite -enable-mods-shared=most sudo make sudo make install sudo /usr/local/apache/bin/apachectl startsudo netstat -tnlp |grep httpdsudo cp /usr/local/apache/bin/apachectl /etc/init.d/httpdsudo /sbin/service httpd startnetstat -tnlp |grep 80sudo vim /etc/init.d/httpd (第二行添加注释信息,添加为系统服务) # chkconfig: 35 61 61# description: Apache :wq 保存退出sudo /sbin/chkconfig -add httpd sudo /sbin/chkconfig httpd on安装PHPcd /usr/local/srctar xvf php-5.3.10.tar.gzcd php-5.3.10 sudo ./configure -prefix=/usr/local/php -mandir=/usr/local/share/man -infodir=/usr/local/share/info -with-apxs2=/usr/local/apache/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-intl -enable-calendar -enable-bcmath -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)sudo makesudo make install sudo cp php.ini- production /usr/local/php/etc/php.ini /拷贝配置文件整合Apache与PHP及系统初始化配置sudo 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是否整合成功,下面我们测试apache和php是否整合成功,在apache文档跟目录下新建一个小小的php程序# cd /usr/local/apache/htdocs# sudo vi index.php /在index.php文件中写入下面三行 重启apache服务sudo /sbin/service httpd restart访问,在浏览器中输入http:/localhost(ip地址)/index.php 出现php信息界面则说明整合成功elinks http:/localhost/index.php成功的页面Mysql 授权1 mysql grant all privileges on *.* to efast% identified by efast;Query OK, 0 rows affected (0.06 sec) mysql flush privileges;Query OK, 0 rows affected (0.02 sec)2 导入efast数据库3 修改efast配置文件vim efast/data/config.php$db_server = mysql;/ database host$db_host = 22;/ database name$db_name = efast;/ database username$db_user = efast;/ database password$db_pass = efast; 加密狗安装过程cd /usr/local/binln -s /usr/local/webse

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论