ubuntu安装nginx+uwsgi+django

1、安装python
2、安装django
https://www.djangoproject.com/download/

tar xzvf Django-1.4.3.tar.gz;
cd Django-1.4.3;
sudo python setup.py install;

3、创建djanggo项目

django-admin.py startproject mysite;
tree mysite;
输出
mysite/
├── manage.py
└── mysite
    ├── application.py
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

到此可以直接用manage.py来启动项目了

python manage.py runserver 0.0.0.0:9999;
用地址http://127.0.0.1:9999/访问

4、安装uwsgi

http://projects.unbit.it/uwsgi/wiki/WikiStart#Getit
wget http://projects.unbit.it/downloads/uwsgi-1.4.4.tar.gz
tar -xzvf uwsgi-1.4.4.tar.gz;
cd uwsgi-1.4.4;
python uwsgiconfig.py --build;
python setup.py install;

5、配置nginx

a6a6cbbc6cd30632c1[……]

Read more

发表在 server | 标签为 , , , , | 留下评论

ubuntu安装ruby环境

sudo apt-get install gcc g++ build-essential libssl-dev libreadline-gplv2-dev zlib1g-dev libcurl4-openssl-dev linux-headers-generic libyaml-dev libxslt1-dev libmysqlclient-dev;
sudo apt-get install imagemagick libmagickwand-dev;
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz;
tar -xzf ruby-1.9.3-p327.tar.gz;
cd ruby-1.9.3-p327;
./configure --prefix=/usr/local/ruby;
make && sudo make install;
 
$ sudo vi /etc/environment
将Ruby的路径加入环境变量 中并保存/etc/environment,如下面内容:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
修改了环境变量文件后,需要通过source命令让修改马上生效,命令如下:
$ source /etc/environment
为了检查安装是否成功,可以输入下面的命令进行测试 :
$ruby –v
 
sudo ln -s /usr/local/ruby/bin/ruby /usr/local/bin/ruby;
sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem;

安装Rails

sudo gem install rails -v 3.0.15

安装passenger

sudo apt-get install libgd2-xpm libgd2-xpm-dev libgeoip-dev libpam0g-dev;
 
sudo gem install passenger;
 
passenger-config --root
重新编译nginx 加入passenger module
--add-module=/usr/local/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/nginx;
 
wget http://web.iti.upv.es/~sto/nginx/ngx_http_auth_pam_module-1.2.tar.gz;
tar -zxvf ngx_http_auth_pam_module-1.2.tar.gz;
git clone https://github.com/gnosek/nginx-upstream-fair.git;
git clone https://github.com/agentzh/echo-nginx-module.git nginx-echo;
git clone https://github.com/arut/nginx-dav-ext-module.git;
./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-log-path=/var/log/nginx/access.log \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module \
--with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module \
--with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module \
--with-http_ssl_module --with-http_sub_module --with-http_xslt_module \
--with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl \
--with-mail --with-mail_ssl_module \
--add-module=/opt/build/modules/ngx_http_auth_pam_module-1.2 \
--add-module=/opt/build/modules/nginx-echo \
--add-module=/opt/build/modules/nginx-upstream-fair \
--add-module=/opt/build/modules/nginx-dav-ext-module \
--add-module=/usr/local/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/nginx;
sudo vi /etc/nginx/nginx.conf;
http {
#增加
        passenger_root /usr/local/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.19;
        passenger_ruby /usr/local/ruby/bin/ruby;
 
}
 
sudo vi /etc/nginx/sites-enabled/default;
server {
        listen 8888;
        root /mnt/shared/java/workspace/website/trunk/public;
        server_name test.mydomain.com;
        passenger_enabled on;
        rails_env development;
}

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu安装ruby环境

文[……]

Read more

发表在 server | 标签为 , , , , , , | 留下评论

用VBoxManage命令运行VBox虚拟设备

VBoxManage startvm     <uuid>|<name>     [--type gui|sdl|headless]
VBoxManage controlvm <uuid>|<name>     pause|resume|reset|poweroff|savestate|

