中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

在同一臺CentOS release 6.5 (Final)x86_64上裝lanp和lnmp

發布時間:2020-05-25 12:13:18 來源:網絡 閱讀:1020 作者:13240702173 欄目:MySQL數據庫

CentOS release 6.5 (Final)x86_64

lamp

apache
wget http://archive.apache.org/dist/httpd/httpd-2.2.27.tar.gz
tar cd
./configure --prifix=/application/apache2.2.27 --enable-deflate --enable-expires --enable-headers --enable-modules=most --enable-so --with-mpm=worker --enable-rewrite
yum install -y zlib-devel
make && make install
ln -s /application/apache2.2.27/ /application/apache
ll /application/apache/conf/httpd.conf
/application/apache/bin/apachectl -t
/application/apache/bin/apachectl graceful
ps -ef|grep httpd

mqsql
wget https://downloads.mysql.com/archives/get/file/mysql-5.1.68.tar.gz
tar cd
./configure --prefix=/application/mysql5.1.68/ --with-unix-socket-path=/application/mysql5.1.68/tmp/mysql.sock --localstatedir=/application/mysql5.1.68/data --enable-assembler --enable-thread-safe-client --with-mysqld-user=mysql --with-big-tables --without-debug --with-pthread --enable-assembler --with-extra-charsets=complex --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugin-PLUGIN
echo $?
yum install -y ncurses-devel
make && make install
/home/oldboy/mysql-5.1.68/support-files/my-small.cnf /etc/my.cnf
/application/mysql/bin/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql
/home/oldboy/mysql-5.1.68/support-files/mysql.server /etc/init.d/mysqld
登陸mysql測試

php
1.php依賴包
yum install -y zlib libxml libpng libjpeg freetype gd curl libiconv zlib-devel libxml2-devel libpng-devel libjpeg-devel freetype-devel gd-devel curl-devel libcronv-devel openssl-devel libcurl-devel libxslt-devel
2.php包
http://php.net/get/php-5.3.27.tar.gz/from/a/mirror下到本地,傳到用戶家目錄
tar xf php-5.3.27.tar.gz
cd php-5.3.27
./configure --prefix=/application/php5.3.27 --with-apxs2=/application/apache/bin/apxs --with-mysql=/application/mysql --with-xmlrpc --with-openssl --with-zib --with-freetype-dir --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/libiconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-gd-native-ttf --with-curl --with-xsl --enable-ftp --with-libxml-dir
make
make install
ln -s /application/php5.3.27 /application/php
cp php.ini-production /application/php/lib/php.ini
/application/apache/conf/httpd.conf 修改apache的
·LoadModule php5_module modules/libphp5.so
·User www
·Group www
·ServerName 127.0.0.1:80
·DirectoryIndex index.php index.html
useradd -M -s /sbin/nologin www
/application/apache/bin/apachectl graceful
測試瀏覽器--index.html>>apache--index.php>>php--php腳本>>mysql

php腳本內容
<?php
$link_id=mysql_connect('localhost','root','123456') or mysql_error();

    if ($link_id) {
                    echo "php-->mysqk successful";
    }else{
                    echo "php ->mysql error()";
    }

?>

lnmp

安裝nginx
wget http://nginx.org/download/nginx-1.6.2.tar.gz
tar zxvf nginx-1.6.2.tar.gz
cd nginx-1.6.2
useradd -M -s /sbin/nologin nginx
yum install gcc pcre-devel openssl-devel -y
./configure --user=nginx --group=nginx --prefix=/application/nginx1.6.2 --with-http_stub_status_module --with-http_ssl_module
make
make install
/application/nginx1.6.2/sbin/nginx -t
/application/nginx1.6.2/sbin/nginx
ps -ef |grep nginx
注意防火墻

用二進制文件裝mysql
wget https://downloads.mysql.com/archives/get/file/mysql-5.5.32-linux2.6-x86_64.tar.gz --no-check-certificate
tar -zxvf mysql-5.5.32-linux2.6-x86_64.tar.gz
mv mysql-5.5.32-linux2.6-x86_64 /application/mysql
cp my-small.cnf /etc/my.cnf
useradd -M -s /sbin/nologin mysql
./mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/application/mysql/data
cp support-files/mysql.server /etc/init.d/mysqld
修改/etc/init.d/mysqld里的basedir 和datadir
/etc/init.d/mysqld start
測試
/application/mysql/bin/mysql
export PATH=$PATT:/application/mysql/bin/mysql

php
php依賴包
yum install -y zlib libxml libpng libjpeg freetype gd curl libiconv zlib-devel libxml2-devel libpng-devel libjpeg-devel freetype-devel gd-devel curl-devel libcronv-devel openssl-devel libcurl-devel libxslt-devel gcc gcc-c++ libxslt
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make && make install
wget https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz --no-check-certificate
tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
sleep 2
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
wget https://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz --no-check-certificate
tar -zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make && make install
rm -f /usr/lib64/libmhash.

