centos7(64位) php7 mariadb10  nginx1.9

lrenwang , 2016/11/27 16:07 , Linux , 评论(0) , 阅读(27) , Via 本站原创
vim复制自动注释解决办法

vim 配置文件增加set paste




一挂载数据盘
执行“fdisk -S 56 /dev/xvdb”命令,对数据盘进行分区;
根据提示,依次输入“n”,“p”“1”,两次回车,“wq”,分区就开始了,很快就会完成。
使用“fdisk -l”命令可以看到,新的分区xvdb1已经建立完成了。
使用“mkfs.ext4 /dev/xvdb1”命令对新分区进行格式化,格式化的时间根据硬盘大小有所不同。
使用“echo '/dev/xvdb1  /data ext4    defaults    0  0' >> /etc/fstab”(不含引号)命令写入新分区信息。
然后使用“cat /etc/fstab”命令查看,出现以下信息就表示写入成功。
mkdir /data
使用“mount -a”命令挂载新分区,然后用“df -h”命令查看,出现以下信息就说明挂载成功,可以开始使用新的分区了。

二cp 命令直接覆盖,不需要提示

sed -i "s/alias cp='cp -i'/#alias cp='cp -i'/g" ~/.bashrc
su -

三更新所需的安装包

yum -y update
yum -y remove  httpd* php* mariadb*
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers vsftpd patch zip unzip vim wget ncurses-devel cmake bison bison-devel boostl libtool-ltdl-devel libmcrypt  memcached git


四软件下载

mkdir /data/soft/config -p
mkdir /data/www/index -p
mkdir /data/vhost
mkdir /data/svn
mkdir /data/mysql
cd /data/soft
wget http://mirrors.sohu.com/nginx/nginx-1.9.9.tar.gz
wget http://mirrors.sohu.com/php/php-7.0.9.tar.gz
wget http://blog.lrenwang.com/down/lnmp/libmemcached-1.0.18.tar.gz
wget http://blog.lrenwang.com/down/lnmp/libiconv-1.13.tar.gz
wget http://blog.lrenwang.com/down/lnmp/libmcrypt-2.5.8.tar.gz
wget http://blog.lrenwang.com/down/lnmp/mcrypt-2.6.8.tar.gz
wget http://blog.lrenwang.com/down/lnmp/mhash-0.9.9.9.tar.gz
wget http://blog.lrenwang.com/down/lnmp/pcre-8.33.zip

cd /data/soft/config
wget http://blog.lrenwang.com/down/lnmp/config/php.ini
wget http://blog.lrenwang.com/down/lnmp/config/my.cnf
wget http://blog.lrenwang.com/down/lnmp/config/php-fpm.conf
wget http://blog.lrenwang.com/down/lnmp/config/nginx.conf
wget http://blog.lrenwang.com/down/lnmp/config/fcgi.conf

五安装php mysql


#1、编译安装PHP所需的支持库:


tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13/
./configure --prefix=/usr/local
make
make install
cd ../

tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd /data/soft/

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd /data/soft/
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../





#2、数据库

vim /etc/yum.repos.d/MariaDB.repo

[mariadb]  
name = MariaDB  
baseurl = http://mirrors.ctyun.cn/MariaDB/yum/10.1/centos7-amd64/  
gpgkey= http://mirrors.ctyun.cn/MariaDB/yum/RPM-GPG-KEY-MariaDB  
gpgcheck=1  


yum -y install MariaDB-server MariaDB-client
#/usr/share/mysql/my-* 对应不同的配置
cd  /data/mysql/
cp  /usr/share/mysql/my-innodb-heavy-4G.cnf /etc/my.cnf
vim /etc/my.cnf
#[mysqld]增加
datadir         = /data/mysql/mariadb

rm -rf /var/lib/mysql
mysql_install_db --defaults-file=/data/mysql/my.cnf --datadir=/data/mysql/mariadb/ --user=mysql
chown mysql:mysql -R /data/mysql/
mysqladmin -u root password "123456"

  

