/////////////////////////////安装mysql 5.1笔记 /////////////////////////////////
1、拷贝安装包 mysql-5.1.30.tar.gz 到 /data/soft/
拷贝my.cnf到/data/soft/
2、解压缩
# cd /data/soft
# tar zxvf mysql-5.1.*.tar.gz
2.1创建一个用户来运行 MySQL 守护进程。
# useradd -M -s /sbin/nologin mysql
2.2创建相关文件夹
# mkdir -p /data/mysqldata
yum -y install compat-*(可选)
yum groupinstall "Development Libraries"(可选)
3、配置编译选项
# cd mysql-5.1.30
# ./configure --prefix=/usr/local/mysql --datadir=/data/mysqldata --sysconfdir=/usr/local/mysql/etc --with-unix-socket-path=/usr/local/mysql/mysql.sock --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-comment=Source --with-server-suffix=-Community-Server --with-mysqld-user=mysql --without-debug --with-big-tables --enable-thread-safe-client --enable-assembler --without-ndb-debug --with-plugins=max
4. 编译、安装
# make
# make install
4.1拷贝my.cnf到指定目录
# cd /usr/local/mysql/
# mkdir etc
#
4.2权限
chown -R mysql:root /usr/local/mysql/
chown -R mysql:root /data/mysqldata/
mkdir -p /var/run/mysqld
cd /var/run
chown -R mysql:mysql mysqld/
chmod 755 mysqld/
chmod -R 755 mysqld/
5. 初始化
/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/data/mysqldata
6.修改root 密码
cd /usr/local/mysql/
/usr/local/mysql/bin/mysqladmin -u root -p password 123456
8.做mysql.sock的连接
ln -s /usr/local/mysql/mysql.sock /var/lib/mysql/mysql.sock
7.启动
/usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/etc/my.cnf&
//////////////////////数据库/////////////////////////
创建用户:GRANT ALL PRIVILEGES ON movie.* TO 'litaotao'@'%' IDENTIFIED BY '123456';
创建库:CREATE DATABASE abccs;
创建表:CREATE TABLE mytable (name VARCHAR(20), sex CHAR(1), birth DATE, birthaddr VARCHAR(20));
公司员工的生日表,表的内容包含员工姓名、性别、出生日期、出生城市
刷新:FLUSH PRIVILEGES;
/////////////////安装PHP///////////////////////////
1/先装扩展(安装不指定目录)
顺序:
mhash-0.9.9
./configure && make && make install
libmcrypt-2.5.8 #安装完后,vi /etc/ld.so.conf 增加一行/usr/local/lib 保存退出
./configure && make && make install
ldconfig
mcrypt-2.6.7
./configure && make && make install
#若出现LD_LIBRARY_PATH 错误,就export LD_LIBRARY_PATH=/usr/local/libmcrypt/bin/libmcrypt_config
libxml2-2.7.2
./configure && make && make install
libxslt-1.1.23
./configure && make && make install
2.安装libpng
tar zxvf libpng-1.2.7.tar.tar
cd libpng-1.2.7
cd scripts/
cp makefile.linux ../makefile
cd ..
make
make install
注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个
3.安装freetype
tar zxvf freetype-2.1.9.tar.gz
cd freetype-2.1.9
./configure --prefix=/usr/local/freetype
make
make install
4.安装Jpeg
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --prefix=/usr/local/jpeg --enable-shared
ln -s /usr/bin/libtool .
make
make install
注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库
如果提示文件夹不存在,就按要求创建文件夹,mkdir
5.安装GD
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --with-png --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg
make
make install
2\安装PHP
# cd /data/soft/
# tar -jxf php-5.2.8.tar.bz2
# gzip -cd php-5.2.8-fpm-0.5.10.diff.gz | patch -d php-5.2.8 -p1
# cd php-5.2.8
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-zlib --with-libxml-dir=/usr --enable-xml --enable-discard-path --enable-safe-mode --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-openssl --with-mhash --enable-pcntl --enable-sockets --enable-soap --enable-zip --enable-ftp --with-xsl --with-gd --with-freetype-dir=/usr/local/freetype
# make (make -j 16 -s)
# make install
3、安装memcache-2.2.4
tar xf memcache-2.2.4.tgz
cd memcache-2.2.4
# /usr/local/php5/bin/phpize
./configure --enable-memcache --with-php-config=/usr/local/php5/bin/php-config --with-zlib-dir
make
make install
4、安装rar-1.0.0
tar xf rar-1.0.0.tgz
cd rar-1.0.0
# /usr/local/php5/bin/phpize
./configure --with-php-config=/usr/local/php5/bin/php-config
make
make install
5、安装eaccelerator-0.9.5.3(可选)
tar -jxf eaccelerator-0.9.6.tar.bz2
./configure --with-php-config=/usr/local/php5/bin/php-config
make
make install
拷贝线上的/usr/local/php5/etc/php.ini
useradd -M -s /sbin/nologin nginx 最好与nginx用户名一致
6、配置PHP的php-fpm.conf
修改用户名和组名
Unix user of processes
<value name="user">nginx</value> 去掉注释,添加用户名nginx
Unix group of processes
<value name="group">nginx</value> 去掉注释,添加组名nginx
启动phpfpm
# /usr/local/php5/sbin/php-fpm start
//////////////////////////////安装nginx///////////////////////////////
1\解压pcre-7.8
tar jxvf pcre-7.8.tar.bz2
./configure
make
make install
2\装nginx
tar zxvf nginx-0.7.27.tar.gz
./configure --prefix=/usr/local/nginx --with-pcre=/data/soft/pcre-7.8 --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-poll_module
make && make install
拷贝线上的nginx.conf (看看是否需要修改phpcgi的端口,可能会出现被占用)
启动。进入sbin目录启动nginx:
# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
//////////////安装memcache//////////////
1.需要安装libevent
2.需要安装memcached
tar zxvf memcached-1.4.5.tar.gz
/////////////////// 安装ttserver/////////////////////////////////////////
先装 tokyocabinet-1.4.9
再装 tokyotyrant-1.1.16
启动ttserver(下面的启动脚本中,有目录地方,需要事先创建)
./ttserver -host 192.168.15.12 -port 12000 -thnum 8 -dmn -pid /data/ttserver/iqc/ttserver.pid -le -ulog /data/ttserver/iqc/ulog/ -ulim 128m -sid 1 -rts /data/ttserver/iqc/ttserver.rts /data/ttserver/iqc/database.tch#bnum=50000000#xmsiz=434217728#rcnum=200
///////////////////搜索服务包(CMSIndex.tar、CMSSearch.tar)////////////////////
1.解压缩
2.配置CMSIndex/conf/index文件 第一个是自己搜索目录
3.把cmsindex目录放到 /data下
4.把cmssearch.tar 解压后,放入tomcat/webapps/下
mv /data/soft/CMSSearch /usr/local/tomcat/webapps/CMSSearch
5.修改配置CMSSearch/WEB-INF/classes/search.ini 此配置为每日索引文件很大
6.编译imagemagick
Tar –zxf imagemagick*.tar.gz ./configure 最后生成列表中,jpeg、gif、png值是否为yes
若不是,解压缩imagemagickpackage.tar 安装jpeg、tiff、png
tar -zxvf jpegsrc.*.tar.gz ./configure --enable-shared 缺少libtool 从/usr/bin/libtool建立软链接
tar -zxvf libpng*.tar.gz 从script中copy出makefile.linux 到当前目录为makefile 然后make;make install 不需要./configure
之后在安装gif ./configure make make install
///////////////安装流量查看软件nload ////////////////
软件地址 http://www.roland-riegel.de/nload/index.html
1.安装, wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz
tar zxvf nload-0.7.2.tar.gz
cd nload-0.7.2
./configure
make
make install
(安装时少文件,需要 yum -y install gcc-c++,如出现ncurses library or development files not found.的错误,需要 yum -y install ncurses-devel)
2.使用 ,
可直接 nload 或者 nload eth0
------------------------------
linux添加用户:
adduser xxx
passwd xxxx
给xxx用户sudo权限
nano -w /etc/sudoer
ctrl+x 退出