2022
我们一起努力

搭建lamp服务器(安装LAMP)

本文目录:

  • 1、服务器为什么要搭建lamp环境
  • 2、如何在阿里云ubuntu上搭建服务器lamp
  • 3、如何在windows上搭建LAMP环境

服务器为什么要搭建lamp环境

l是Linux操作系统,a是apache可以处理web请求,m是mysql是数据库服务,p是php是web开发语言。这4个组合是最常见的稳定而开发效率高的web服务器搭建方案。当然,根据需要还可能有其他组合,比如改用windows系统可以有wamp,改用nginx代替apache可以有lnmp等,但lamp是最经典的。望采纳。

如何在阿里云ubuntu上搭建服务器lamp

对于Ubuntu系统来说,提供了“新立得软件包管理器”工具,对于初学者来说可以不用通过键入命令来进行软件安装。在系统菜单上依次选择——系统——系统管理,会在系统管理中找到“新立得软件包管理器”一项。

寻找“新立得软件包管理器”选项

在新立得软件包管理器中选择——编辑——使用任务分组标记软件包,在打开的窗口中 勾选 LAMP SERVER然后确定。

安装LAMP

如何在windows上搭建LAMP环境

++++++++++++++++++++++++++++++++++++++++++++++

Windows下LAMP环境搭建

++++++++++++++++++++++++++++++++++++++++++++++

操作系统: [windows xp professional sp3]

服务器 : [apache-2.2.8]

PHP: [php-5.2.17]

数据库 : [mysql-5.1.49]

数据库管理工具 : [phpmyadmin-3.3]

++++++++++++++++++++++++++++++++++++++++++++++

准备安装软件(download)

1 [apache_2.2.8-win32-x86-openssl-0.9.8g]

2 [php-5.2.17-Win32-VC6-x86]

3 [mysql-5.1.49]

(需注册)

4 [phpMyAdmin-3.3.9-all-languages]

++++++++++++++++++++++++++++++++++++++++++++++

开始安装(安装前建立目录[D:/lamp])

D:/lamp

–apache2.2

–php

–mysql

–sites

—————————————————————————-

1 【apache】

—————————————————————————-

1.1 Welcome to the Installation Wizard for Apache HTTP Server 2.2.8

#单击[Next]

1.2 License Agreement

#选择(I accept the terms in the license agreement)-单击[Next]

1.3 Read This First

#单击[Next]

1.4 Server Information

Network Domain(e.g.somenet.com): [helloworld.com]

Server Name(e.g.): []

Administrator’s Email Address(e.g.webmaster@somenet.com): [helloworld@helloworld.com]

#选择(for All Users, on Port 80, as a Service — Recommended.), 单击[Next]

1.5 Setup Type

#选择(Custom), 单击[Next]

1.5 Custom Setup

单击[Change…],

1.5.1 Change Current Destination Folder

Folder name: [D:/lamp/apache2.2/], 单击[OK],

#单击[Next]

1.6 Ready to Install the Program

#单击[Install]

1.7 Installaction Wizard Completed

#单击[Finish]

—————————————————————————-

2 【php】

2.1 将php-5.2.17-Win32-VC6-x86.zip解压到[D:/lamp/php]

—————————————————————————-

3 【mysql】

3.1 Welcome o the Setup Wizard for MySQL Server 5.1

#单击[Next]

3.2 Setup Type

#选择Custom, 单击[Next]

3.3 Custom Setup

3.3.1 单击[Change…],

3.3.2 Change Current Destination Folder

Folder name: [D:/lamp/mysql/]

单击[OK]

#单击[Next]

3.4 Ready to Install the Program

#单击[Install]

3.5 A MySQL Enterprise subscription is the most…

#单击[Next]

3.6 The MySQL Enterprise Monitor Service

#单击[Next]

3.7 Wizard Completed

#勾选[Configure the MySQL Server now]

#单击[Finish]

3.8 Welcome to the MySQL Service Instance Configuration Wizard 1.0.17.0

#单击[Next]

3.9 MySQL服务器实例配置[MySQL Server Instance Configuration]

Detailed Configuration-详细配置

Standard Configuration-标准配置

#选择默认[Detailed Configuration]

#单击[Next]

3.9.1 服务器类型[Please select a server type. This will influence memory, disk and CPU usage.]

[Developer Machine]-开发服务器, 占用内存较少

[Server Machine]-多个服务器共用, 占用内存中等

[Dedicated MySQL Server Machine]-专用服务器, 占用内存较多

#选择默认[Developer Machine]

#单击[Next]

3.9.2 数据库用途[Please select the database usage]

[Multifunctional Database]-多功能数据库,优化InnoDB,MyISAM

[Transactional Database Only]-事务数据库,优化InnoDB,MyISAM也可用

