2. 配置 nginx 服务器配置文件
配置nginx 服务器 : 进入 *nginx/conf/vhosts/ 创建一个 .conf 后缀文件, 这个就是配置文件;
server { listen 80; server_name www.fitness.hanshuliang.com; index index.html index.htm index.php; root /alidata/www/fitness-emlog/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/fitness-emlog.log; }
3. 创建数据库
创建数据库命令 :
-- 进入数据库 : mysql -uroot -p******** , -u 后跟着用户名, -p 后跟着密码;
-- 查看数据库命令 : show databases;
-- 创建数据库命令 : create database fitness_emlog;
[root@ip28 vhosts]# mysql -uroot -p******** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 642218 Server version: 5.1.63-log Source distribution Copyright (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_emlog | | han_phpwind | | han_wordpress | | mysql | | test | | weixin_tiger | | xia_emlog | +--------------------+ 9 rows in set (0.00 sec) mysql> mysql> create database fitness_emlog; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | emlog_test | | fitness_emlog | | han_emlog | | han_phpwind | | han_wordpress | | mysql | | test | | weixin_tiger | | xia_emlog | +--------------------+ 10 rows in set (0.00 sec) mysql> quit Bye
4. 设置网站
设置网站流程 :
-- 创建成功 :
-- 进入网站 : 网址 http://fitness.hanshuliang.com ;