首先搭建好LAMP环境
1.设置apache站点,支持php
#vi /etc/httpd/conf/httpd.conf
最后添加:
NameVirtualHost 192.168.21.101:80
<VirtualHost 192.168.21.101:80>
DocumentRoot /var/www/virtual/dotproject //网页根目录
ServerName server.example.com //网站域名
Errorlog logs/server.example.com-error_log //错误日志
CustomLog logs/server.example.com-access_log common //访问日志
VirtualHost>
修改:
Options Indexes -FollowSymLinks //禁用连接功能
DirectoryIndex index.html index.php //设置apache支持php
******************
ubuntu下站点配置
cd /etc/apache2/sites-available
vim test.dotproject.com
里面内容为:
<VirtualHost *:80>
ServerName test.dotproject.com //域名
ServerAlias test.dotproject.com
DocumentRoot /home/dotproject/ //根目录
ErrorLog /var/log/test.dotproject.com_error_log
CustomLog /var/log/test.dotproject.com_access_log combined
#ScriptAlias /cgi-bin/ /home/aixue/cgi-bin/
DirectoryIndex index.php index.html index.htm index.php4 index.php5
<Directory /home/dotproject>
Options -Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All
Directory>
VirtualHost>
加载站点
sudo a2ensite test.dotproject.com
sudo /etc/init.d/apache2 restart
******************
2.
将dotproject放到网页根目录下
#mv dotproject+2_1_2_UTF-8_Chinese_by_GENE dotproject
#mv dotproject /var/www/virtual1/
#restorecon -R /var/www/virtual1
#chmod -R 777 /var/www/virtual/dotproject //修改selinux标签数值
#chkconfig httpd on
#service httpd restart
centos 关闭防火墙:/etc/init.d/iptables stop/status/restart
centos 关闭selinux:/usr/sbin/setenforce 0
3.
启动配置mysql
#setsebool -p allow_user_mysql_connect on 修改selinux 布尔值
#chkconfig mysqld on
#mysqladmin -u root -p redhat 设置root密码为redhat
#mysql -u root -p 登陆mysql
redhat
mysql>create database dotproject ; 创建dotproject数据库
mysql>grant all privileges on dotproject.* to dotproject@localhost identified by ‘123456’; 添加用户
dotproject 密码 123456
mysql>show databases;
4.
数据库配置
#cd /var/www/virtual/dotproject/includes
#cp -a config-dist.php config.php
#vi config.php
修改
$dPconfig['dbuser'] = "dotproject"; // 数据库用户名称
$dPconfig['dbpass'] = "'123456'"; // 上面那个用户的密码
编辑MySQL配置文件,设置字符为UTF-8
[mysqld]
default-character-set=utf8
init_connect='SET NAMES utf8'
[client]
default-character-set=utf8
5.
网页文件权限设置
#chmod -R 777 /var/www/virtual1/dotproject/files
# chmod -R 777 /var/www/virtual1/dotproject/locales
修改/etc/php.ini
#vi /etc/php.ini
修改session.auto_start=1
register_globals = Off,把Off改为On
session.save_path = "/tmp" 去掉前面的分号。
#service httpd restart
6.
网页访问
http://192.168.21.101/install 安装
点击Start Installation按钮进入下一界面,填写配置
点击install db & write cfg按钮
然后登陆
http://192.168.21.101 用户名admin 密码passwd
进入后到
System admin ---Default user perferences 设置语言为中文
dotproject版本2.1.7 中文汉化版
零豆下载:http://down.51cto.com/data/720749
*********************************************************************
1、报错:
Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/dotproject/base.php on line 34
解决:将 date_default_timezone_set(date_default_timezone_get());
修改为:
date_default_timezone_set("PRC")