快速业务通道

LAMP建站步骤

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-06

说明我这是在redhat9中安装的,
第一步先安装mysql ,到官网下载就可以了,这里我选择的是mysql-5.1.56版本的软件包,
解压
# tar vxzf mysql-5.1.56.tar.gz
进入目录
cd mysql-5.1.56
编译

]# ./configure --sysconfdir=/etc 注意没有空格的
]#make

make 的时间也是比较长,要等等.

好了, 下面进行安装
]#make install

安装完了之后,我们拷贝一个配置文件,当作以后mysql的配置文件
]# cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
# useradd -d /usr/local/var mysql
# su - mysql
$ /usr/local/bin/mysql_install_db
启动
[mysql@localhost var]$ /usr/local/bin/mysqld_safe &
测试
] netstat -tnl 查看端口, 看到 3306 就是mysql 的默认端口,显示3306端口表示成功启动

mysql
第二步安装apache 系统中原来已经安装了一个httpd服务器,咱先不管他,自己下载个编译软

件包就行
解压
]# tar xvzf httpd-2.2.8.tar.gz
进入 httpd-2.2.8 目录
]# cd httpd-2.2.8
httpd-2.2.8]# ./configure --sysconfdir=/etc --enable-ssl --enable-modules
下面进行编译
httpd-2.2.8]# make
安装
httpd-2.2.8]# make install
这样 apache 2.2.8 就安装完成了,
启动服务
]# /usr/local/apache2/bin/apachectl start &
测试访问 查看一下端口
]# netstat -tnl
看是否开启 80 端口了,说明apache 正常启动了
我们在 window 上访问一下.Linux 上的 ip 地址是 192.168.0.19
看 显示页面 It works! 成功访问了
默认首页目录 /usr/local/apache2/htdocs/index.html通过SSL(安全套接字层)来保证安全性的

随着 Linux 启动时候 自动启动 apache

Empire CMS,phome.net

]# echo "/usr/local/apache2/bin/apachectl start &" >> /etc/rc.local
下面重启一下,看看apache是否自动启动

重启 Linux 命令: shutdown -r now

而关闭Linux :shutdown -h now

好了,我们登陆进去看看
显示 80 端口自动打开,说明apache 自动运行成功.
在window 访问一下, 成功访问
如果想架设一个比较安全的服务器,则通过SSL(安全套接字层)来保证安全性是个不错的选择
现在来 下载ssl和使用
下载地址 http://www.openssl.org/contrib/ssl.ca-0.1.tar.gz
解压缩
#tar xvzf ssl.ca-0.1.tar.gz
进入目录
#cd ssl.ca-0.1
开始生成证书
[root@localhost ssl.ca-0.1]# ./new-root-ca.sh (生成根证书)
Enter pass phrase for ca.key:1234 (输入一个密码,最少4位)
Verifying - Enter pass phrase for ca.key:1234 (再输入一次密码,跟刚才的一样)
Self-sign the root CA...(签署根证书)
Enter pass phrase for ca.key:1234(输入刚刚设置的密码)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ''.'', the field will be left blank.
-----(下面开始签署)
Country Name (2 letter code) [MY]:CN
State or Province Name (full name) [Perak]:China
Locality Name (eg, city) [Sitiawan]:ShanDong
Organization Name (eg, company) [My Directory Sdn Bhd]:sye.com
Organizational Unit Name (eg, section) [Certification Services Division]:sye
Common Name (eg, MD Root CA) []:NO1
Email Address []:sye@mail.com
这样就生成了ca.key和ca.crt两个文件,

Empire CMS,phome.net

[root@local

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号