[Non-Transactional database Only]-非事务性数据库,适用于简单的网络监控或记录的应用发有分析仅非事务的MyISAM引擎

#选择默认[Multifunctional Database]

#单击[Next]

3.9.3 InnoDB的数据文件的存放位置[Please select the driver for the InnoDB datafile, if you do not want to use the default settings]s

#选择默认

#单击[Next]

3.9.4 设置并发连接到服务器的大致数量[Please set the approximate number of concurrent connections to the server]

[Decision Support(DSS)/OLAP]-并发数20

[Online Transaction Processing(OLTP)]-并发数500

[Manual Setting]-并发数自定义

#选择[Manual Setting], Concurrent connections[100]

#单击[Next]

3.9.5 [网络选项]Please set the networking options

[Enable TCP/IP Networking]-启用TCP/IP网络

[PortNumber:[3306]]-端口

[Add firewall exception for this port]-添加到防火墙例外

[Enable Strict Mode]-启用严格模式

#选择默认[Next]

3.9.6 [选择字符集]Please select the default character set.

[Standard Character set]-默认Latine 适用于英文或其它西欧语言

[Best Support For Multilingualism]-支持多种语言

[Manual Selected Default Character Set/Collation]-自定义

#选择[Best Support For Multilinguatilsm]

#单击[Next]

3.9.7 设置Windows选项[Please set the Windows options]

[Install As Windows Service[安装为windows服务]

[Launch the MySQL Server automatically[自启动]

[Include Bin Directory in Windows PATH[加入环境变量]

#选择默认

#单击[Next]

3.9.8 设置安全选项[Please set the security options]

[Current root password]-旧密码,留空

[New root password]-新密码,

[Confirm]-确认新密码

[Enable root access from remote machines]-启用root帐号远程访问

[Create An Anonymous Account]-创建匿名帐号

#输入密码和确认密码, 其它默认

#单击[Next]

3.9.9 准备执行[Ready to execute…]

#单击[Execute]

3.9.10 Processing configureation…

#单击[Finish]

—————————————————————————-

4 【phpMyAdmin】

4.1 将phpMyAdmin-3.3.9-all-languages.zip解压到[D:/lamp/sites/phpmyadmin/]

—————————————————————————-

++++++++++++++++++++++++++++++++++++++++++++++

【apache配置】

5.1 httpd.conf(D:/lamp/apache2.2/conf)

5.1.1 #功能: 加载php模块

#说明: 搜索LoadModule, 在其后面添加

LoadModule php5_module “D:/lamp/php/php5apache2_2.dll”

5.1.2 #功能: 设置工作目录

#说明: 搜索DocumentRoot, 修改为

DocumentRoot “D:/lamp/sites”

5.1.3 #功能: 设置目录选项

#说明: 搜索Directory “D:/lamp/apache2.2/htdocs”, 修改为

Directory “D:/lamp/sites”

5.1.4 #功能: 设置默认文档

#说明: 搜索Directory /, 添加

DirectoryIndex index.php index.html

5.1.5 #功能: 增加php类型

#说明: 在文件末尾加入

AddType application/x-httpd-php .html .php

#功能: php.ini所在目录

#说明: 在文件末尾加入

PHPIniDir “D:/lamp/php”

功能: 不允许访问目录

说明: 搜索Options Indexes FollowSymLinks项,并注释

#Options Indexes FollowSymLinks

5.2 注意: 修改配置文件后, 重启apache才能生效

5.3 在D:/lamp/sites/建立文件

#phpinfo.php

输入内容:

?php

phpinfo();

?

访问:

【php配置】

6.1 php.ini

6.1.1 D:/lamp/php/php.ini, 复制php.ini-recommended并重命名为php.ini

6.1.2 #功能: 指定扩展库所在目录

extension_dir = “D:/lamp/php/ext/”

#功能: 开启扩展

#说明: 根据需要开启相应扩展模块, 去掉前面的分号

extension=php_gd2.dll

extension=php_mbstring.dll

extension=php_mcrypt.dll

extension=php_mysql.dll

extension=php_mysqli.dll

#功能: 设置时区

#说明: PRC表示中国

date.timezone = PRC

#功能: 显示错误信息

display_errors = On

6.2 复制libmysql.dll, libmcrypt.dll(D:/lamp/php)到C:/WINDOWS/system32/

6.3 重启apache,访问,查看相应扩展是否加载成功

++++++++++++++++++++++++++++++++++++++++++++++

搭建lamp服务器】的内容来源于互联网,如引用不当,请联系我们修改。

赞(0)
文章名称:《搭建lamp服务器(安装LAMP)》
文章链接:https://www.fzvps.com/38631.html
本站文章来源于互联网,如有侵权,请联系管理删除,本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
图片版权归属各自创作者所有,图片水印出于防止被无耻之徒盗取劳动成果的目的。

评论 抢沙发

评论前必须登录!