原创文章,转载请注明: 转载自海波无痕

本文链接地址: 用VBoxManage命令运行VBox虚拟设备

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server, soft | 标签为 , , , | 留下评论

centos网卡设置

1、vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
BOOTPROTO="static"
IPADDR=192.168.1.101
NETMASK=255.255.255.0
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
ONBOOT=yes
BRAODCAST=192.168.1.255
HWADDR="52:54:00:28:12:e6"
NM_CONTROLLED="yes"
TYPE="Ethernet"
UUID="c4ba1e3e-f970-4460-a7fd-cc9416039187"

2、vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1

3、vi /etc/resolv.conf

nameserver      202.96.134.33
nameserver      8.8.8.8

原创文章,转载请注明: 转载自海波无痕

本文链接地址: centos网卡设置

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 , | 留下评论

ubuntu关闭ACPI

1、修改
sudo vi /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

改成

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ACPI=off"

2、更新
sudo update-grub

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu关闭ACPI

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 , | 留下评论

ubuntu下编译安装sphinx

1、下载
sphinx-2.0.6-release.tar.gz
2、安装

sudo apt-get install build-essential libmysqlclient-dev;
tar -xvf sphinx-2.0.6-release.tar.gz;
cd sphinx-2.0.6-release;
./configure;
make;
sudo make install;

3、创建数据库demo

CREATE DATABASE `indexer`;
USE indexer;
DROP TABLE IF EXISTS documents;
CREATE TABLE documents
(
        id              INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
        group_id        INTEGER NOT NULL,
        group_id2       INTEGER NOT NULL,
        date_added      DATETIME NOT NULL,
        title           VARCHAR(255) NOT NULL,
        content         TEXT NOT NULL
);
 
REPLACE INTO documents ( id, group_id, group_id2, date_added, title, content ) VALUES
        ( 1, 1, 5, NOW(), 'test one', 'this is my test document number one. also checking search within phrases.' ),
        ( 2, 1, 6, NOW(), 'test two', 'this is my test document number two' ),
        ( 3, 2, 7, NOW(), 'another doc', 'this is another group' ),
        ( 4, 2, 8, NOW(), 'doc number four', 'this is to test groups' );

4、创建/usr/local/etc/sphinx.conf

#
# Minimal Sphinx configuration sample (clean, simple, functional)
#
 
source src1
{
	type			= mysql
 
	sql_host		= 192.168.1.88
	sql_user		= root
	sql_pass		= 123456
	sql_db			= indexer
	sql_port		= 3306	# optional, default is 3306
 
	sql_query		= \
		SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
		FROM documents
 
	sql_attr_uint		= group_id
	sql_attr_timestamp	= date_added
 
	sql_query_info		= SELECT * FROM documents WHERE id=$id
}
 
 
index test1
{
	source			= src1
	path			= /var/data/test1
	docinfo			= extern
	charset_type		= sbcs
}
 
 
index testrt
{
	type			= rt
	rt_mem_limit		= 32M
 
	path			= /var/data/testrt
	charset_type		= utf-8
 
	rt_field		= title
	rt_field		= content
	rt_attr_uint		= gid
}
 
 
indexer
{
	mem_limit		= 32M
}
 
 
searchd
{
	listen			= 9312
	listen			= 9306:mysql41
	log			= /var/log/searchd.log
	query_log		= /var/log/query.log
	read_timeout		= 5
	max_children		= 30
	pid_file		= /var/log/searchd.pid
	max_matches		= 1000
	seamless_rotate		= 1
	preopen_indexes		= 1
	unlink_old		= 1
	workers			= threads # for RT to work
	binlog_path		= /var/data
}

6、创建索引

sudo mkdir /var/data;
sudo indexer --all;

7、启动查询服务器

a6a6cbbc6cd30632c19f29a683b9bb17033[……]

Read more

发表在 server | 标签为 , , | 留下评论

ubuntu手工编译mysqlserver

1、下载mysql source
2、安装编译环境和依赖包

