国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

云服務(wù)器|WEB服務(wù)器|FTP服務(wù)器|郵件服務(wù)器|虛擬主機|服務(wù)器安全|DNS服務(wù)器|服務(wù)器知識|Nginx|IIS|Tomcat|

服務(wù)器之家 - 服務(wù)器技術(shù) - Nginx - Ubuntu+Nginx+Mysql+Php+Zend+eaccelerator安裝配置文字版

Ubuntu+Nginx+Mysql+Php+Zend+eaccelerator安裝配置文字版

2019-10-12 11:59Nginx教程網(wǎng) Nginx

把我架設(shè)lnmp網(wǎng)站的過程寫出來,希望對想架設(shè)網(wǎng)站的朋友有所幫助,如有更好的辦法請?zhí)岢鰜?

把我架設(shè)lnmp網(wǎng)站的過程寫出來,希望對想架設(shè)網(wǎng)站的朋友有所幫助,如有更好的辦法請?zhí)岢鰜怼?nbsp;
之所以用nginx沒用apache,是因為nginx的效率更高一些,尤其是對一些低配置的服務(wù)器,比如我在單位256M內(nèi)存的舊機器上架設(shè)的服務(wù)器。 
1、安裝ubuntu server 10.04或10.10,其中安裝語言選的en,時區(qū)shanghai,服務(wù)只安裝ssh,其他全部用默認就行。 
提示:以上安裝過程完成后,建議用其他計算機登錄服務(wù)器,windows系統(tǒng)可以用putty,linux系統(tǒng)直接在終端用命令就可以: 

代碼: 
ssh 登錄名@服務(wù)器ip 

因為以下過程得輸入大量命令和代碼,在客戶機上直接粘貼即可(在windows下的putty中單擊右鍵即可把剪貼板中的內(nèi)容粘貼到終端)。 
2、添加源: 

代碼: 

復(fù)制代碼代碼如下:


sudo vi /etc/apt/sources.list 


lucid(10.04)的源添加如下: 
代碼: 

復(fù)制代碼代碼如下:


deb http://archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse 
deb http://ppa.launchpad.net/nginx/stable/ubuntu lucid main 
deb http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main 


maverick(10.10)的源: 

代碼: 

復(fù)制代碼代碼如下:


deb http://archive.ubuntu.com/ubuntu/ maverick main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ maverick-security main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ maverick-updates main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ maverick main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ maverick-security main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ maverick-updates main restricted universe multiverse 
deb-src http://archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse 
deb http://ppa.launchpad.net/nginx/stable/ubuntu maverick main 


最后一行為nginx的ppa源,需要添加key,在終端運行: 

代碼: 

復(fù)制代碼代碼如下:


sudo apt-key adv --keyserver keyserver.Ubuntu.com --recv-keys C300EE8C 


3、更新 

代碼: 

復(fù)制代碼代碼如下:


sudo apt-get update 


4、安裝網(wǎng)站系統(tǒng) 

代碼: 

復(fù)制代碼代碼如下:


sudo apt-get install nginx php5-common php5-dev php5-cgi php5-fpm php-apc php5-mysql php5-curl php5-gd php5-idn php-pear php5-mcrypt php5-memcache php5-ming php5-recode php5-tidy php5-xmlrpc php5-xsl mysql-server 


上面為必選安裝,以下php組件為可選安裝,一般網(wǎng)站程序可能用不著: 

代碼: 

復(fù)制代碼代碼如下:


sudo apt-get install php5-imagick php5-imap php5-recode php5-snmp php5-sqlite php5-xmlrpc php5-suhosin php5-odbc php5-ladp 


5、修改nginx配置文件 

代碼: 

復(fù)制代碼代碼如下:


sudo vi /etc/nginx/sites-enabled/default 


把其中的: 

代碼: 

復(fù)制代碼代碼如下:


