在Linux中用源代码安装是一件很麻烦的事情,但也是对服务最好的安装模式之一,自己可以自定义安装哪些功能和模块。但是功能模块一但多了以后就会忽略某个选项,这样会导至以后服务中的某些功能不完善和运行不稳定,这将会给以后的测试维护带来十分不方便。现在我将写出自己在服务器上搭建的过程,希望对大家有帮助,但如果比我有更好的方法我希望大家指出来,避免以后出现同一问题。
测试环境:CentOS 6.4 MySQL-5.1.51.tar.gz php-5.2.17.tar.gz httpd-2.2.24.tar.gz
1.安装系统Linux --这一步省略
Windows 8和CentOS 6.4(64)双系统硬盘安装教程 http://www.linuxidc.com/Linux/2013-07/87331.htm
2.安装mysql数据库软件 [root@RedHat1 samba]# tar xvf mysql-5.1.51.tar.gz [root@redhat1 samba]# cd mysql-5.1.51 [root@redhat1 mysql-5.1.51]# ./configure --prefix=/usr/local/mysql-5.1 [root@redhat1 mysql-5.1.51]# make && make install
3.测试和调试mysql数据库 [root@redhat1 mysql-5.1.51]# cd /usr/local/mysql-5.1/bin --进入安装mysql目录 [root@redhat1 bin]# ./mysqld_safe & --启动数据库 [root@redhat1 bin]# netstat -an | grep 3306 --检查mysql是否启动 tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN [root@redhat1 bin]# mysql -u root -p --登陆数据库,密码为空
4.安装apache软件 [root@redhat1 mysql-5.1.51]# cd ../ [root@redhat1 samba]# tar -xvf httpd-2.2.24.tar.gz --解包 [root@redhat1 samba]# cd httpd-2.2.24 [root@redhat1 httpd-2.2.24]# ./configure \ --配置apache --prefix=/usr/local/httpd \ --软件安装路径 --enable-proxy \ --代理模块 --enable-http \ --http协议模块 --enable-cache \ --缓存模块 --enable-ssl \ --ssl数字签名模块(可选) --enable-rewrite \ --地址重写模块 --enable-so \ [root@redhat1 httpd-2.2.24]# make && make install --编译,安装
5.测试和调试apache软件 [root@redhat1 httpd-2.2.24]# cd /usr/local/httpd/bin/ [root@redhat1 bin]# ll total 2128 -rwxr-xr-x. 1 root root 68108 Dec 9 16:54 ab -rwxr-xr-x. 1 root root 3422 Dec 9 16:50 apachectl -rwxr-xr-x. 1 root root 6985 Dec 9 16:54 apr-1-config -rwxr-xr-x. 1 root root 6558 Dec 9 16:54 apu-1-config -rwxr-xr-x. 1 root root 22651 Dec 9 16:50 apxs -rwxr-xr-x. 1 root root 9577 Dec 9 16:54 checkgid -rwxr-xr-x. 1 root root 8925 Dec 9 16:50 dbmmanage -rw-r--r--. 1 root root 1069 Dec 9 16:50 envvars -rw-r--r--. 1 root root 1069 Dec 9 16:50 envvars-std -rwxr-xr-x. 1 root root 38699 Dec 9 16:54 htcacheclean -rwxr-xr-x. 1 root root 24645 Dec 9 16:54 htdbm -rwxr-xr-x. 1 root root 18370 Dec 9 16:54 htdigest -rwxr-xr-x. 1 root root 26413 Dec 9 16:54 htpasswd -rwxr-xr-x. 1 root root 1844368 Dec 9 16:54 httpd -rwxr-xr-x. 1 root root 16568 Dec 9 16:54 httxt2dbm -rwxr-xr-x. 1 root root 16815 Dec 9 16:54 logresolve -rwxr-xr-x. 1 root root 20645 Dec 9 16:54 rotatelogs [root@redhat1 bin]# ./httpd --启动apache服务
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有