linux环境下搭建个人微博
时间:2010-09-26 来源:wiliiwin
近来微博很受大家的追捧,俺偶然发现了一个开源的微博网站,于是就有了本片文章.
简介: 就目前国外的开源微博(php+mysql),做的比较好的也就两个: 1. http://sharetronix.com/sharetronix/ Sharetronix是一个可以发视频,音乐,文字的多媒体微博客平台,新版本1.5.0提供包括中文在内20多种语言支持, 有一般微博应具备的所有功能,更新速度较快. 2. http://status.net/ StatusNet是个相当老牌的开源微博程序,国内的http://swisen.com/(随心微博)网站都是基于它架设的,但是版本更新速度较慢. 由于sharetroix更加的完善,所以我这里用的是sharetronix. 测试环境: vmwa 6.1 软件包列表: curl-7.21.1.tar.gz httpd-2.2.6.tar.gz mysql-5.1.22-rc-linux-i686-icc-glibc23.tar.gz php-5.2.14.tar.gz sharetronix-1.5.1ver.zip 安装mysql tar -zxvf mysql-5.1.22-rc-linux-i686-icc-glibc23.tar.gz cp -a ./mysql-5.1.22-rc-linux-i686-icc-glibc23 /usr/local/mysql
groupadd mysql
useradd -g mysql mysql
cd /usr/local chown -R mysql:mysql mysql cd mysql
scripts/mysql_install_db --user=mysql
chown -R mysql .
chown -R mysql data
chgrp -R mysql . cp support-files/my-medium.cnf /etc/my.cnf vi /etc/my.cnf 在[mysqld]部分下添加: datadir = /var/lib/mysql cp support-files/mysql.server /etc/init.d/mysql chmod 755 /etc/init.d/mysql chkconfig --add mysql chkconfig --level 35 mysql on service mysql start /usr/local/mysql/bin/mysqladmin -u root password ‘weibo’ /usr/local/mysql/bin/mysql -root -pweibo mysql> create database blog; mysql> GRANT ALL PRIVILEGES ON blog.* TO blog@'localhost' IDENTIFIED BY 'blog' WITH GRANT OPTION; apache安装 tar -zxvf httpd-2.2.6.tar.gz cd httpd-2.2.6 ./configure --prefix=/usr/local/apache2\ --enable-mods-shared=all \ --enable-rewrite\ --enable-so make && make install cp support/apachectl /etc/init.d/httpd vi /etc/init.d/httpd 加入一下的代码,是apache可以用chkconfig方式启动: # Startup script for the Apache Web Server # chkconfig: - 85 15 # description: Apache is a World Wide Web server. It is used to serve # HTML files and CGI. # processname: httpd # pidfile: /usr/local/apache2/log/httpd.pid # config: /usr/local/apache2/conf/httpd.conf chmod 755 /etc/init.d/httpd chkconfig --add httpd chkconfig --level 3 httpd on mkdir -p /var/log/httpd/access_log service httpd start 安装curl tar zxvf curl-7.21.1.tar.gz cd curl-7.21.1 ./configure -- prefix=/usr/local/curl make&&make install 安装php tar -jxvf php-5.2.4.tar.bz2 cd php-5.2.4 ./configure \ --prefix=/usr/local/php \ --with-mysql=/usr/local/mysql \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf \ --with-zlib-dir=/usr/lib --with-png-dir=/usr/lib \ --with-freetype-dir=/usr/include/freetype2 --with-ttf \ --enable-sockets --enable-ftp --enable-mbstring --with-curl=/usr/local/curl make && make install cp php.ini-dist /usr/local/php/lib/php.ini
vi /usr/local/apache2/conf/httpd.conf 加入一下代码,添加apache支持php和web的默认文档: AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps
###############for php and cacti###################
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico
DirectoryIndex index.php index.html index.html.var
#######################over########################
service httpd start 可在/usr/local/apache2/htdocs目录新增test.php <?php phpinfo(); ?>
相关阅读 更多 +
排行榜 更多 +