sudo apt-get install cmake bison libncurses5-dev libssl-dev;

Centos 5.7 x86_64要安装如下包。

sudo yum install cmake;
sudo yum install bison;
sudo yum install ncurses-devel ;
sudo yum install -y gcc-c++;
yum -y install libtool;

创建用户
adduser mysql

sudo groupadd mysql --system
sudo adduser --system --no-create-home mysql
sudo usermod -a -G mysql mysql

3、编译

cd wangliang@ubuntu:~/Desktop/mysql-5.5.29
make clean;
rm -f CMakeCache.txt;
cmake . \
-DCMAKE_INSTALL_PREFIX=/data/mysql/current \
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \
-DMYSQL_DATADIR=/data/mysql/data \
-DSYSCONFDIR=/data/mysql/current \
-DMYSQL_TCP_PORT=3306 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=complex \
-DWITH_SSL=yes  \
-DWITH_DEBUG=0 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
 
./configure \
--prefix=/data/mysql/mysql-5.1.72/server \
--sysconfdir=/data/mysql/mysql-5.1.72/server \
--localstatedir=/data/mysql/mysql-5.1.72/data \
--with-tcp-port=3306 \
--without-debug \
--without-ndb-debug \
--enable-thread-safe-client \
--enable-assembler \
--enable-profiling \
--with-big-tables \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags="-all-static -ltinfo" \
--with-charset=utf8 \
--with-collation=utf8_general_ci \
--with-extra-charsets=all \
--with-plugins=all \
--with-mysqld-user=mysql \
--without-embedded-server \
--with-unix-socket-path=/tmp/mysqld.sock
 
sudo -u mysql ./mysql_install_db \
--basedir=/data/mysql/current/server \
--datadir=/data/mysql/current/data;

4、安装

a6a6cbbc[……]

Read more

发表在 server | 标签为 , , | 留下评论

Ubuntu12.04更新BCM4313无线网卡驱动

1、查看当前使用情况

lspci -k | grep brcmsmac
	Kernel driver in use: brcmsmac
	Kernel modules: bcma, brcmsmac

2、禁用驱动

echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf;
echo "blacklist bcma" >> /etc/modprobe.d/blacklist.conf;
echo "blacklist brcmsmac" >> /etc/modprobe.d/blacklist.conf;

3、下载驱动
http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_64-v5_100_82_112.tar.gz
4、编译

make clean
make
cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless/wl.ko
depmod;
modprobe wl;

重启

参考资料

a6a6cbbc6cd3063[……]

Read more

发表在 soft | 标签为 , , , | 留下评论

Ubuntu12.04安装TP-LINK TL-WN725N 微型150M无线USB网卡

Ubuntu12.04安装TP-LINK TL-WN725N 微型150M无线USB网卡
1、查看芯片

lsusb
Bus 003 Device 003: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN

2、设置root密码

sudo passwd root

3、执行

echo "blacklist rtl8192cu" | sudo tee /etc/modprobe.d/blacklist-rtl8192cu.conf
echo 8192cu | sudo tee -a /etc/modules

4、安装build环境

sudo apt-get install build-essential;

5、下载RTL8188CUS驱动[……]

Read more

发表在 soft | 标签为 , , , , | 留下评论

ubuntu安装redis

1、下载并安装

wget http://redis.googlecode.com/files/redis-2.6.4.tar.gz
tar -xvf redis-2.6.4.tar.gz
cd redis-2.6.4
make
sudo make install

2、配置启动项

wang@ubuntu:~/redis-2.6.4/utils$ sudo ./install_server.sh

3、安装redis的pythonAPI

sudo easy_install redis;

4、python测试

import redis
 r = redis.StrictRedis(host='localhost', port=6379, db=0)
 r.set('foo', 'bar')
 if(r.exists('foo')):
     print(r.get('foo'))

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu安装redis

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server, soft | 标签为 , | 留下评论
Pages: Prev 1 2 3 4 5 6 7 8 9 10 ... 20 21 22 Next