【网站搭建】搭建独立域名博客 -- 独立域名博客上线了 www.hanshuliang.com
博客是安裝在阿里云的服務(wù)器上.
小結(jié) :?
-- 進入數(shù)據(jù)庫命令 :mysql -uroot -p123456 ;
-- 檢查nginx配置語法 :.../nginx/sbin/nginx -t;
-- 重啟nginx服務(wù) :.../nginx/sbin/nginx -s reload ;
phpwind地址 :?http://115.28.42.124/
wordpress博客地址 :?http://115.28.42.124:8085/
emlog博客地址 :?http://115.28.42.124:8086/
.
作者?:萬境絕塵
轉(zhuǎn)載請注明出處?:?http://blog.csdn.net/shulianghan/article/details/19175147
.
一 linu服務(wù)器搭建Apache/nginx+mysql+php環(huán)境
.
1. 下載一鍵安裝包
下載環(huán)境的一鍵安裝包 :?http://soft.phpwind.me/web/shubuntu1205.zip
2. 上傳一鍵安裝包
上傳小文件直接在SecureCRT中使用 lrzsz 工具即可, 如果沒有該工具, 使用yum install -y lrzsz命令進行安裝;
安裝 lrzsz 工具:?使用?yum install -y lrzsz?命令;
[root@ip28 han]# yum install lrzsz Excluding Packages in global exclude list Finished Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package lrzsz.x86_64 0:0.12.20-22.1 set to be updated --> Finished Dependency ResolutionDependencies Resolved
上傳文件 : 進入要上傳的文件目錄, 使用 rz 命令, 會彈出一個窗口選擇所要上傳的文件;
將一鍵安裝包上傳到 /data/work/php/han 目錄中 : 隨便安裝在其它目錄中也可以;
3. 安裝一鍵安裝包
解壓一鍵安裝包 : 在安裝包目錄中使用unzip shubuntu1205.zip 命令, 解壓安裝包, 會解壓出一個 sh 目錄;
[root@ip28 han]# unzip shubuntu1205.zip Archive: shubuntu1205.zipcreating: sh/inflating: sh/account.log creating: sh/apt_ftp/... ...inflating: sh/sphinxc.sh inflating: sh/split_nginx_log.sh inflating: sh/-txt [root@ip28 han]# ls sh shubuntu1205.zip
文件權(quán)限 : 注意sh目錄中的腳本都沒有執(zhí)行權(quán)限, 這里我們直接將 sh 目錄下的所有文件都添加執(zhí)行權(quán)限;
-- 添加權(quán)限命令 : -R參數(shù)會遞歸子目錄添加權(quán)限, 如果沒有 -R 參數(shù), 就只會給sh 這個目錄添加執(zhí)行權(quán)限;
chmod -R 755 sh
安裝完成標(biāo)志 :?
檢查ngnix進程是否開啟 : 使用命令ps -ef|grep nginx ;
[root@ip28 sh]# ps -ef|grep nginx www 23672 27693 0 22:02 ? 00:00:00 nginx: worker process www 23673 27693 0 22:02 ? 00:00:00 nginx: worker process root 23721 32560 0 22:22 pts/0 00:00:00 grep nginx root 27693 1 0 21:53 ? 00:00:00 nginx: master process /alidata/server/nginx/sbin/nginx
檢查mysql程序是否開啟 : 使用命令 ps -ef|grep mysql?, 由打印出的日志可以得出下面的結(jié)論;
-- mysql的安裝目錄 :?/alidata/server/mysql/libexec/mysqld ;
-- musql數(shù)據(jù)目錄 :?/alidata/server/mysql/var ;
-- mysql用戶 :?mysql ;
-- mysql錯誤日志目錄 :?/alidata/server/mysql/var/ip28.hichina.com.err ;
[root@ip28 sh]# ps -ef|grep mysql root 23723 32560 0 22:25 pts/0 00:00:00 grep mysql root 25284 1 0 21:52 pts/0 00:00:00 /bin/sh /alidata/server/mysql/bin/mysqld_safe --datadir=/alidata/server/mysql/var --pid-file=/alidata/server/mysql/var/ip28.hichina.com.pid mysql 25453 25284 0 21:52 pts/0 00:00:00 /alidata/server/mysql/libexec/mysqld --basedir=/alidata/server/mysql --datadir=/alidata/server/mysql/var --user=mysql --log-error=/alidata/server/mysql/var/ip28.hichina.com.err --open-files-limit=16384 --pid-file=/alidata/server/mysql/var/ip28.hichina.com.pid --socket=/tmp/mysql.sock --port=3306
.
4. 登陸mysql
查看賬戶信息 : 在sh目錄中, 使用 cat account.log?查看賬戶信息,?
[root@ip28 sh]# cat account.log ########################################################################## # # thank you for using aliyun virtual machine # ##########################################################################FTP: account:******* password:*******MySQL: account:root password:*******登陸數(shù)據(jù)庫 : 使用命令? mysql -P3306 -uroot -p******* 登陸數(shù)據(jù)庫; [root@ip28 sh]# mysql -P3306 -uroot -p******* Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.63-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
查看數(shù)據(jù)庫 : 使用命令 show databases; 查看數(shù)據(jù)庫; mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.04 sec)
使用mysql數(shù)據(jù)庫 : 使用命令 use mysql; mysql> use mysql; Database changed
查看mysql表 : 使用命令 show tables;;
mysql> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | host | | ndb_binlog_index | | plugin | | proc | | procs_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 23 rows in set (0.01 sec)查詢user表字段 :? 使用命令desc user; ; mysql> desc user; +-----------------------+-----------------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------------+-----------------------------------+------+-----+---------+-------+ | Host | char(60) | NO | PRI | | | | User | char(16) | NO | PRI | | | | Password | char(41) | NO | | | | | Select_priv | enum('N','Y') | NO | | N | | | Insert_priv | enum('N','Y') | NO | | N | | | Update_priv | enum('N','Y') | NO | | N | | | Delete_priv | enum('N','Y') | NO | | N | | | Create_priv | enum('N','Y') | NO | | N | | | Drop_priv | enum('N','Y') | NO | | N | | | Reload_priv | enum('N','Y') | NO | | N | | | Shutdown_priv | enum('N','Y') | NO | | N | | | Process_priv | enum('N','Y') | NO | | N | | | File_priv | enum('N','Y') | NO | | N | | | Grant_priv | enum('N','Y') | NO | | N | | | References_priv | enum('N','Y') | NO | | N | | | Index_priv | enum('N','Y') | NO | | N | | | Alter_priv | enum('N','Y') | NO | | N | | | Show_db_priv | enum('N','Y') | NO | | N | | | Super_priv | enum('N','Y') | NO | | N | | | Create_tmp_table_priv | enum('N','Y') | NO | | N | | | Lock_tables_priv | enum('N','Y') | NO | | N | | | Execute_priv | enum('N','Y') | NO | | N | | | Repl_slave_priv | enum('N','Y') | NO | | N | | | Repl_client_priv | enum('N','Y') | NO | | N | | | Create_view_priv | enum('N','Y') | NO | | N | | | Show_view_priv | enum('N','Y') | NO | | N | | | Create_routine_priv | enum('N','Y') | NO | | N | | | Alter_routine_priv | enum('N','Y') | NO | | N | | | Create_user_priv | enum('N','Y') | NO | | N | | | Event_priv | enum('N','Y') | NO | | N | | | Trigger_priv | enum('N','Y') | NO | | N | | | ssl_type | enum('','ANY','X509','SPECIFIED') | NO | | | | | ssl_cipher | blob | NO | | NULL | | | x509_issuer | blob | NO | | NULL | | | x509_subject | blob | NO | | NULL | | | max_questions | int(11) unsigned | NO | | 0 | | | max_updates | int(11) unsigned | NO | | 0 | | | max_connections | int(11) unsigned | NO | | 0 | | | max_user_connections | int(11) unsigned | NO | | 0 | | +-----------------------+-----------------------------------+------+-----+---------+-------+ 39 rows in set (0.01 sec)
查詢user表中root用戶信息 :? 使用命令select Host,User,Password from user;; mysql> select Host,User,Password from user; +-----------+------+-------------------------------------------+ | Host | User | Password | +-----------+------+-------------------------------------------+ | localhost | root | *CE20A064267096B8D3F8B0EC068FE253144546F6 | +-----------+------+-------------------------------------------+ 1 row in set (0.01 sec)
修改root用戶登陸端口 :? 使用命令update user set Host='%' where Host='localhost';? ; mysql> update user set Host='%' where Host='localhost'; Query OK, 1 row affected (0.02 sec) Rows matched: 1 Changed: 1 Warnings: 0
刷新權(quán)限 :? 使用命令flush privileges?; mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)mysql> exit Bye
5. 安裝phpWind
.
檢查安裝環(huán)境 : 沒有錯誤, 進入下一步;
設(shè)置一系列的參數(shù) :?
-- 數(shù)據(jù)庫服務(wù)器 : 這里數(shù)據(jù)庫和phpWind都是在這個服務(wù)器上, 因此填寫 localhost;
-- 數(shù)據(jù)庫類型 : 選擇MySQL;
-- 數(shù)據(jù)庫用戶名 : root;
-- 數(shù)據(jù)庫密碼 : 在sh目錄中, 使用 cat account.log 命令獲取;
-- 數(shù)據(jù)庫名 : phpWind會自動創(chuàng)建這個數(shù)據(jù)庫;
-- 數(shù)據(jù)庫表前綴 : 數(shù)據(jù)庫中所有的表的命名;
-- 創(chuàng)始人信息 : 這個是網(wǎng)站的超級管理員密碼;
.
創(chuàng)建數(shù)據(jù)庫和表 :?
進入phpwind網(wǎng)站 :
二. Nginx下添加網(wǎng)站
1. 分析配置文件
Nginx安裝目錄 :?/alidata/server/nginx/conf/vhosts ;
[root@ip28 ~]# cd /alidata/ [root@ip28 alidata]# ls android android-new log server www [root@ip28 alidata]# cd server/ [root@ip28 server]# ls mysql mysql-5.1.57 nginx nginx-1.0.4 php php-5.2.17 Zend [root@ip28 server]# cd nginx [root@ip28 nginx]# ls client_body_temp conf fastcgi_temp html logs proxy_temp sbin scgi_temp uwsgi_temp [root@ip28 nginx]# cd conf/ [root@ip28 conf]# ls fastcgi.conf fastcgi_params.default mime.types nginx.conf.default scgi_params.default vhosts fastcgi.conf.default koi-utf mime.types.default rewrite uwsgi_params win-utf fastcgi_params koi-win nginx.conf scgi_params uwsgi_params.default
網(wǎng)站配置目錄 : 在?/alidata/server/nginx/conf/vhosts 目錄下, 網(wǎng)站的配置信息存放在這個目錄中;
[root@ip28 vhosts]# ls default.conf.bak phpwind.conf
分析配置文件內(nèi)容 :
--端口 : listen , 80是默認端口, 網(wǎng)站肯定要使用這個端口, 否則輸入域名之后還要輸出端口號, 用戶體驗不好;
--登陸域名 : server_name , 這里的域名是 localhost, 直接使用 115.28.42.124 域名即可登陸;
--網(wǎng)站文件存放目錄 : root 后面的是網(wǎng)站文件存放目錄;
--日志輸出文件 : access_log ;
[root@ip28 vhosts]# cat phpwind.conf server {listen 80;server_name localhost;index index.html index.htm index.php;root /alidata/www/phpwind;location ~ .*\.(php|php5)?${#fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 1h;}#αinclude /alidata/server/nginx/conf/rewrite/phpwind.conf;access_log /alidata/log/nginx/access/phpwind.log; }
.
2. 為單個網(wǎng)站添加多個域名
為單個網(wǎng)站添加多個域名, 只需要將server{} 在同一文件中拷貝一份, 然后將登陸域名修改下即可 :?
server {listen 80;server_name localhost;index index.html index.htm index.php;root /alidata/www/phpwind;location ~ .*\.(php|php5)?${#fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 1h;}#αinclude /alidata/server/nginx/conf/rewrite/phpwind.conf;access_log /alidata/log/nginx/access/phpwind.log; } server {listen 8081;server_name localhost;index index.html index.htm index.php;root /alidata/www/phpwind;location ~ .*\.(php|php5)?${#fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 1h;}#αinclude /alidata/server/nginx/conf/rewrite/phpwind.conf;access_log /alidata/log/nginx/access/phpwind.log; }
進行驗證 :?
-- 使用ip地址登陸 : 瀏覽器中輸入 115.28.42.124 成功進入網(wǎng)站;
-- 使用ip地址+端口號登陸: 瀏覽器中輸入 115.28.42.124:8081 成功進入網(wǎng)站 ;
??
.
3. 修改配置文件
拷貝配置文件 : 在vhost 目錄下有兩個配置文件?default.conf.bak ?phpwind.conf, 這里拷貝一份?default.conf.bak 文件;
--拷貝命令 : 使用命令?cp default.conf.bak aliyun-test.conf 拷貝文件, 拷貝?default.conf.bak 文件 并改名為 aliyun-text.conf;
[root@ip28 vhosts]# ls default.conf.bak phpwind.conf [root@ip28 vhosts]# cp default.conf.bak aliyun-test.conf [root@ip28 vhosts]# ls aliyun-test.conf default.conf.bak phpwind.conf
修改配置文件 :?
--修改端口號 : listen 8082;
--修改登陸域名 : 我的域名還沒通過備案, 先用這個server_name localhost ;
--修改網(wǎng)站文件位置 :?root /alidata/www/aliyun-test ;
--修改日志文件位置 :?access_log ?/alidata/log/nginx/access/default.log aliyun-test;
修改后的文件 :?
server {listen 8082;server_name localhost;index index.html index.htm index.php;root /alidata/www/aliyun-test;location ~ .*\.(php|php5)?${#fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 1h;}#αinclude /alidata/server/nginx/conf/rewrite/default.conf;access_log /alidata/log/nginx/access/aliyun-test.log; }
檢查語法錯誤 : 使用命令?/alidata/server/nginx/sbin/nginx -t檢查語法錯誤;
[root@ip28 vhosts]# /alidata/server/nginx/sbin/nginx -t nginx: the configuration file /alidata/server/nginx/conf/nginx.conf syntax is ok nginx: configuration file /alidata/server/nginx/conf/nginx.conf test is successful
重啟nginx服務(wù)器 : 使用命令?/alidata/server/nginx/sbin/nginx -s reload ;
登陸網(wǎng)站 : 使用 115.28.42.124:8082 登陸網(wǎng)站, 會出現(xiàn)404錯誤;
--錯誤原因 : 在?/alidata/www 下沒有對應(yīng)網(wǎng)站目錄;
創(chuàng)建網(wǎng)站目錄 : 使用命令mkdir?/alidata/www/aliyun-test , 之后繼續(xù)訪問網(wǎng)站;
訪問網(wǎng)站出現(xiàn)403錯誤: 這是因為創(chuàng)建的目錄沒有權(quán)限;
查看權(quán)限 : 使用 ll 命令即可, nginx 服務(wù)器用戶是 www , aliyun-test目錄的所有者是 root, 因此不能訪問;
添加權(quán)限 : 使用命令?chown -R www:www /alidata/www/aliyun-test/ 為aliyun-test添加所有者;
[root@ip28 www]# chown -R www:www /alidata/www/aliyun-test/ [root@ip28 www]# ll total 8 drwxr-xr-x 2 www www 4096 Feb 17 23:58 aliyun-test drwxr-xr-x 26 www www 4096 Feb 15 23:21 phpwind
[root@ip28 aliyun-test]# vim index.html [root@ip28 aliyun-test]# ls index.html [root@ip28 aliyun-test]# cat index.html hanshuliang [root@ip28 aliyun-test]#
三. 添加一個WordPress博客網(wǎng)站
一定要按照步驟來, 一步也不能出錯;
進入網(wǎng)站目錄獲取WordPress安裝程序 : 使用命令?wget http://cn.wordpress.org/wordpress-3.8.1-zh_CN.tar.gz 下載WordPress程序;
[root@ip28 www]# wget http://cn.wordpress.org/wordpress-3.8.1-zh_CN.tar.gz --2014-02-18 14:24:38-- http://cn.wordpress.org/wordpress-3.8.1-zh_CN.tar.gz Resolving cn.wordpress.org... 66.155.40.250, 66.155.40.249 Connecting to cn.wordpress.org|66.155.40.250|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 6283476 (6.0M) [application/octet-stream] Saving to: `wordpress-3.8.1-zh_CN.tar.gz'100%[========================================================================>] 6,283,476 280K/s in 24s 2014-02-18 14:25:04 (261 KB/s) - `wordpress-3.8.1-zh_CN.tar.gz' saved [6283476/6283476]
解壓文件 : 使用命令?tar -xzvf wordpress-3.8.1-zh_CN.tar.gz 將下載的安裝包解壓;
修改所有者權(quán)限 : 解壓之后, nginx用戶 www 沒有對 wordpress 目錄的訪問權(quán)限, 這里需要添加文件所有者權(quán)限;
-- 使用命令 :?chown -R www:www wordpress 添加www:www用戶組權(quán)限;
[root@ip28 www]# ll total 11912 drwxr-xr-x 2 www www 4096 Feb 18 00:20 aliyun-test -rw-r--r-- 1 root root 5869727 Jan 24 04:18 latest.tar.gz drwxr-xr-x 26 www www 4096 Feb 15 23:21 phpwind drwxr-xr-x 5 nobody 65534 4096 Jan 25 11:17 wordpress -rw-r--r-- 1 root root 6283476 Jan 25 11:17 wordpress-3.8.1-zh_CN.tar.gz [root@ip28 www]# chown -R www:www wordpress [root@ip28 www]# ll total 11912 drwxr-xr-x 2 www www 4096 Feb 18 00:20 aliyun-test -rw-r--r-- 1 root root 5869727 Jan 24 04:18 latest.tar.gz drwxr-xr-x 26 www www 4096 Feb 15 23:21 phpwind drwxr-xr-x 5 www www 4096 Jan 25 11:17 wordpress -rw-r--r-- 1 root root 6283476 Jan 25 11:17 wordpress-3.8.1-zh_CN.tar.gz
創(chuàng)建數(shù)據(jù)庫 : 使用 mysql -u用戶名 -p密碼 進入數(shù)據(jù)庫, 使用SQL語句? create database han_wordpress; 創(chuàng)建名為 han_wordpress 的數(shù)據(jù)庫;
[root@ip28 www]# mysql -uroot -p****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 299 Server version: 5.1.63-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> create database han_wordpress; Query OK, 1 row affected (0.00 sec)mysql> exit Bye
設(shè)置網(wǎng)站配置文件 : 配置文件的位置在?/alidata/server/nginx/conf/vhosts 目錄下; [root@ip28 vhosts]# pwd /alidata/server/nginx/conf/vhosts [root@ip28 vhosts]# ls aliyun-test.conf default.conf.bak han-wordpress.conf phpwind.conf
配置文件內(nèi)容 :?
[root@ip28 vhosts]# vim han-wordpress.conf [root@ip28 vhosts]# cat han-wordpress.conf server {listen 8085;server_name localhost;index index.html index.htm index.php;root /alidata/www/wordpress;location ~ .*\.(php|php5)?${#fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 1h;}#αinclude /alidata/server/nginx/conf/rewrite/default.conf;access_log /alidata/log/nginx/access/han-wordpress.log; }
進入網(wǎng)站 : 瀏覽器輸入 115.28.42.124:8085 進入網(wǎng)站;
創(chuàng)建配置文件 :?
開始安裝 :?
安裝完畢登陸網(wǎng)站 : 地址欄輸入115.28.42.124:8085 即可訪問;
四. 安裝emlog博客
下載emlog博客程序 : 進入?/alidata/www/目錄, 網(wǎng)站文件都放在這個目錄中, 使用?wget http://www.emlog.net/em_download/emlog/emlog_5.2.1.zip 命令獲取安裝包;
[root@ip28 www]# wget http://www.emlog.net/em_download/emlog/emlog_5.2.1.zip --2014-02-18 21:08:19-- http://www.emlog.net/em_download/emlog/emlog_5.2.1.zip Resolving www.emlog.net... 42.120.7.43 Connecting to www.emlog.net|42.120.7.43|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 573038 (560K) [application/zip] Saving to: `emlog_5.2.1.zip'100%[========================================================================>] 573,038 124K/s in 4.5s 2014-02-18 21:08:24 (124 KB/s) - `emlog_5.2.1.zip' saved [573038/573038]
解壓安裝包 : 使用命令? unzip emlog_5.2.1.zip 解壓安裝包, 解壓完之后網(wǎng)站文件都解壓到了 emlog 目錄中;
修改目錄權(quán)限 : emlog目錄是在root用戶下解壓的, nginx 的 www用戶和組沒有訪問該目錄的權(quán)限;
-- 設(shè)置權(quán)限 : 使用命令chown -R www:www emlog;
[root@ip28 www]# ll total 12480 drwxr-xr-x 2 www www 4096 Feb 18 00:20 aliyun-test drwxr-xr-x 3 root root 4096 Dec 8 20:15 emlog -rw-r--r-- 1 root root 573038 Dec 8 22:21 emlog_5.2.1.zip -rw-r--r-- 1 root root 5869727 Jan 24 04:18 latest.tar.gz drwxr-xr-x 26 www www 4096 Feb 15 23:21 phpwind drwxr-xr-x 5 www www 4096 Feb 18 15:25 wordpress -rw-r--r-- 1 root root 6283476 Jan 25 11:17 wordpress-3.8.1-zh_CN.tar.gz [root@ip28 www]# chown -R www:www emlog [root@ip28 www]# ll total 12480 drwxr-xr-x 2 www www 4096 Feb 18 00:20 aliyun-test drwxr-xr-x 3 www www 4096 Dec 8 20:15 emlog -rw-r--r-- 1 root root 573038 Dec 8 22:21 emlog_5.2.1.zip -rw-r--r-- 1 root root 5869727 Jan 24 04:18 latest.tar.gz drwxr-xr-x 26 www www 4096 Feb 15 23:21 phpwind drwxr-xr-x 5 www www 4096 Feb 18 15:25 wordpress -rw-r--r-- 1 root root 6283476 Jan 25 11:17 wordpress-3.8.1-zh_CN.tar.gz
創(chuàng)建emlog博客的數(shù)據(jù)庫 : 進入數(shù)據(jù)庫 創(chuàng)建 han_emlog 數(shù)據(jù)庫;
[root@ip28 www]# mysql -uroot -p****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 470 Server version: 5.1.63-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | han_phpwind | | han_wordpress | | mysql | | test | +--------------------+ 5 rows in set (0.00 sec)mysql> create database han_emlog; Query OK, 1 row affected (0.00 sec)mysql> exit Bye [root@ip28 www]#
在?/alidata/server/nginx/conf/vhosts 下創(chuàng)建 han-emlog.conf文件, 內(nèi)容如下 : 主要修改端口號 和 目錄位置 ,日志文件;
-- 端口號 :?listen 8086;
-- 網(wǎng)站文件位置 :?root /alidata/www/emlog/src, 網(wǎng)站文件里面竟然還有一層, 大坑;
-- 日志文件位置 :?access_log ?/alidata/log/nginx/access/han-emlog.log;
server {listen 8086;server_name localhost;index index.html index.htm index.php;root /alidata/www/emlog/src;location ~ .*\.(php|php5)?${#fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 1h;}#αinclude /alidata/server/nginx/conf/rewrite/default.conf;access_log /alidata/log/nginx/access/han-emlog.log; }
輸入配置信息 :?
安裝成功 :?
輸入地址 :?http://115.28.42.124:8086/?依舊沒有域名;
域名備案還沒通過, 這效率太慢了 , 一個月過去了 : 先用 ip地址 + 端口號訪問;
.
作者?:萬境絕塵
轉(zhuǎn)載請注明出處?:?http://blog.csdn.net/shulianghan/article/details/19175147
.
總結(jié)
以上是生活随笔為你收集整理的【网站搭建】搭建独立域名博客 -- 独立域名博客上线了 www.hanshuliang.com的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【面向对象设计模式】 接口型模式 (
- 下一篇: 【Android 应用开发】Androi