時(shí)間:2023-06-03 23:21:02 | 來源:網(wǎng)站運(yùn)營
時(shí)間:2023-06-03 23:21:02 來源:網(wǎng)站運(yùn)營
在Ubuntu服務(wù)器上搭建wordpress網(wǎng)站:本文介紹如何在Ubuntu系統(tǒng)下在nginx中部署wordpress。包括的內(nèi)容有wordpress下載及配置,MySQL數(shù)據(jù)庫及用戶的創(chuàng)建,nginx虛擬主機(jī)的配置等內(nèi)容。WordPress是一個(gè)注重美學(xué)、易用性和網(wǎng)絡(luò)標(biāo)準(zhǔn)的個(gè)人信息發(fā)布平臺。WordPress雖為免費(fèi)的開源軟件,但其價(jià)值無法用金錢來衡量。 使用WordPress可以搭建功能強(qiáng)大的網(wǎng)絡(luò)信息發(fā)布平臺,但更多的是應(yīng)用于個(gè)性化的博客。針對博客的應(yīng)用,WordPress能讓您省卻對后臺技術(shù)的擔(dān)心,集中精力做好網(wǎng)站的內(nèi)容。
wget http://wordpress.org/latest.tar.gz
解壓文件包。假設(shè)解壓至用戶的主目錄中。tar -xzvf latest.tar.gz
mysql -u root -p
創(chuàng)建數(shù)據(jù)庫:CREATE DATABASE wordpress;
創(chuàng)建MySQL用戶:CREATE USER wordpress@localhost;
設(shè)置密碼:SET PASSWORD FOR wordpress@localhost= PASSWORD("your password");
配置權(quán)限:GRANT ALL PRIVILEGES ON wordpress.* TO wordpress@localhost IDENTIFIED BY 'your password';FLUSH PRIVILEGES;
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php
編輯配置文件:sudo vi ~/wordpress/wp-config.php
修改下面的選項(xiàng):// ** MySQL 設(shè)置 - 具體信息來自您正在使用的主機(jī) ** //^M/** WordPress數(shù)據(jù)庫的名稱 */define('DB_NAME', 'wordpress');/** MySQL數(shù)據(jù)庫用戶名 */define('DB_USER', 'wordpress');/** MySQL數(shù)據(jù)庫密碼 */define('DB_PASSWORD', 'your password');
拷貝文件到網(wǎng)站根目錄下 一般將/var/www設(shè)置為網(wǎng)站的根目錄。sudo mkdir -p /var/www
拷貝文件:sudo cp -r ~/wordpress/* /var/www
修復(fù)權(quán)限:sudo chown -R www-data:www-data /var/www
sudo vi /etc/nginx/sites-available/default
將server配置改為如下:server { listen 80; root /var/www; index index.php index.html index.htm; server_name www.darrenfang.com; location / { try_files $uri $uri/ /index.php?q=$uri&$args; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/www; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ /.php$ { try_files $uri =404; #fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; }}
重啟nginx和php-fpm:sudo service nginx restartsudo service php5-fpm restart
http://127.0.0.1/wp-admin/install.php
執(zhí)行安裝。關(guān)鍵詞:服務(wù)
客戶&案例
營銷資訊
關(guān)于我們
微信公眾號
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。