天天看點

lnmp

lamp/lnmp:(linux apache nginx mysql php)

lnmp:

lnmp

源碼安裝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

lnmp

yum install gcc-c++ -y

rm -f cmakecache.txt

yum install ncurses-devel -y

yum install bison -y

vim ~/.bash_profile

lnmp

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

lnmp

cd /usr/local/lnmp/mysql

lnmp

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

lnmp
lnmp

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

lnmp

/root/php-5.6.20/sapi/fpm

cp init.d.php-fpm /etc/init.d/php-fpm

lnmp

chmod +x/etc/init.d/php-fpm

vim php-fpm.conf

lnmp

vim php.ini

lnmp

/etc/init.d/php-fpm start

lnmp
lnmp

cd /usr/local/nginx/conf

vim nginx.conf

lnmp
lnmp

/usr/local/nginx/html

vim index.php (寫測試頁面)

lnmp
lnmp

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 755 data/