Linux中安装Apache2手记
参考文档:http://lamp.linux.gov.cn/Apache/ApacheMenu/
Ø 下载Apache2.2.4 的压缩包,文件名为:Apache21.tar.gz ;
Ø 在 /usr/local 目录下解压此压缩文件:
[root@wxr local]# tar xzvf Apache21.tar.gz
之后生成一个名为“httpd-2.2.4 ”的文件夹;
Ø apr 和apr-util 包含在Apache httpd 的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果apr 或apr-util 的1.0 或1.1 版本已经安装在你的系统中了,则必须将你的apr/apr-util 升级到1.2 版本,或者将httpd 单独分开编译。要使用发行源代码中自带的apr/apr-util 源代码进行安装,你必须手动完成:
# 编译和安装 apr
cd /usr/local/httpd-2.2.4/srclib/apr
./configure --prefix=/usr/local/apr-httpd/
make
make install
# 编译和安装 apr-util
cd /usr/local/httpd-2.2.4/srclib/apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install
# 配置和安装 httpd
cd /usr/local/httpd-2.2.4
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/
make
make install
之后会在local 目录下生成一个”apache2” 的文件目录,即安装的apache 目录。
Ø 启动apache :
cd /usr/local/apache2/bin
[root@wxr bin]# ./apachectl start
Ø 查看测试页:
在其他机器上如果能ping 通安装了apache 的服务器地址,就应该能访问apache 的测试页了,如在ie 中直接访问:http://192.168.2.254
另外,apache 安装后的默认端口号是80 ,如果此端口号被占用了也不会访问到测试页,此时需要手动改一下端口号:
cd /usr/local/apache2/conf
[root@wxr conf]# vi httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration
相关文档:
qt默认的编程语言为C++语言。如果你用qt编译.c文件,会出现找不到C语言的默认头文件等错误(如:stdio.h等)。qt中不支持
extern "C"{}的这种写法,我前几天有一个C程序需要移植到Qt的工程中,本希望直接extern "C"就ok了,但发现qt4居然不支持这种写法。我的程序中用到了好几个linux系统头文件,是向串口发指令之类的程序 ......
1.变更用户: su root 或 su - 注意(若只用su,则只换用户,不换shell)。
2.创建文件夹: mkdir -m777 tool 创建too并设置权限 mkdir -p tool2/tool3 连级创建文件夹。
3.删除文件或文件夹: rm -r tool2 递归删除,连同子目录一起删除。 rm -fr 不用提示,直接强制递归删除。
4.移动目录: mv -iv ......
根据工作环境的需求,需要掌握Linux/Unix环境下进行软件安装维护以及相关配置等技能。这里将我的使用心得记录下来跟大家分享一下。以安装数据库为例进行讲解(注:以上安装均以源代码方式进行安装)。以下使用的Linux系统是安装在虚拟机上的,并且linux系统是linux enterprise 5。
&nb ......
一、 Shell命令
1. man vi
2. echo $PATH
3. cat显示文件内容
1 cat 文件名一文件名二
2 more文件名
3 less文件名 向前翻按b键;向后翻按p键;指定位置输入百分比;退出 ......