location / { 
root /var/www; 
index index.html index.htm; 


改為: 

代碼: 

復(fù)制代碼代碼如下:


location / { 
root /var/www/nginx-default; 
index index.php index.html index.htm; 


其中的: 

代碼: 
#location ~ \.php$ { 
# fastcgi_pass 127.0.0.1:9000; 
# fastcgi_index index.php; 
# include fastcgi_params; 
#} 

改為: 

代碼: 

復(fù)制代碼代碼如下:


location ~ \.php$ { 
fastcgi_pass 127.0.0.1:9000; 
fastcgi_index index.php; 
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name; 
include fastcgi_params; 


6、更改網(wǎng)站目錄權(quán)屬: 

代碼: 
sudo chown -R ubuntu nginx-default/ 

注:其中的ubuntu為系統(tǒng)登錄用戶名。 
7、安裝ZendGuardLoader及eaccelerator: 

代碼: 

復(fù)制代碼代碼如下:


sudo mkdir /usr/zend 
mkdir /tmp/eaccelerator 
chmod 0777 /tmp/eaccelerator 
wget http://phpcj.googlecode.com/files/ZendGuardLoader.so 
sudo mv ZendGuardLoader.so /usr/zend/ZendGuardLoader.so 
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2 
tar xvjf eaccelerator-0.9.6.1.tar.bz2 
cd eaccelerator-0.9.6.1 
cp control.php /var/www/nginx-default/control.php //復(fù)制控制程序到網(wǎng)站目錄,通過http://網(wǎng)站名/control.php訪問,默認帳號為admin,密碼為eAccelertor,可編輯此文件修改。 
phpize 
sudo ./configure --enable-eaccelerator=shared 
sudo make 
sudo make install 
sudo vi /etc/php5/fpm/php.ini 


在配置文件最后加上: 

代碼: 

復(fù)制代碼代碼如下:


zend_extension=/usr/zend/ZendGuardLoader.so 
zend_loader.enable=1 
zend_loader.disable_licensing=0 
zend_loader.obfuscation_level_support=3 
zend_loader.license_path= 
zend_extension="/usr/lib/php5/20090626+lfs/eaccelerator.so" 
eaccelerator.shm_size="16" 
eaccelerator.cache_dir="/tmp/eaccelerator" 
eaccelerator.enable="1" 
eaccelerator.optimizer="1" 
eaccelerator.check_mtime="1" 
eaccelerator.debug="0" 
eaccelerator.filter="" 
eaccelerator.shm_max="0" 
eaccelerator.shm_ttl="0" 
eaccelerator.shm_prune_period="0" 
eaccelerator.shm_only="0" 
eaccelerator.compress="1" 
eaccelerator.compress_level="9" 
eaccelerator.allowed_admin_path="/var/www/nginx-default/control.php" 


8、(可選步驟)安裝phpmyadmin: 

代碼: 

復(fù)制代碼代碼如下:


wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.9/phpMyAdmin-3.3.9-all-languages.tar.bz2 
tar xvjf phpMyAdmin-3.3.9-all-languages.tar.bz2 
mv phpMyAdmin-3.3.9-all-languages /var/www/nginx-default/phpmyadmin 
cd /var/www/nginx-default/phpmyadmin 
cp config.sample.inc.php config.inc.php 
vi config.inc.php 


將其中的: 

代碼: 

復(fù)制代碼代碼如下:


$cfg['blowfish_secret'] = ''; 


改為: 

代碼: 

復(fù)制代碼代碼如下:


$cfg['blowfish_secret'] = 'web'; 


下面的: 

代碼: 

復(fù)制代碼代碼如下:


// $cfg['Servers'][$i]['controluser'] = 'pma'; 
// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; 
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; 
// $cfg['Servers'][$i]['relation'] = 'pma_relation'; 
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; 
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; 
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; 
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; 
// $cfg['Servers'][$i]['history'] = 'pma_history'; 
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; 
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; 
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf'; 


將//全部刪除,然后將其中的: 

代碼: 

復(fù)制代碼代碼如下:


$cfg['Servers'][$i]['controluser'] = 'pma'; 
$cfg['Servers'][$i]['controlpass'] = 'pmapass'; 


pma和pmapass改為你的mysql用戶名和密碼,最后登錄phpmyadmin,將phpmyadmin/scripts目錄中的creat_tables.sql文件導(dǎo)入mysql。 
9、重啟系統(tǒng)、上傳文件,網(wǎng)站建立成功!試試吧! 
文件上傳建議用filezilla(http://filezilla-project.org/),免費的開源ftp軟件,windows和linux都可以用,支持ssh的22端口。 

附:系統(tǒng)及部分軟件管理操作 
1、操作系統(tǒng): 

代碼: 

復(fù)制代碼代碼如下:


sudo reboot now //重啟系統(tǒng) 
sudo halt //關(guān)閉系統(tǒng) 


2、nginx配置修改及生效: 

代碼: 

復(fù)制代碼代碼如下:


sudo vi /etc/nginx/nginx.conf //修改配置 
sudo vi /etc/nginx/sites-enabled/default //修改配置 
sudo service nginx restart //重啟nginx 


3、php配置修改及生效: 

代碼: 

復(fù)制代碼代碼如下:


sudo vi /etc/php5/fpm/php.ini //修改配置 
sudo service php5-fpm restart //重啟fastcgi進程 


3、網(wǎng)站目錄: 

代碼: 

復(fù)制代碼代碼如下:


/var/www/nginx-default 


4、eaccelerator管理: 

代碼: 

復(fù)制代碼代碼如下:


http://你的網(wǎng)站/control.php 


5、修復(fù)nginx+php出現(xiàn)的重大漏洞、修改上傳文件大小(可以看你自己的情況) 

代碼: 

復(fù)制代碼代碼如下:


sudo vi /etc/php5/fpm/php.ini 
cgi.fix_pathinfo = 0 //修復(fù)漏洞 
upload_max_filesize = 2M改為5M //修改上傳文件大小 


6、設(shè)定防火墻 

代碼: 

復(fù)制代碼代碼如下:


sudo ufw enable 
sudo ufw default deny 
sudo ufw allow 80 
sudo ufw allow 22 


7、啟動php5-fpm時,出現(xiàn): 

代碼: 

復(fù)制代碼代碼如下:


PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/fpm/conf.d/ming.ini on line 1 in Unknown on line 0 
[WARNING] [pool www] pm.start_servers is not set. It's been set to 20. 


的提示,第一行的原因是在配置文件中已用;代替#來進行注釋。修改以下文件: 

代碼: 

復(fù)制代碼代碼如下:


vi /etc/php5/fpm/conf.d/ming.ini 


將#改為;即可。 
第二行原因是/etc/php5/fpm/pool.d/www.conf配置文件中的 

代碼: 
;pm.start_servers = 20 

去掉前面的;即可。 
8、Discuz后臺啟動 URL靜態(tài)化,會提示 404 Not Found的解決辦法: 
在niginx中開啟Rewrite,在服務(wù)器配置文件nignx.conf中寫入以下內(nèi)容,然后重啟nginx。 


代碼: 

復(fù)制代碼代碼如下:


rewrite ^/archiver/((fid|tid)-[w-]+.html)$ /archiver/index.php?$1 last; 
rewrite ^/forum-([0-9]+)-([0-9]+).html$ /forumdisplay.php?fid=$1&page=$2 last; 
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last; 
rewrite ^/space-(username|uid)-(.+).html$ /space.php?$1=$2 last; 
rewrite ^/tag-(.+).html$ /tag.php?name=$1 last; 
break; 


以下內(nèi)容來自:http://www.vpsee.com/2011/04/some-nginx-rewrite-examples-for-subdirectories/,未測試。 
Discuz! 7.2 安裝在子目錄 /bbs 下: 

代碼: 

復(fù)制代碼代碼如下:


rewrite ^/bbs/archiver/((fid|tid)-[\w\-]+\.html)$ /bbs/archiver/index.php?$1 last; 
rewrite ^/bbs/forum-([0-9]+)-([0-9]+)\.html$ /bbs/forumdisplay.php?fid=$1&page=$2 last; 
rewrite ^/bbs/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /bbs/viewthread.php?tid=$1&extra=page%3D$3&page=$2 last; 
rewrite ^/bbs/space-(username|uid)-(.+)\.html$ /bbs/space.php?$1=$2 last; 
rewrite ^/bbs/tag-(.+)\.html$ /bbs/tag.php?name=$1 last; 


Discuz! X1.5 安裝在子目錄 /bbs 下: 

代碼: 

復(fù)制代碼代碼如下:


rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last; 
rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last; 
rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last; 
rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last; 
rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last; 
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last; 
rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last; 
if (!-e $request_filename) { 
return 404; 

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 日韩精品视频在线播放 | 国产精品一区二区三区在线播放 | av一区二区三区 | 男人的天堂在线免费视频 | 九九九久久国产免费 | 国产伦精品一区二区三区四区视频 | 欧美日韩国产一区二区三区不卡 | 日本久久久久 | 一区二区三区久久久 | 寡妇少妇高潮免费看蜜臀a 午夜免费电影 | 久久99精品一区二区三区三区 | 日本不卡一区二区三区在线观看 | 日韩欧美在线看 | 日本视频二区 | 色偷偷偷 | 欧美成人黄色 | 国产免费久久 | 久久精品综合 | 免费一级特黄3大片视频 | 青青草中文字幕 | 日本中文字幕在线播放 | 午夜精品一区二区三区免费视频 | 日日夜夜精品 | 中文字幕高清免费日韩视频在线 | 精品成人国产在线观看男人呻吟 | 精品国产乱码久久久久久丨区2区 | 糈精国产xxxx在线观看 | 国产欧美日韩在线观看 | 国产精品成人3p一区二区三区 | 色综合视频 | 桃色一区 | 久久久久黄 | 久久综合成人精品亚洲另类欧美 | 久久精品超碰 | 国产精品永久免费 | 天天干天天操 | 日日夜夜精品 | 国产精品国产自产拍高清av | 亚洲国内精品 | 91在线免费看 | 欧美日韩一区二区三区在线电影 |