<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 手動搭建lnmp環境 ## 1、配置防火墻,開啟80端口、3306端口 ~~~ vi /etc/sysconfig/iptables 將 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT 加到 22端口配置后面 ~~~ ## 2、關閉SELINUX ~~~ vi /etc/selinux/config #SELINUX=enforcing #注釋掉 #SELINUXTYPE=targeted #注釋掉 SELINUX=disabled #增加 ~~~ 重啟centos reboot -n ## 3、系統約定 軟件源代碼包存放位置:/usr/local/src 源碼包編譯安裝位置:/usr/local/軟件名字 ## 4、下載軟件 下載nginx(目前穩定版)http://nginx.org/download/nginx-1.5.13.tar.gz 下載pcre(支持nginx偽靜態)http://sourceforge.net/projects/pcre/files/pcre/8.35/pcre-8.35.tar.gz 下載MySQL http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.37.tar.gz 下載php http://ar2.php.net/get/php-5.5.10.tar.gz/from/this/mirror 下載cmake(MySQL編譯工具) http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz 下載libmcrypt(PHPlibmcrypt模塊) http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz ## 5、安裝編譯工具及庫文件(使用CentOS yum命令安裝) ~~~ yum install make apr* autoconf automake curl-devel gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel gd kernel keyutils patch perl kernel-headers compat* mpfr cpp glibc libgomp libstdc++-devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype libjpeg* libpng* php-common php-gd ncurses* libtool* libxml2 libxml2-devel patch ~~~ ## 6、安裝cmake ~~~ tar zxvf cmake-2.8.8.tar.gz cd cmake-2.8.8 ./configure make make install ~~~ ## 7、安裝mysql ~~~ groupadd mysql #添加mysql組 useradd -g mysql mysql -s /bin/false #創建用戶mysql并加入到mysql組,不允許mysql用戶直接登錄系統 mkdir -p /data/mysql #創建MySQL數據庫存放目錄 chown -R mysql:mysql /data/mysql #設置權限 mkdir -p /usr/local/mysql #創建安裝目錄 tar zxvf mysql-5.5.37.tar.gz cd mysql-5.5.37 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc #配置   make #編譯   make install #安裝   cd /usr/local/mysql   cp ./support-files/my-huge.cnf /etc/my.cnf #拷貝配置文件(注意:/etc目錄下面默認有一個my.cnf,直接覆蓋即可)   vi /etc/my.cnf #編輯配置文件,在 [mysqld] 部分增加   datadir = /data/mysql #添加MySQL數據庫路徑   ./scripts/mysql_install_db --user=mysql #生成mysql系統數據庫   cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld #把Mysql加入系統啟動   chmod 755 /etc/init.d/mysqld #增加執行權限   chkconfig mysqld on #加入開機啟動   vi /etc/rc.d/init.d/mysqld #編輯   basedir = /usr/local/mysql #MySQL程序安裝路徑   datadir = /data/mysql #MySQl數據庫存放目錄   service mysqld start #啟動   vi /etc/profile #把mysql服務加入系統環境變量:在最后添加下面這一行   export PATH=$PATH:/usr/local/mysql/bin   下面這兩行把myslq的庫文件鏈接到系統默認的位置,這樣你在編譯類似PHP等軟件時可以不用指定mysql的庫文件地址。   ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql   ln -s /usr/local/mysql/include/mysql /usr/include/mysql   shutdown -r now #需要重啟系統,等待系統重新啟動之后繼續在終端命令行下面操作   mysql_secure_installation #設置Mysql密碼   根據提示按Y 回車輸入2次密碼   或者直接修改密碼/usr/local/mysql/bin/mysqladmin -u root -p password "123456" #修改密碼   service mysqld restart #重啟 ~~~ ## 8、安裝PCRE ~~~ cd /usr/local/src mkdir /usr/local/pcre tar zxvf pcre-8.35.tar.gz cd pcre-8.35 ./configure --prefix=/usr/local/pcre make make install ~~~ ## 9、安裝nginx ~~~ cd /usr/local/src groupadd www useradd -g www www -s /bin/false tar zxvf nginx-1.5.13.tar.gz cd nginx-1.5.13 ./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-openssl=/usr/ --with-pcre=/usr/local/src/pcre-8.35 make make install ~~~ #設置nginx自啟動,加入以下腳本 ~~~ vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the Nginx HTTP Server # it is v.0.0.2 version. # chkconfig: - 85 15 # description: Nginx is a high-performance web and proxy server. # It has a lot of features, but it's not for everyone. # processname: nginx # pidfile: /var/run/nginx.pid # config: /usr/local/nginx/conf/nginx.conf nginxd=/usr/local/nginx/sbin/nginx nginx_config=/usr/local/nginx/conf/nginx.conf nginx_pid=/var/run/nginx.pid RETVAL=0 prog="nginx" # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x $nginxd ] || exit 0 # Start nginx daemons functions. start() { if [ -e $nginx_pid ];then echo "nginx already running...." exit 1 fi echo -n $"Starting $prog: " daemon $nginxd -c ${nginx_config} RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx return $RETVAL } # Stop nginx daemons functions. stop() { echo -n $"Stopping $prog: " killproc $nginxd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid } # reload nginx service functions. reload() { echo -n $"Reloading $prog: " #kill -HUP `cat ${nginx_pid}` killproc $nginxd -HUP RETVAL=$? echo } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) stop start ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|reload|status|help}" exit 1 esac exit $RETVAL chmod 775 /etc/rc.d/init.d/nginx chkconfig nginx on /etc/rc.d/init.d/nginx restart service nginx restart ~~~ ## 10、安裝libmcrypt ~~~ cd /usr/local/src tar zxvf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8 ./configure make nake install ~~~ ## 11、安裝PHP ~~~ cd /usr/local/src tar -zvxf php-5.5.10.tar.gz cd php-5.5.10 mkdir -p /usr/local/php5 ./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-mysql-sock=/tmp/mysql.sock --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pear --with-gettext --enable-session --with-mcrypt --with-curl make make install cp php.ini-production /usr/local/php5/etc/php.ini rm -rf /etc/php.ini ln -s /usr/local/php5/etc/php.ini /etc/php.ini cp /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.conf vi /usr/local/php5/etc/php-fpm.conf user = www #設置php-fpm運行賬號為www //在5.5版本此處不存在 不需要配置 在5.3版本需要配置 group = www #設置php-fpm運行組為www //在5.5版本此處不存在 不需要配置 在5.3版本需要配置 pid = run/php-fpm.pid #取消前面的分號 cp /usr/local/src/php-5.5.10/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm#拷貝php-fpm到啟動目錄 chmod +x /etc/rc.d/init.d/php-fpm #添加執行權限 chkconfig php-fpm on #設置開機啟動 vi /usr/local/php5/etc/php.ini #編輯配置文件 修改為:date.timezone = PRC #設置時區 ~~~ ## 12、配置nginx支持php ~~~ vi /usr/local/nginx/conf/nginx.conf #編輯配置文件,需做如下修改 user www www; #首行user去掉注釋,修改Nginx運行組為www www;必須與/usr/local/php5/etc/php-fpm.conf中的user,group配置相同,否則php運行出錯 index index.php index.html index.htm; #添加index.php # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } #取消FastCGI server部分location的注釋,并要注意fastcgi_param行的參數,改為 $document_root$fastcgi_script_name,或者使用絕對路徑 /etc/init.d/nginx restart #重啟nginx ~~~ ## 13、測試 ~~~ cd /usr/local/nginx/html/ #進入nginx默認網站根目錄 rm -rf /usr/local/nginx/html/* #刪除默認測試頁 vi index.php #編輯 phpinfo(); chown www.www /usr/local/nginx/html/ -R #設置目錄所有者 chmod 700 /usr/local/nginx/html/ -R #設置目錄權限 shutdown -r now #重啟系統 ~~~ ## 14、相關命令 ~~~ service nginx restart #重啟nginx service mysqld restart #重啟mysql /usr/local/php5/sbin/php-fpm #啟動php-fpm /etc/rc.d/init.d/php-fpm restart #重啟php-fpm /etc/rc.d/init.d/php-fpm stop #停止php-fpm ~~~ # 一鍵搭建lnmp環境 **1、登錄網站查看組新版本當然此處也有安裝方法** http://lnmp.org/install.html 安裝LNMP執行: `wget -c http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz && tar zxf lnmp1.2-full.tar.gz && cd lnmp1.2-full && ./install.sh lnmp` 如需要安裝LNMPA或LAMP,將./install.sh 后面的參數替換為lnmpa或lamp即可。 如下載速度慢請更換其他下載節點,詳情請看下載頁面。LNMP下載節點具體替換方法。 按上述命令執行后,會出現如下提示: 1、需要設置MySQL的root密碼(不輸入直接回車將會設置為root),輸入后回車進入下一步,如下圖所示: ![document/2015-09-16/55f908c8286d2](https://box.kancloud.cn/document_2015-09-16_55f908c8286d2.png) 這里需要確認是否啟用MySQL InnoDB,如果不確定是否啟用可以輸入 y ,輸入 y 表示啟用,輸入 n 表示不啟用。默認為y 啟用,輸入后回車進入下一步,選擇MySQL版本: ![document/2015-09-16/55f9093a43611](https://box.kancloud.cn/document_2015-09-16_55f9093a43611.png) 輸入MySQL或MariaDB版本的序號,回車進入下一步,選擇PHP版本: ![document/2015-09-16/55f90952bd0ae](https://box.kancloud.cn/document_2015-09-16_55f90952bd0ae.png) 輸入PHP版本的序號,回車進入下一步,選擇是否安裝內存優化: ![document/2015-09-16/55f909700a43c](https://box.kancloud.cn/document_2015-09-16_55f909700a43c.png) 可以選擇不安裝、Jemalloc或TCmalloc,輸入對應序號回車。 3、安裝完成 如果顯示Nginx: OK,MySQL: OK,PHP: OK ## **此處是安裝nginx虛擬服務器的配置** ~~~ server { listen 80; #listen [::]:80; server_name haoli.com hl.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/hlsc; include none.conf; #error_page 404 /404.html; location /{ if (-f $request_filename) { expires max; break; } if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; } } location ~ \.php($|/) { fastcgi_pass unix:/tmp/php-cgi.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } access_log off; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看