Fedora Core 10 下配置 Apache2

Category : Linux

由于家里没有Debian的安装盘,所以只好装上FC10来使用linux了.

装上fedora后,就开始配置我的lamp环境了,cd进/etc/apache2后发现,根本没有此目录,可是我的apache2服务器都开启了,怎么可能后不存在该目录呢.于是尝试用cd /etc/httpd来测试,结果还真让我给猜对了.Red hat系列的linux都把apache安装在httpd目录,而debian和ubuntu则是安装在apache2目录,名字稍有不同,进去后,发现配置文件也有很大的不同.

Debian下的目录设计一开始让人觉得有些匪夷所思,但是仔细想想会发现,这样的设置原来更人性化,它将配置文件分为几个目录,比如说,站点和虚拟主机的配置,就有2个目录,一个是sites-enable一个是sites-available,从名字上就可以看出来区别了,第一个是目前使用的,后面的是可以使用的.这里不再对debian的设置做更多的讲解了,本文主要讲Fedora下的配置.

Fedora下的apache2配置文件就一个,为/etc/httpd/conf/httpd.conf,打开此文件,将里面的User apache和Group apache改成自己的用户名,这样做就不用设置任何权限也可以打开自己的页面了(仅限开发用,做服务器的话不要这么改),如果要配置基于端口的虚拟服务器的话,先设置要监听的端口,比如说Listen 88,一个listen一行,然后设置虚拟服务器,配置信息如下:

<VirtualHost *:88>
	ServerAdmin webmaster@dummy-host.example.com
	DocumentRoot /home/kingheaven/phpmyadmin
	<Directory "/home/kingheaven/phpmyadmin">
		Options Indexes FollowSymLinks
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

Tags :  Linux  Fedora 

Published by 2009-01-12 01:00:25 | Views : 311 | Comments : 60


我的Vim设置

Category : Vim

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"
"
" Created by David Shieh
" E-mail : mykingheaven@gmail.com
" blog : kingheaven.alwaysdata.net
"
" created: 2009-02-06 14:03
"
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Get out of VI's compatible mode..
set nocompatible

"Sets how many lines of history VIM har to remember
set history=400

"Enable filetype plugin
filetype plugin on
filetype indent on

"Set to auto read when a file is changed from the outside
set autoread

"Have the mouse enabled all the time:
set mouse=a

"Set mapleader
let mapleader = ","
let g:mapleader = ","

"Fast save and quit
nmap <leader>w :w!<cr>
nmap <leader>q :q!<cr>
nmap <leader>f :find<cr>

source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Enable syntax hl
syntax enable

"Set font to dejaVu 10pt
set guifont=dejaVu\ Sans\ MONO\ 10

"Set the colorscheme
colorscheme desert
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files and backups
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Turn backup off
set nobackup
set nowb
set noswapfile


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Folding
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Enable folding, I find it very useful
set nofen
set fdl=0


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text options
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set expandtab
set shiftwidth=4

au FileType html,python,vim,javascript,php,tpl setl shiftwidth=4
au FileType html,python,vim,javascript,php,tpl setl tabstop=4

set smarttab
set lbr
set tw=500

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Indent
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Auto indent
set ai

"Smart indet
set si

"C-style indeting
set cindent

"Wrap lines
set wrap

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM userinterface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Set 7 lines to the curors - when moving vertical..
set so=7

"Turn on WiLd menu
set wildmenu

"Always show current position
set ruler

"The commandbar is 2 high
set cmdheight=1

"Show line number
set nu

"Do not redraw, when running macros.. lazyredraw
set lz

"Change buffer - without saving
set hid

"Set backspace
set backspace=eol,start,indent

"Bbackspace and cursor keys wrap to
set whichwrap+=<,>,h,l

"Ignore case when searching
set ignorecase
set incsearch

"Set magic on
set magic

"No sound on errors.
set noerrorbells
set novisualbell
set t_vb=

"show matching bracets
set showmatch

"How many tenths of a second to blink
set mat=2
"Highlight search things
set hlsearch

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => file encoding
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set encoding=utf-8
set fileencodings=utf-8

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => NerdTree
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <F10> :NERDTreeToggle<CR>

Tags :  Linux  Vim  Editor 

Published by 2009-01-01 18:57:00 | Views : 309 | Comments : 210


Ubuntu下配置Apache2虚拟主机

Category : Linux

在安装完apache2和php后,我们需要对apache2进行一些配置。
进入/etc/apache2/目录,修改ports.conf,加入要监听的端口。
使用cp /mods-available/rewrite.load /mods-enabled/,开启mod_rewrite模块。
进入/sites-enabled/修改000-default文件,加入虚拟主机信息:

<VirtualHost *:88>
 ServerAdmin webmaster@localhost
 DocumentRoot /home/icefox/phpmyadmin/
 <Directory />
  Options FollowSymLinks
  AllowOverride All
 </Directory>
 <Directory /home/icefox/phpmyadmin/>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all
 </Directory>
 ErrorLog /var/log/apache2/error.log
 LogLevel warn
 CustomLog /var/log/apache2/access.log combined
</VirtualHost>

使用sudo /etc/init.d/apache2 restart重启apache2即可完成设定。

Tags :  Apache2  Ubuntu  Linux 

Published by 2008-12-26 10:37:31 | Views : 329 | Comments : 45