mysql安装配置笔记

回复 收藏
1、cd /usr/local/src    (进入下载的目录)
2、wget http://downloads.mysql.com/archives/get/file/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz   下载MySQL(免编译)安装版
3、tar -zxvf mysql-5.1.40-linux-i686-icc-glibc23.tar.gz    解压缩文件至该目录下
4、useradd -s /bin/nologin -M mysql  创建用户mysql
5、mv mysql-5.1.40-linux-i686-icc-glibc23 /usr/local/mysql   解压的文件移动到/usr/local/mysql
6、cd /usr/local/mysql
7、mkdir /data/mysql  创建数据库文件
8、chown -R mysql:mysql /data/mysql   更改权限
9、./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
初始化完成,下面配置mysql
10、cd support-files
11、cp sopport-files/my-large.cnf /etc/my.cnf 复制并替换
12、cp mysql.service /etc/init.d/mysqld  
13、chmod 755 /etc/init.d/mysqld
14、vim /etc/init.d/mysqld
       修改basedir=/usr/local/mysql
             datadir=/data/mysql             主程序目录和数据文件目录
15、chkconfig --add mysqld      加入服务至系统列表
16、chkconfig mysqld on      开机启动
17、service mysqld start       启动服务
18、ps aux |grep mysqld
2016-04-24 21:51 举报
已邀请:
0

漠林sky

赞同来自:

本帖最后由 漠林sky 于 2016-5-11 15:50 编辑

Apache安装

1.cd /usr/local/src
2. wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.2.31.tar.bz2  下载httpd软件安装包
3.tar jxf httpd-2.2.31.tar.bz2    解压
4../configure \
--prefix=/usr/local/apache \
--with-included-apr \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--with-pcre
5.make  编译
6. make install
7. /usr/local/apache/bin/apachectl start     启动
8. ps aux |grep httpd
0

漠林sky

赞同来自:

本帖最后由 漠林sky 于 2016-5-11 16:44 编辑

php 编译安装


1.cd /usr/local/src
2.wget http://cn2.php.net/distributions/php-5.5.34.tar.bz2
3.tar jxvf php-5.5.34.tar.bz2
4.cd php-5.5.34
5../configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php/etc  \
--with-mysql=/usr/local/mysql \
--with-libxml-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif \
--disable-ipv6
注:在这一步,阿铭遇到如下错误:

configure: error: xml2-config not found. Please check your libxml2 installation.

解决办法是:

yum install -y libxml2-devel

还有错误:

configure: error: Cannot find OpenSSL's

解决办法是:

yum install -y openssl openssl-devel

错误:

checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution

解决办法:

yum install -y bzip2 bzip2-devel

错误:

configure: error: png.h not found.

解决办法:

yum install -y libpng libpng-devel

错误:

configure: error: freetype.h not found.

解决办法:

yum install -y freetype freetype-devel

错误:

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

解决办法:

rpm -ivh "http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm"
yum install -y  libmcrypt-devel

因为centos6.x 默认的yum源没有libmcrypt-devel 这个包,只能借助第三方yum源。
6. make
7.make install
8.cp php.ini-production /usr/local/php/etc/php.ini 拷贝配置文件到etc目录下

修改配置文件
9.vim /usr/local/apache/conf/httpd.conf
  找到:
  
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all

改为:
  
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Allow from all
  


找到:
AddType application/x-gzip .gz .tgz
下面加一行:
AddType application/x-httpd-php .php

找到:

    DirectionIndex index.html

改为:

    DirectionIndex index.html index.htm index.php


找到:
#ServerName www.example.com:80
改为:
ServerName localhost:80

10.检查配置文件是否有问题
/usr/local/apache/bin/apachectl -t
显示Syntax OK
11.启动
/usr/local/apache/bin/apachectl start
12. ps aux |grep httpd
0

linuxjishuren

赞同来自:

版本旧了点吧

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: