惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - canbeing

Cocos2d-x游戏引擎实战开发炸弹超人项目教程 全套下载 1至6课 关于Android多项目依赖在Eclipse中无法关联源代码的问题解决 免费将Mac OS X从Snow Leopard升级到Mountain Lion 文档在线预览:文档生成技术细节 文档在线预览:总体思路 开发服务器恢复手记与心得 养成良好习惯 铸造高效管理 计算机管理:电脑定时开关机 [深圳]金蝶软件招聘多名网站架构师、规划师、开发工程师、策划师、设计师 微博平台StatusNet研究(5):支持Jabber/Gtalk 微博平台StatusNet研究(4):快速安装 微博平台StatusNet研究(3):友好URL与OpenID支持 微博平台StatusNet研究(2):基本安装 微博平台StatusNet研究(1):介绍 分享微博平台间的信息同步方法 在线服务器性能状态监控预警软件推荐:监控宝 [已送完]赠送Google Wave 邀请码 偶对《蜗居》人物的观点感想 Linux使用入门与服务器管理交流 PPT
VPS上安装LAMP(Linux+Apache+MySQL+PHP)步骤
canbeing · 2009-12-24 · via 博客园 - canbeing

最近在rashost买了个VPS,128M内存,8G硬盘,CentOS5操作系统,系统初始化后,内存使用情况如下:

                    total       used       free     shared    buffers     cached

Mem:        131232      62872      68360          0      11384      37688

硬盘使用情况如下:

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda1              8256952    626932   7210592   8% /

好可怜的内存,为此,只好尽量少在上面装东西,什么ftp、什么pptp都省得装了。只在上面装了LAMP,分享安装步骤如下。

先安装基本编译程序

yum install gcc

yum install make

下载LAMP需要用到的包

MySQL-client-community-5.1.41-0.rhel5.i386.rpm

MySQL-devel-community-5.1.41-0.rhel5.i386.rpm

MySQL-server-community-5.1.41-0.rhel5.i386.rpm

gd-2.0.35.tar.gz

httpd-2.2.14.tar.gz

libpng-1.2.41.tar.gz

libxml2-2.7.6.tar.gz

php-5.3.1.tar.gz

zlib-1.2.3.tar.gz

由于编译mysql时不大顺利,需要其他包,故没有用源码编译安装,用的是rpm安装安

安装Apache

./configure --prefix=/usr/local/httpd --enable-module=so --enable-rewrite

make

make install

加入启动项,使其随机启动(由于没有安装chkconfig,所以没有用添加服务的方式)

在/etc/rc.d/rc.local中增加启动apache的命令,例如:/usr/local/httpd/bin/apachectl -k start

安装PHP基本支持库

libxml2

zlib

ligpng

gd

基本都是按如下流程编译安装,但注意安装的顺序:

cd source-path

./configure

make

make install

MySQL rpm包安装

rpm -ivh MySQL-server-community-5.1.41-0.rhel5.i386.rpm #服务端

rpm -ivh MySQL-client-community-5.1.41-0.rhel5.i386.rpm #客户端

rpm -ivh MySQL-devel-community-5.1.41-0.rhel5.i386.rpm #PHP编译时需要用到

复制配置文件

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

编译安装PHP5

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-gd=/usr/local  --with-mysql --with-libxml-dir --with-png-dir --with-pear=/usr/local/php/pear --enable-mbstring --with-config-file-path=/usr/local/php/ --disable-debug --enable-safe-mode

make

make install

cp php.ini-production /usr/local/php/php.ini #复制php配置文件到设定的目录

如果不需要支持pear,可以去掉 --with-pear=/usr/local/php/pear 

接下来就可以配置LAMP了,想关配置文件如下

PHP配置文件:/usr/local/php/php.ini

Apache主配置文件:/usr/local/httpd/conf/httpd.conf

MySQL配置文件:/etc/my.cnf

相关启动命令

service mysql start|stop|restart

/usr/local/httpd/bin/apachectl -k start|stop|restart

以上如有不明或遗漏或有更好的方案,请不惜键盘,给我留言,谢谢。

听说LNMP(Linux+Nginx+MySQL+PHP)比较省内存,下次想试试。