标签:ubuntu

浏览模式: 标准 | 列表 | 图文
ZF在ubuntu下的运行

ZF在ubuntu下的运行

ZEND FRAMEWORK要想正常的在ubuntu的AMP平台下运行 ,得打开apache的rewrite模块。这和windows下面把rewrite前的注释去掉可不一样。

进入命令行:a2enmod rewrite

会提示你成功打开rewrite模块

然后:

/etc/init.d/apache2 force-reload

重新加载一下,不过,这样还是不能成功的,因为默认的virtualhost中 有一个参数的值默认为NONE,要改成ALL

运行 :

vim /etc/apache2/sites-enabled/000-default

修改

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
把AllowOverride None 的 None 改为 All

然后

/etc/init.d/apache2 restart

OK,现在运行ZEND的例子,正常了吧,呵呵

笔记:在Ubuntu中设置samba共享可读写文件夹

笔记:在Ubuntu中设置samba共享可读写文件夹

在ubuntu SERVER最初创建的时候就可以选择samba进行安装,如果你没有安装过,那就先运行
apt-get install samba
在网上看到还有资料写需要安装smbfs,不知道有没有什么用。

安装成功后,进入samba目录:/etc/samba
先备份,smb.conf文件
cp smb.conf smb.conf.bak
然后打开smb.conf
找到 ; security = user
把前面的分号注释掉,再加上一行
username map = /etc/samba/smbusers
(这个文件是不存在的,到时候需要单独建立)

还在smb.conf文件里,找到[global]
默认在ubuntu里面workgroup = WORKGROUP,好象说有的版本是 workgroup = MSHOME,如果是这种就改为WORKGROUP吧,毕竟在XP里面工作组都是workgroup
再加上:
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936

再到文件的结束处加上
[www]
comment = '这是该共享的注释'
path = /var/www
public = yes
writable = yes
valid users = www
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
available = yes
browseable = yes

保存退出。
然后打开smbusers文件,加入
www = "netwok username"
保存退出

运行
useradd www
添加一个Www用户
再运行smbpasswd -a www
为www的访问设定一个密码

现在就OK了,使用testparm看一下smb的情况
最后/etc/init.d/samba restart
重启。
OVER
在windows下面就可以访问了。。。

下面是对配置的简单注释
[www] //这是共享时显示的名称
comment = '这是该共享的注释' //注释
path = /var/www //路径
public = yes //是否开放
writable = yes //是否可写
valid users = www //访问的用户
create mask = 0777 //创建权限 (0777为最大权限)
directory mask = 0777 //目录权限
force user = nobody //目标用户
force group = nogroup//目标组
available = yes //是否启用
browseable = yes //是否可浏览

[笔记]在ubuntu下安装amp服务

[笔记]在ubuntu下安装amp服务

目前我还是利用系统自带的apt来进行安装的,所以相对还是比较简单的:
apt-get install apache2.2-common apache2 php5-mysql mysql-server-5.0 mysql-client mysql-common
就可以直接安装了。安装过程中会有提示你设置MYSQL的密码,主要是指ROOT的。

如果是用新立得安装那就更简单了,只要根据你需要的模块进行安装就行了。(以前我都是这样搞的,但是这次是用的SERVER,没法直接用新立得)

顺便说一下,网易的源速度真的不错。
感谢网易在开源方面的贡献。谢谢

使用默认的apt-getp安装的时候,它的配置在/etc/apache2/apache2.conf里,而不是大家所熟知的httpd.conf,而virtualhost的配置是在/etc/apach2/site-enabled/目录里,里面有一个默认的000-default文件,这就是默认的webroot的配置,我们可以很清楚的看到,webroot被定义在/var/www目录下面

由于是使用 apt 进行的安装,所以对于PHP等的扩展,也必须使用 apt才行,否则你会感觉到很迷惘。

[笔记]Ubuntu下修改网卡和DNS

[笔记]Ubuntu下修改网卡和DNS

纯粹是记录吧。在使用 UBUNTU 的时候,如果是ubuntu desktop,那配置起来是相当简单的,就象windows那样配置就行了,但如果是ubuntu server,怎么配置呢?当然是用ifconfig了。
很简单的命令:
ifconfig eth0 192.168.1.2 broadcast 192.168.1.1 netmask 255.255.255.0

  1. eth0是代表第一块网卡,因此,如果你不确认的时候,必须要使用ifconfig查看一下有几块网卡,想配置的是不是eth0
  2. 192.168.1.2是想要配置的IP
  3. broadcast 192.168.1.1 代表了网关
  4. netmask 就是子网掩码了

