lamp/lnmp:(linux apache nginx mysql php)
源码安装mysql : (必会技能)
mysql-boost-5.7.11.tar.gz
cmake-2.8.12.2-4.el6.x86_64.rpm
cmke -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
#安装目录
-DMYSQL_DATADIR=/usr/local/mysql/data \
#数据库存放目录
-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock\
#Unix socket 文件路径
-DWITH_MYISAM_STORAGE_ENGINE=1 \
#安装 myisam 存储引擎
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
#安装 innodb 存储引擎
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
#安装 archive 存储引擎
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
#安装 blackhole 存储引擎
-DWITH_PARTITION_STORAGE_ENGINE=1 \
#安装数据库分区
-DENABLED_LOCAL_INFILE=1 \
#允许从本地导入数据
-DWITH_READLINE=1 \
#快捷键功能
-DWITH_SSL=yes \
#支持 SSL
-DDEFAULT_CHARSET=utf8 \
#使用 utf8 字符
-DDEFAULT_COLLATION=utf8_general_ci \
#校验字符
-DEXTRA_CHARSETS=all \
#安装所有扩展字符集
-DMYSQL_TCP_PORT=3306 \
#MySQL 监听端口
make && make install
yum install gcc-c++ -y
rm -f CMakeCache.txt
yum install ncurses-devel -y
rm -f CMakeCache.txt
yum install bison -y
make && make install
vim ~/.bash_profile
source ~/.bash_profile
cd /uar/local/lnmp/mysql/support-files
cp my-default.cnf /etc/my.cnf
cp mysql.server.server/etc/init.d/mysqld
cd /usr/local/lnmp/mysql
useradd mysql
passwd mysql
chown mysql.mysql . -R
mysqld --initialize --user=mysql --basedir=/usr/local/lnmp/mysql/--datadir=/usr/local/lnmp/mysql/data (初始化)
chown mysql data -R (安全 权限)
/etc/init.d/mysqld start
mysql -p
alter user root@localhost identified by‘Westos+007‘
源码安装php:
php-5.6.20.tar.bz2
tar jxf php-5.6.20.tar.bz2
cd php-5.6.20
./configure--prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc--with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir--with-png-dir --with-freetype-dir --without-pear --with-gettext --with-gmp --enable--inline-optimization--enable-soap --enable-ftp --enable-sockets --enable-mbstring --enable-fpm--with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt --with-mhash--with-mysql=mysqld --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mysqlnd
cd php-5.6.20
cp php.ini-production/usr/local/lnmp/php/etc/php.ini
cd /usr/local/lnmp/php/etc/
cp php-fpm.conf.default php-fpm.conf
/root/php-5.6.20/sapi/fpm
cp init.d.php-fpm /etc/init.d/php-fpm
chmod +x/etc/init.d/php-fpm
cd /usr/local/lnmp/php/etc/
vim php-fpm.conf
vim php.ini
/etc/init.d/php-fpm start
cd /usr/local/nginx/conf
vim nginx.conf
/usr/local/nginx/html
vim index.php (写测试页面)
vim php.ini
yum install unzip -y
unzip Discuz_X3.2_SC_UTF8.zip -d /usr/local/nginx/html/
mv upload/ bbs
cd bbs/
chmod 777 config/
chmod 777 data/
chmod 777 data/ -R
chmod 777 data/
cd /usr/local/lnmp/mysql
chmod 755 data/
原文地址:http://12117148.blog.51cto.com/12107148/1909685