rm -f /usr/lib64/libmcrypt.*
ln -s /usr/local/lib64/libmcrypt.la /usr/lib64/libmcrypt.la
ln -s /usr/local/lib64/libmcrypt.so /usr/lib64/libmcrypt.so
ln -s /usr/local/lib64/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4
ln -s /usr/local/lib64/libmcrypt.so.4.4.8 /usr/lib64/libmcrypt.so.4.4.8
ln -s /usr/local/lib64/libmhash.a /usr/lib64/libmhash.a
ln -s /usr/local/lib64/libmhash.la /usr/lib64/libmhash.la
ln -s /usr/local/lib64/libmhash.so /usr/lib64/libmhash.so
ln -s /usr/local/lib64/libmhash.so.2 /usr/lib64/libmhash.so.2
ln -s /usr/local/lib64/libmhash.so.2.0.1 /usr/lib64/libmhash.so.2.0.1
ln -s /usr/local/lib64/libmcrypt-config /usr/lib64/libmcrypt-config
wget https://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz --no-check-certificate
tar -zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
/sbin/ldconfig
./configure LD_LIBRARY_PATH=/usr/local/lib
make
make install

php安裝
wget http://mirrors.sohu.com/php/php-5.3.27.tar.gz
tar -zxvf php-5.3.27.tar.gz
cd php-5.3.27
./configure --prefix=/application/php5.3.27 --with-mysql=/application/mysql --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags --enable-zend-multibyte --enable-static --with-xsl --with-fpm-user=nginx --with-fpm-group=nginx --enable-ftp
ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64
make
make install
ln -s /application/php5.3.27/ /application/php
cp php.ini-production /application/php/lib/php.ini
cd /application/php/etc/
cp php-fpm.conf.default php-fpm.conf
vim php-fpm.conf 里的
pid = /app/logs/php-fpm.pid
error_log = /app/logs/php-fpm.log
log_level = error
rlimit_files = 32768
listen.owner = nginx
listen.owner = nginx
pm.max_children = 1024
pm.start_servers = 16
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.process_idle_timeout = 15s;
pm.max_requests = 2048
slowlog = /app/logs/$pool.log.slow
request_slowlog_timeout = 10
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f wenxianfeng@linekong.com

mkdir /app/logs -p
/application/php/sbin/php-fpm -t
/application/php/sbin/php-fpm
netstat -nltpu |grep php-fpm
ps -ef |grep php-fpm

開機自啟動/etc/rc.local
/etc/init.d/mysqld start
/application/php/sbin/php-fpm
/application/nginx1.6.2/sbin/nginx
在nginx虛擬主機里加判定若是.php文件調用php的fastcgi
location ~ .*.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}

用下列php腳本測試nginx到mysql通否 wen.php
<?php
$link_id=mysql_connect('localhost','root','123456') or mysql_error();

if ($link_id) {
                echo "php-->mysqk successful";
}else{
                echo "php ->mysql error()";
}

?>
刷新頁面或/application/php/bin/php wen.php

到http://kaiyuan.baike.com/ 下載HDwiki5.1正式版 GBK版放到站點目錄下
unzip HDWiki-v5.1GBK-20141205.zip
把wiki目錄下的文件放到站點目錄下
給wiki所在站點目錄權限 chown -R nginx.nginx bbs
刷新網頁,圖形配置wiki

nginx反向代理
服務器上搭nginx服務,服務正常后
egrep -v "^$|#" nginx.conf.default > nginx.conf
upstream backend {
server 后端web:80 max_fails=3 fail_timeout=30s;
server 后端web:80 max_fails=3 fail_timeout=30s;
}
根據http://nginx.org/en/docs/http/ngx_http_upstream_module.html upstream 和proxy 模塊
在nginx虛擬主機里加上
location / {
proxy_pass http://backend;
}
不斷訪問反向代理服務器看是否交給后端服務器處理或者寫for循環在反向代理機器測試
客戶端解析域名成反向代理ip,反向代理交給后端服務器(ip),默認會讀取第一個虛擬主機,要是想讀取某個域名的虛擬主機,需在反向代理服務器配置文件里加
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

琼海市| 札达县| 莱阳市| 伊宁县| 阿拉善右旗| 衡东县| 正定县| 临洮县| 炎陵县| 颍上县| 辉南县| 攀枝花市| 大石桥市| 阳山县| 赤水市| 乐亭县| 安陆市| 衡南县| 类乌齐县| 本溪| 轮台县| 鹿泉市| 和田市| 遂平县| 通化县| 孟连| 平安县| 渝中区| 清徐县| 麦盖提县| 怀集县| 深泽县| 宣威市| 庐江县| 蓝田县| 苍梧县| 寿阳县| 监利县| 古丈县| 苏尼特右旗| 山东|