这样配置完还是不能上网的,因为还没有配置DNS,然后 vi /etc/resolv.conf ,在文件里加入:nameserver 202.96.209.133 ,当然这是上海地区所使用的DNS,有常见的几条,统统加进来就行了。

最后在命令行下执行:/etc/init.d/networking start,对刚才的配置进行重新启动,激活一下网卡配置。
OK,就可以上网了。。

后来我又看了点资料,发现网上还是有详解的:

ifconfig 是一个用来查看、配置、启用或禁用网络接口的工具,这个工具极为常用的。可以用这个工具来临时性的配置网卡的IP地址、掩码、广播地址、网关等。也可以把它写入一个文件中(比如/etc/rc.d/rc.local),这样系统引导后,会读取这个文件,为网卡设置IP地址
1 ifconfig 查看网络接口状态;

ifconfig 如果不接任何参数,就会输出当前网络接口的情况;

[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:C0:9F:94:78:0E
inet addr:192.168.1.88 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2c0:9fff:fe94:780e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:850 errors:0 dropped:0 overruns:0 frame:0
TX packets:628 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:369135 (360.4 KiB) TX bytes:75945 (74.1 KiB)
Interrupt:10 Base address:0x3000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:57 errors:0 dropped:0 overruns:0 frame:0
TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8121 (7.9 KiB) TX bytes:8121 (7.9 KiB)

解说:
eth0 表示第一块网卡, 其中 HWaddr 表示网卡的物理地址,可以看到目前这个网卡的物理地址(MAC地址)是 00:C0:9F:94:78:0E ; inet addr 用来表示网卡的IP地址,此网卡的 IP地址是 192.168.1.88,广播地址, Bcast:192.168.1.255,掩码地址Mask:255.255.255.0

lo 是表示主机的回坏地址,这个一般是用来测试一个网络程序,但又不想让局域网或外网的用户能够查看,只能在此台主机上运行和查看所用的网络接口。比如把 HTTPD服务器的指定到回坏地址,在浏览器输入 127.0.0.1 就能看到你所架WEB网站了。但只是您能看得到,局域网的其它主机或用户无从知道;

如果想知道主机所有网络接口的情况,请用下面的命令;
[root@localhost ~]# ifconfig -a

如果想查看某个端口,比如查看eth0 的状态,就可以用下面的方法;
[root@localhost ~]# ifconfig eth0


2 ifconfig 配置网络接口;

ifconfig 可以用来配置网络接口的IP地址、掩码、网关、物理地址等;值得一说的是用ifconfig 为网卡指定IP地址,这只是用来调试网络用的,并不会更改系统关于网卡的配置文件。如果您想把网络接口的IP地址固定下来,目前有三个方法:一是通过各个发行和版本专用的工具来修改IP地址;二是直接修改网络接口的配置文件;三是修改特定的文件,加入ifconfig 指令来指定网卡的IP地址,比如在redhat或Fedora中,把ifconfig 的语名写入/etc/rc.d/rc.local文件中;

ifconfig 配置网络端口的方法:

ifconfig 工具配置网络接口的方法是通过指令的参数来达到目的的,我们只说最常用的参数;
ifconfig 网络端口 IP地址 hw <HW> MAC地址 netmask 掩码地址 broadcast 广播地址 [up/down]

* 实例一:
比如我们用ifconfig 来调试 eth0网卡的地址
[root@localhost ~]# ifconfig eth0 down
[root@localhost ~]# ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0
[root@localhost ~]# ifconfig eth0 up
[root@localhost ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:11:00:00:11:11
inet addr:192.168.1.99 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:11 Base address:0x3400

注解: 上面的例子我们解说一下;

第一行:ifconfig eth0 down 表示如果eth0是激活的,就把它DOWN掉。此命令等同于 ifdown eth0;
第二行:用ifconfig 来配置 eth0的IP地址、广播地址和网络掩码;
第三行:用ifconfig eth0 up 来激活eth0 ; 此命令等同于 ifup eth0
第四行:用 ifconfig eth0 来查看 eth0的状态;

当然您也可以用直接在指令IP地址、网络掩码、广播地址的同时,激活网卡;要加up参数;比如下面的例子;
[root@localhost ~]# ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0 up

* 实例二:在这个例子中,我们要学会设置网络IP地址的同时,学会设置网卡的物理地址(MAC地址);

比如我们设置网卡eth1的IP地址、网络掩码、广播地址,物理地址并且激活它;
[root@localhost ~]# ifconfig eth1 192.168.1.252 hw ether 00:11:00:00:11:11 netmask 255.255.255.0 broadcast 192.168.1.255 up
或
[root@localhost ~]# ifconfig eth1 hw ether 00:11:00:00:11:22
[root@localhost ~]# ifconfig eth1 192.168.1.252 netmask 255.255.255.0 broadcast 192.168.1.255 up

其中 hw 后面所接的是网络接口类型, ether表示乙太网, 同时也支持 ax25 、ARCnet、netrom等,详情请查看 man ifconfig ;


3.3 如何用ifconfig 来配置虚拟网络接口;

有时我们为了满足不同的需要还需要配置虚拟网络接口,比如我们用不同的IP地址来架运行多个HTTPD服务器,就要用到虚拟地址;这样就省却了同一个IP地址,如果开设两个的HTTPD服务器时,要指定端口号。

虚拟网络接口指的是为一个网络接口指定多个IP地址,虚拟接口是这样的 eth0:0 、 eth0:1、eth0:2 ... .. eth1N。当然您为eth1 指定多个IP地址,也就是 eth1:0、eth1:1、eth1:2 ... ...以此类推;

其实用ifconfig 为一个网卡配置多个IP地址,就用前面我们所说的ifconfig的用法,这个比较简单;看下面的例子;
[root@localhost ~]# ifconfig eth1:0 192.168.1.251 hw ether 00:11:00:00:11:33 netmask 255.255.255.0 broadcast 192.168.1.255 up
或
[root@localhost ~]# ifconfig eth1 hw ether 00:11:00:00:11:33
[root@localhost ~]# ifconfig eth1 192.168.1.251 netmask 255.255.255.0 broadcast 192.168.1.255 up

注意:指定时,要为每个虚拟网卡指定不同的物理地址;

在 Redhat/Fedora 或与Redhat/Fedora类似的系统,您可以把配置网络IP地址、广播地址、掩码地址、物理地址以及激活网络接口同时放在一个句子中,写入/etc/rc.d/rc.local中。比如下面的例子;
ifconfig eth1:0 192.168.1.250 hw ether 00:11:00:00:11:44 netmask 255.255.255.0 broadcast 192.168.1.255 up
ifconfig eth1:1 192.168.1.249 hw ether 00:11:00:00:11:55 netmask 255.255.255.0 broadcast 192.168.1.255 up

解说:上面是为eth1的网络接口,设置了两个虚拟接口;每个接口都有自己的物理地址、IP地址... ...


3.4 如何用ifconfig 来激活和终止网络接口的连接;

激活和终止网络接口的用 ifconfig 命令,后面接网络接口,然后加上 down或up参数,就可以禁止或激活相应的网络接口了。当然也可以用专用工具ifup和ifdown 工具;
[root@localhost ~]# ifconfig eth0 down
[root@localhost ~]# ifconfig eth0 up
[root@localhost ~]# ifup eth0
[root@localhost ~]# ifdown eth0

对于激活其它类型的网络接口也是如此,比如 ppp0,wlan0等;不过只是对指定IP的网卡有效。


注意:对DHCP自动分配的IP,还得由各个发行版自带的网络工具来激活;当然得安装dhcp客户端;这个您我们应该明白;

比如Redhat/Fedora
[root@localhost ~]# /etc/init.d/network start

Slackware 发行版;
[root@localhost ~]# /etc/rc.d/rc.inet1
Linux下的MSN:galaxium

Linux下的MSN:galaxium

好象是说这款MSN软件不错(当然是linux下的),先加入源,顺便说一下,我的源是通过ubuntu tweak来进行更新的,这款tweak软件很方便,只要在第三方源里加入再刷新就行了,以下是需要加入的源的内容:

deb http://ppa.launchpad.net/galaxium/ubuntu hardy main
deb
-src http://ppa.launchpad.net/galaxium/ubuntu hardy main

然后更新一下:apt-get update
最后运行 安装程序 :apt-get install galaxium

然后就可以运行 了,界面也和msn差不多。。。

就是,连接的速度和成功率不如MSN,唉,没办法。。。没有先天优势啊
Wine中文显示

Wine中文显示

突然发现wine的中文显示其实很简单
从1.1.4开始wine的界面就已经支持中文了,但是对于软件中的中文支持并不太好,主要原因。还是字体。。。
Let's go
首先,copy一下字体:把simsun.ttc (即宋体)复制到 ~/.wine/drive_c/windows/fonts
然后:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"Arial"="simsun"
"Arial CE,238"="simsun"
"Arial CYR,204"="simsun"
"Arial Greek,161"="simsun"
"Arial TUR,162"="simsun"
"Courier New"="simsun"
"Courier New CE,238"="simsun"
"Courier New CYR,204"="simsun"
"Courier New Greek,161"="simsun"
"Courier New TUR,162"="simsun"
"FixedSys"="simsun"
"Helv"="simsun"
"Helvetica"="simsun"
"MS Sans Serif"="simsun"
"MS Shell Dlg"="simsun"
"MS Shell Dlg 2"="simsun"
"System"="simsun"
"Tahoma"="simsun"
"Times"="simsun"
"Times New Roman CE,238"="simsun"
"Times New Roman CYR,204"="simsun"
"Times New Roman Greek,161"="simsun"
"Times New Roman TUR,162"="simsun"
"Tms Rmn"="simsun"
当然,你也可以COPY其他字体,然后替换掉这上面的simsun。把这 段内容保存成一个reg文件,例如:fonts.reg
最后,到命令行下支持wine regedit fonts.reg,OK,你现在重新打开记事本,是不是发现可以输入中文了?

如何mount Smb服务共享目录

如何mount Smb服务共享目录

在ubuntu下面默认是不能mount samba共享的目录的,而在公司里,我不得不连接这样的目录,在windows下面的时候,samba共享就象windows的共享目录那样的方便,但是在linux下面就不是这样的了。

首先,你要下载smbmount,运行 :

apt-get install smbfs

然后就会安装smbmount了,我自己Ubuntu系统的loacle设置是:zh_CN.UTF-8,相信大多数使用ubuntu的人都是这样设置的吧,平时使用samba的话,直接输入smb://hostname 就可以了。

然后尝试一下把公司服务器上的路径mount过来。
smbmount //hostname/directory /home/my/mount/dir -o user=username,pass=passpord,iocharset=utf8

在上面的命令里
//hostname/directory 就是公司服务器的samba共享路径,
/home/my/mount/dir 就是本地的挂载目录,

-o 参数是表示后面还有很多参数,参数之间以","(不含引号)隔开
user表示用户名
pass表示密码
iocharset=utf8,可以避免中文乱码

继续解决ZendStudio5菜单中部分是方框的问题

继续解决ZendStudio5菜单中部分是方框的问题

昨天刚刚解决ZS白屏的问题,再次启动的时候,确实是正常了。。。
然而部份菜单却是方框,查了一些资料,发现是中文字体的问题,于是,将Windows下的宋体(simsun.ttc)拷贝过来,改名为: LucidaSansRegular.ttf,覆盖掉:/usr/local/Zend/ZendStudio-5.5.1/jre/lib/fonts 下的同名文件。

即:

unlink /usr/local/Zend/ZendStudio-5.5.1/jre/lib/fonts/LucidaSansRegular.ttf
cp /media/disk/WINDOWS/Fonts/simsun.ttc /usr/local/Zend/ZendStudio-5.5.1/jre/lib/fonts/LucidaSansRegular.ttf
Ubuntu下ZS5.5打开之后是空白屏幕的解决方案

Ubuntu下ZS5.5打开之后是空白屏幕的解决方案

安装了ubuntu之后,立马安装上了zendstudio 5.5 结果出现空白屏幕,以为是不兼容呢。也就没注意。然后安装了一个 ZS for eclipse 6,一切正常。更加肯定了自己的机器与ZS5的不兼容。

可是,我的屏幕只有12。1,在ZS6下面,能够给我写代码的地方太小了。。。。简直无法下手。

于是就想怎么解决5。5的问题。

想不到啊。一直劝别人:内事不决问百度外事不决问google的,象ZS这种进口软件,我居然没有想到问问google。不过,我问了Vampire(政委)同学,他采用了我教别人的方法,然后给了我条答案。

不敢独享。。。

以下内容来自官方网站,地址为:http://www.zend.com/support/knowledgebase.php?kbid=241,不翻译了,也没有什么好翻译的。。。。

Zend Studio starts up with an empty window, or other GUI problems, due to XGL-Compiz/Beryl (with JRE) compatibility issues

Article #241
Product: Zend Studio

Symptoms




When running Zend Studio:
1. The ZS's main window comes up totally empty.
2. Sometimes the window has some of the frames painted, but the rest of the window is empty.
3. In the empty ZS window the mouse cursor is changing while moving around the window (as if there are objects: like buttons and other objects).
4. There were erratic mouse/window movements reported.

Summary




Zend Studio starts up with various windowing GUI problems in some linux distros, while using the XGL-Compiz/Beryl product.

Cause




1. Incompatibility between the XGL environment, the JRE, and the Zend Studio Client.
2. The decoration in the 3D environment clashes with the Java Runtime and distorts the operation and visualization of the Zend Studio client's window.

Workaround




There are two ways to execute Zend Studio, by running the ZDE script, and by running the runStudio_unix.sh script, both are in the bin directory of zend studio
(usually /usr/local/Zend/ZendStudio-/bin)

The following workarounds may be used, but there is no guarantee how well or how long it might work for you in your environment.

  • modification of ZDE script for xgl:


1. Open your ZDE script with your favorite editor
2. add the next line of code at line 1693.
options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"

for example:
1693:
1694: debugOut ""
1695: unset POSIXLY_CORRECT
1696: if [ $DO_NOT_FORK ]

becomes:
1693: options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"
1694: debugOut ""
1695: unset POSIXLY_CORRECT
1696: if [ $DO_NOT_FORK ]

3. Save the file.

  • modification of runStudio_unix.sh script for xgl:


1. open the the file in your favorite editor.
2. modify the java execution line,
the line starts with: ../jre/bin/java -Xms16m -Xmx256m -cp...
change it to: ../jre/bin/java -Dawt.toolkit=sun.awt.motif.MToolkit -Xms16m -Xmx256m -cp...
^^^^^^^^^^^^^^^^^^^^^^^^^^
as you can see, the only difference is an extra parameter to the java program.
3. Save the file.

Another solution




the AWT_TOOLKIT environment variable can be set in order for Java to choose a working AWT Toolkit.

export AWT_TOOLKIT="MToolkit"

In most Linux Distributions it's enough to append this line to /etc/profile.

The information in this article applies to




Zend Studio Client

Common Problems



On some amd64 based systems, the motif toolkit will not work, complaining that "current locale is not supported in X11".

A solution for this case is to set the XLOCALELIBDIR environment variable to the X11 32 bit locale
directory of your system.
Ubuntu Distribution users will find it at: /usr/lib32/X11/locale.

Ubuntu users can use the following as a startup-script:
#!/bin/bash
export AWT_TOOLKIT=MToolkit
export XLOCALELIBDIR=/usr/lib32/X11/locale
exec ZendStudio-5.5.0/Zend_Development_Environment

  • more information can be found:


http://alioth.debian.org/tracker/index.php?func=detail&aid=301730&group_id=30192&atid=410386

Keywords




Zend Studio, ZS, ZDE, IDE, Installation, XGL, Compiz, Beryl, unsupported, blank, empty, window, decoration,xgl

Last Updated: 2008-01-07 09:50:08

简单的添加ssh

简单的添加ssh

为linux添加ssh访问是必然的,否则那就真的成了桌面了。
在网上找了很多资料,实在太多了。而且很多资料都己经过期,例如:http://bbs.net130.com/showthread.php?t=174784,贴子里的地址,是404,无法打开的。
在ubuntu下面,应该是可以通过 新立得软件安装器进行安装 的,但还是没有怎么配置。
于是我在终端下运行 :apt-get install ssh,哇。直接可以安装了。

然后用filezilla打开,嗯,可以访问ssh了。22端口了打开了。呵呵

apt-get确实是一个很好的东西。。不过,这也需要源里面添加了才行。(随便说说。我是新手,不对不要骂我)

安装软件一定要是root权限,你可以先运行su,切换到root下,再运行 。否则会说你没有权限的。