#3、编译安装PHP

/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
ln -s /usr/lib64/lib* /usr/lib/
cd /data/soft/
tar zxvf php-7.0.9.tar.gz
cd  php-7.0.9

./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc    --with-mysqli  --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath  --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl  --enable-mbregex  --enable-fpm  --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear  --with-fpm-user=www --with-fpm-group=www -disable-fileinfo  -with-pdo-mysql
make ZEND_EXTRA_LIBS='-liconv'
make install
cp  sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
chkconfig php-fpm on
cp /usr/local/webserver/php/etc/php-fpm.conf.default /usr/local/webserver/php/etc/php-fpm.conf
cp php.ini-production /usr/local/webserver/php/etc/php.ini
cd ../


ln -s /usr/local/webserver/mysql/include/mysql/*  /usr/local/include/
tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-pdo-mysql=/usr/local/webserver/mysql
make
make install
cd ../

#修改php.ini文件
post_max_size = 20M
upload_max_filesize = 20M
date.timezone = PRC

cd /usr/local/webserver/php/etc/php-fpm.d
mv www.conf.default www.conf

service php-fpm start

六安装Nginx

cd /data/soft
unzip pcre-8.33.zip
cd pcre-8.33/
./configure
make && make install
cd ../
ln -s /usr/local/lib/libpcre.so.1 /lib/
ln -s /lib/libpcre.so.1 /lib64/
#2、安装Nginx
tar zxvf nginx-1.9.9.tar.gz
cd nginx-1.9.9/
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
cd ../


2创建Nginx日志目录

mkdir -p /data/logs
chmod +w /data/logs
chown -R www:www /data/logs


4启动Nginx

ulimit -SHn 65535
/usr/local/webserver/nginx/sbin/nginx

5配置开机自动启动

echo "ulimit -SHn 65535" >> /etc/rc.d/rc.local
echo "/usr/local/webserver/nginx/sbin/nginx"  >>  /etc/rc.d/rc.local

6 PHP memcached
tar zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure --prefix=/usr/lib/libmemcached --with-memcached
make && make install
cd ..

git clone https://github.com/rlerdorf/php-memcached
cd php-memcached
/usr/local/webserver/php/bin/phpize
./configure -enable-memcached -with-php-config=/usr/local/webserver/php/bin/php-config -with-zlib-dir --with-libmemcached-dir=/usr/lib/libmemcached -prefix=/usr/local/webserver/phpmemcached  --disable-memcached-sasl
make && make install

vim /usr/local/webserver/php/etc/php.ini
extension=memcached.so
cd ..


centos yum  Subversion (SVN) 1.9

lrenwang , 2016/11/11 17:11 , Linux , 评论(0) , 阅读(38) , Via 本站原创
vim /etc/yum.repos.d/wandisco-svn.repo




[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/$releasever/svn-1.9/RPMS/$basearch/
enabled=1
gpgcheck=0


yum -y install subversion


keytool 安卓证书

lrenwang , 2016/04/05 12:52 , Linux , 评论(0) , 阅读(343) , Via 本站原创
生成证书
keytool -genkeypair -alias "test1" -keyalg "RSA" -keystore "d:\test.keystore"  


查看证书
keytool -list -keystore  d:\test.keystore
Tags:

数据库自动备份

lrenwang , 2015/11/11 18:01 , Linux , 评论(0) , 阅读(675) , Via 本站原创
#!/bin/sh
/usr/local/webserver/mysql/bin/mysqldump -u root -p123456 table > /data/bak/$(date -d "today" +"%Y%m%d").sql

no space left on device linux

lrenwang , 2015/11/01 19:37 , Linux , 评论(0) , 阅读(653) , Via 本站原创
/var/spool/postfix/

干掉这里的就行了
解决方法:
     修改“/etc/crontab”
     将‘MAILTO=root’替换成‘MAILTO=""’修改之后没有成功,需要重启crond服务才可以
     也可从在crontab(crontab -e)中最前面直接加入MAILTO=""
分页: 1/48 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]