<b>Ubuntu 10.04 64bit 编译安装MySQL5.1.x、 PHP 5.3、NGINX 0.8.x</b>[服务器安全]
本文“<b>Ubuntu 10.04 64bit 编译安装MySQL5.1.x、 PHP 5.3、NGINX 0.8.x</b>[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
一时髦起,决意体验Ubuntu,当然少不了要配置开辟环境.从网上汇集了一些资料,开始配置安装历程.
首先我们现配置下系统,避免今后的问题.
1、locale 的问题,大概会造成在 SSH 终端下的乱码,Debian 可以用 dpkg-reconfigure locales 来设定,Ubuntu就不是这样了.可以先查看一下 /usr/share/i18n/SUPPORTED 这个文件,有哪些受支持的 locale 设定,然后用号令激活便可.
locale-gen en_US.UTF-8
locale-gen fr_FR
locale-gen zh_CN.UTF-8
locale-gen zh_CN
locale-gen zh_CN.GBK
locale-gen zh_CN.GB18030
然后设定系统默许的编码语言,这样 SSH 下面就不会有乱码了,翻开 /etc/default/locale 文件,输入以下内容,然后重启系统便可.
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"
2、因为系统的pygrub已经改换成pvgrub,此时我们可以按照自己的爱好进级系统内核了…那么我们就敲号令把内核也一同升掉好了…
apt-get update
apt-get upgrade
apt-get dist-upgrade
目前我们需求确认一下系统内核,然后把多余的系统内核给卡擦了…
uname -a #肯定下版本,不要把目前正在用的给删了
dpkg --get-selections | grep linux #可以看到系统内核的列表
然后更改 /boot/grub/menu.lst,改正此中的版本便可以了,当然倡议重启一下然后再删除系统内核.
4、安装一些必备的软件:
aptitude install vim
aptitude install wget
aptitude install rcconf
aptitude install cron
aptitude install build-essential
aptitude install imagemagick
aptitude install postfix
aptitude install vsftpd
aptitude install mailx
aptitude install gawk
aptitude install bison
1、先安装依靠包
apt-get install make
apt-get install bison
apt-get install flex
apt-get install gcc
apt-get install g++
apt-get install patch
apt-get install autoconf
apt-get install subversion
apt-get install locate
apt-get install libxml2
apt-get install libxml2-dev
apt-get install libbz2-dev
apt-get install libpcre3-dev
apt-get install libssl-dev
apt-get install zlib1g-dev
apt-get install libmcrypt-dev
apt-get install libmhash-dev
apt-get install libmhash2
apt-get install libpq-dev
apt-get install libpq5
apt-get install libncurses5-dev
apt-get install libldap-2.4-2
apt-get install libmhash2
apt-get install libmysqlclient16
apt-get install curl
apt-get install libpng3
apt-get install libjpeg62
apt-get install libsasl2-2
apt-get install libmcrypt4
apt-get install libltdl7
apt-get install libssl0.9.8
apt-get install libssl-dev
apt-get install openssl
apt-get install curl
apt-get install libcurl3
apt-get install libmysql++-dev
apt-get install libfreetype6-dev
apt-get install libncurses5-dev
apt-get install libpng12-dev
apt-get install libjpeg62-dev
apt-get install libcurl3
apt-get install libcurl4-gnutls-dev2、安装MySQL 5.1.48
1、编译安装MySQL 5.1.48
./configure --prefix=/usr/local/webserver/mysql/ \
--enable-assembler --with-extra-charsets=complex \
--enable-thread-safe-client --with-big-tables --with-readline \
--with-ssl --with-embedded-server --enable-local-infile \
--with-plugins=partition,innobase,myisammrg
make
make install
2、成立MySQL用户
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
3、改正MySQL目录用户组
chmod +w /usr/local/webserver/mysql
chown -R mysql:mysql /usr/local/webserver/mysql
4、成立MySQL数据库存放目录
mkdir -p /data0/mysql/3306/data/
mkdir -p /data0/mysql/3306/binlog/
mkdir -p /data0/mysql/3306/relaylog/
chown -R mysql:mysql /data0/mysql/
5、以mysql用户帐号的身份成立数据表
/usr/local/webserver/mysql/bin/mysql_install_db \
--basedir=/usr/local/webserver/mysql \
--datadir=/data0/mysql/3306/data --user=mysql
6、成立my.cnf配置文件
vi /data0/mysql/3306/my.cnf
输入以下内容
[client]
character-set-server = utf8
port = 3306
socket = /tmp/mysql.sock
[mysqld]
character-set-server = utf8
replicate-ignore-db = mysql
replicate-ignore-db = test
replicate-ignore-db = information_schema
user = mysql
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /data0/mysql/3306/data
log-error = /data0/mysql/3306/mysql_error.log
pid-file = /data0/mysql/3306/mysql.pid
open_files_limit = 10240
back_log = 600
max_connections = 5000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 1M
join_buffer_size = 1M
thread_cache_size = 300
#thread_concurrency = 8
query_cache_size = 512M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 246M
max_heap_table_size = 246M
以上是“<b>Ubuntu 10.04 64bit 编译安装MySQL5.1.x、 PHP 5.3、NGINX 0.8.x</b>[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |