如何在linux搭建web服务器

如何在linux搭建web服务器,第1张

web服务器常见的是apache和nginx。apache嫌麻烦就直接用软件管理工具(centos跟小红帽用yum,ubuntu用apt-get)安装,也可以到官网下载>建议你用linuxeye的脚本~或者省内存的话用llsmp,我阿里云的服务器装好了才用23M内存~首先用root账号登陆,然后输入这些命令
lnmp:
yum -y install wget screen wget >1开始说明
本教程中使用的IP地址是1921680100,主机名称为Server1examplecom 这些设置可能会有所不同,你需要根据不同情况进行修改。
CentOS 62下安装MySQL
2开始安装MySQL5
首先我们应该先用下面的命令安装MySQL:
yum install mysql mysql-server
然后我们需要创建MySQL系统的启动键链接启动MySQL服务器,这样以便于MySQL在系统启动时自动启动
chkconfig --levels 235 mysqld on
/etc/initd/mysqld start
为MySQL root帐户设置密码:
mysql_secure_installation
会出现下面的一系列提示:
root@server1 ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here
Enter current password for root (enter for none):
OK, successfully used password, moving on
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation
Set root password [Y/n] <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables
Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them This is intended only for testing, and to make the installation
go a bit smoother You should remove them before moving into a
production environment
Remove anonymous users [Y/n] <-- ENTER
Success!
Normally, root should only be allowed to connect from 'localhost' This
ensures that someone cannot guess at the root password from the network
Disallow root login remotely [Y/n] <-- ENTER
Success!
By default, MySQL comes with a database named 'test' that anyone can
access This is also intended only for testing, and should be removed
before moving into a production environment
Remove test database and access to it [Y/n] <-- ENTER
- Dropping test database
Success!
- Removing privileges on test database
Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately
Reload privilege tables now [Y/n] <-- ENTER
Success!
Cleaning up
All done! If you've completed all of the above steps, your MySQL
installation should now be secure
Thanks for using MySQL!
[root@server1 ~]#
CentOS 62下安装Apache
3安装阿帕奇2
Apache2的是作为一个CentOS的软件包,因此我们可以直接用下面命令安装它:
yum install >

如果有安装web服务那么肯定会开启80端口

所以优先查看服务器是否在监听80端口    netstat -an|grep :80

也可以直接访问ip地址;

举个例子:Apache web服务是否安装的几个检查命令

ps aux |grep >

netstat -an|grep :80

rpm -qa |grep >

 LINUX系统中常见的有:CERN、NCSA、Apache三种方式,一般最常用的方法就是用Apache。此种方式特点明显,配置简明,具有最大的对系统兼容性,以下是用此方式配置基于Linux的WEB服务器的全过程。

一. Apache服务器慨述。

其特征是显著的:可以运行于所有计算机平台,自然包括UNIX/LINUX系统;集成代理服务器和Perl编程脚本;对用户的访问会话过程跟踪;可对服务器日志定制;还支持虚拟主机及>可以用Apache,也可以用nginx,Apache直接yum安装,启动>Linux 看你是什么发行版本 以下是3个常见的 安装shell
联网状态下 root 用户下 执行就行了 很简单
Debian
wget -O installsh >

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/12742963.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-27
下一篇 2023-05-27

发表评论

登录后才能评论

评论列表(0条)

保存