centos 6上安裝apache2.2.21 mysql5.5.18 and php5.3.8

來源:互聯網
上載者:User

使用本地ISO檔案做為yum的源
Step # 1: Mount an ISO file
# yum install createrepo
# mkdir -p /mnt/iso/{1,2,3}
# mount -o loop /path/to/centos1.iso /mnt/iso/1
 
Step # 2: Create a repository
# cd /mnt/iso
# createrepo .
Clean repo, enter:
# yum clean all
 
Step # 3: Create config file
# vi /etc/yum.repos.d/iso.repo
寫入以下內容:
[MyISORepository]
name=ISO
baseurl=file:///mnt/iso
enabled=1
 
Save and close the changes.
 
# yum install package-name
 
環境準備
# yum install -y gcc gcc-c++ make zlib-devel cmake ncurses-devel libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel vim vsftpd sudo
 
Apache
# tar xzvf httpd-2.2.21.tar.gz
# cd httpd-2.2.21
# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-rewrite --enable-headers --enable-expires --enable-mime-magic --enable-deflate
# make
# make install
# cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
# vi /etc/rc.d/init.d/httpd
在檔案首部#!/bin/bash行下,加入以下幾行
# chkconfig: 2345 50 40
# description: This is a Internet www Server
# chkconfig --add httpd
 
cronolog
# tar xzvf cronolog-1.6.2.tar.gz
# cd cronolog-1.6.2
# ./configure
# make
# make install
 
MySQL
# tar xzvf mysql-5.5.18.tar.gz
# cd mysql-5.5.18.tar.gz
# cmake .
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/mydata/mysql
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_MYISAM_STORAGE_ENGINE=1
-DWITH_MEMORY_STORAGE_ENGINE=1
-DENABLED_LOCAL_INFILE=1
-DMYSQL_TCP_PORT=3306
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock
-DMYSQL_USER=mysql
-DSYSCONFDIR=/etc
-DEXTRA_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DWITH_DEBUG=0
 
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
# cp support-files/mysql.server /etc/init.d/mysqld
# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/mydata/mysql/
# chmod +x /etc/init.d/mysqld
# chkconfig --add mysqld
# chown mysql:mysql /mydata/mysql -R
# chown mysql:mysql /usr/local/mysql -R
 
#PHP
# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-apxs2=/usr/local/apache/bin/apxs --with-gd --with-zlib --with-freetype-dir --with-config-file-path=/usr/local/php/etc --enable-gd-native-ttf --enable-zend-multibyte --disable-ipv6 --with-iconv --disable-debug --enable-mbregex --with-curl --enable-mbstring=all --enable-zip --enable-exif --with-jpeg-dir --with-png-dir --enable-ftp
# make
# make install
#配置apache
# vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
 
安裝memcache*
# yum install -y memcached
# chkconfig --add memcached
# service memcached start
# /usr/local/php/bin/pecl install memcache

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.