当前位置:首页 » 网页前端 » linuxweb服务启动
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

linuxweb服务启动

发布时间: 2022-08-06 09:35:26

⑴ 求在linux 7 64位里搭建web服务器的详细图文步骤

1、查看服务器ip地址

⑵ Linux 如何开启web服务器redhat

1,基于apache的web服务器基础搭建:
(1)实验环境:一台ip为192.168.10.10的rhel5.9主机作为web服务器,一台ip为192.168.10.15的win7主机作为测试机
(2)查看服务主机软件是否安装
[root@ser1 ~]# rpm -q httpd httpd-manual httpd-devel
package httpd is not installed
package httpd-manual is not installed
package httpd-devel is not installed
(3)安装软件包
[root@ser1 ~]# yum install -y httpd httpd-manual httpd-devel
(4)启动服务
[root@ser1 ~]# service httpd start
启动httpd: [确定]
[root@ser1 ~]# chkconfig httpd on
(5)在win7上测试,无网页缺省下显示红帽测试页
<报错页面存放位置/var/www/error/noindex.html>
.jpg
(6)打开配置文件
[root@ser1 ~]# vim /etc/httpd/conf/httpd.conf
可获得以下重要字段:
目录设置:
<Directory 目录> .. .. </Directory>
访问位置设置:
<LocationURL> .. .. </Location>
虚拟主机设置:
<VirtualHost 监听地址> .. .. </VirtualHost>
常用的全局设置参数:
ServerName本站点的FQDN名称
DocumentRoot网页文档的根目录:缺省/var/www/html/
DirectoryIndex默认索引页/首页文件:一般设为index.html index.php
ErrorLog错误日志文件的位置
CustomLog 访问日志文件的位置
Listen 监听服务的IP地址、端口号
ServerRoot 服务目录:/etc/httpd/
Timeout网络连接超时,默认 300 秒
KeepAlive是否保持连接,可选On或Off
MaxKeepAliveRequests每次连接最多处理的请求数
KeepAliveTimeout保持连接的超时时限
Include 可包含其他子配置文件: /etc/httpd/conf.d/
(7)创建测试网页
[root@ser1 ~]# vim /var/www/html/index.html
<h1>
This is a test page !!!
</h1>
~
(8)win7下测试,主页变为测试网页
.jpg
2,基于apache的web服务器的访问控制:
(1)web服务的地址限制
I,rder 配置项,定义控制顺序
allow,deny 先允许后拒绝,缺省拒绝所有;冲突时,拒绝生效;allow不设置,拒绝所有
deny,allow 先拒绝后允许,缺省允许所有;冲突时,允许生效;deny不设置,允许所有
II,Allow/Deny from 配置项,设置权限
Allow from 地址1 地址2 .. ..
Deny from 地址1 地址2 .. ..
配置如下:
[root@ser1 ~]# vim /etc/httpd/conf/httpd.conf
331 #
332 Orderallow,deny
333 Allowfrom 192.168.20.0/24
334
335 </Directory>
[root@ser1 ~]# service httpd restart……重启服务
停止httpd: [确定]
启动httpd: [确定]
在win7上测试,测试完成并还原配置文件:
.jpg

⑶ linux 重启web服务器失败

查看服务器环境是否冲突,环境是否存在失效错误配置,具体查看重启WEB错误日志。

⑷ 如何查看linux服务器是否启动

1、ps
aux
或netstat
-tlunp
ps是进程查看命令,netstat是端口查看命令,在Linux系统中,服务一定是有进程的,所以使用ps命令可以查看服务运行情况,另外,Linux服务多数是网络服务,所以通过netstat命令也可以查看服务运行状态。
2、service
服务名
status
比如查看httpd的Web服务的运行状态,执行service
httpd
status,如下图所示:
3、/sbin/service
--status-all
|grep
"服务名"
比如查看httpd的web服务,执行
/sbin/service
--status-all
|grep
"httpd"即可。如下图所示。
4、chkconfig
--list
比如查看httpd的web服务,执行
chkconfig
--list
|grep
"httpd"即可。如下图所示。

⑸ 如何在linux下判断web服务是否开启

第一步,输入命令:netstat -tlnp
命令解释:列出系统里面监听网络的TCP连接和相应的进程PID。
参数说明:
-t:表示列出TCP连接
-l:表示列出正在网络监听的服务
-n:表示以端口号来显示
-p:表示列出进程PID
第二步,看看Local Address这一列下面有没有端口号是80的那一行,如果有的话说明Web服务是开启的。如果想找特定的Web服务程序(比如Apache),还可以看看Program name这一列下面有没有这个Web程序,如果有也可以断定Web服务是开启的。

⑹ Linux 启动、关闭、重启网络服务的两种方式

Linux 启动、关闭、重启网络服务的两种方式:

1、使用service脚本来调度网络服务,如:

启动 service network start;

关闭 service network stop;

重启 service network restart;

2、直接执行网络服务的管理脚本,如:

启动/etc/init.d/network start;

关闭 /etc/init.d/network stop;

重启 /etc/init.d/network restart。


(6)linuxweb服务启动扩展阅读

linux其他服务相关命令介绍:

1、linux显示所有服务的运行状态命令

service --status-all

chkconfig --list

2、linux查看单个服务的运行状态命令

service iptables status

3、linux查看服务启动状态,是否开机自动启动命令

chkconfig --list servicename

⑺ 如何在linux搭建完整的web服务器

可以参考如下Web服务器的建立过程。示例环境及web服务器软件:

Ubuntu 12.04
LAMP(Linux,Apache,Mysql,PHP)

1、安装Apache

(1)在安装HTTP Server之前需安装APR(Apache Portable Runtime)和APR-util安装APR
$ tar zxvf apr-1.4.6.tar.gz
$ cd apr-1.4.6/
$ ./configure
$ make
$ sudo make install

(2)安装APR-util

$ tar zxvf apr-util-1.4.1.tar.gz
$ cd apr-util-1.4.1
$ ./configure –with-apr=/usr/local/apr (whereis apr)
$ make
$ sudo make install

(3)安装httpd-2.4.2.tar.bz2默认安装位置/usr/local/apache2网页放在/usr/local/apache2/htdocs配置文件/usr/local/apache2/conf/httpd.conf

$ tar jxvf httpd-2.4.2.tar.bz2
$ cd httpd-2.4.2/
$ ./configure
$ make
$ sudo make install

(4)启动HTTP Server$ sudo /usr/local/apache2/bin/apachectl startAH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

(5)查看http是否正常运行$ netstat -a | grep httptcp 0 0 *:http *:* LISTEN

(6)在浏览器输入127.0.0.1如果正常应该显示“It works!”

2、安装MySQL

(1)、下载安装mysql-5.5.25.tar.gz,默认安装位置/usr/local/mysql/

$ tar zxvf mysql-5.5.25.tar.gz
$ cd mysql-5.5.25/
$ sudo groupadd mysql
$ sudo useradd -r -g mysql mysql
$ cmake .
$ make
$ sudo make install
$ cd /usr/local/mysql/
$ sudo chown -R mysql .
$ sudo chgrp -R mysql .
$ sudo scripts/mysql_install_db –user=mysql
$ sudo chown -R root .
$ sudo chown -R mysql data/
$ sudo cp support-files/my-medium.cnf /etc/my.cnf
$ sudo cp support-files/mysql.server /etc/init.d/mysql.server

(2)、启动MySQL:
方法1:$ sudo service mysql.server start
方法2:$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &

3、安装PHP

(1)安装下载php-5.4.4.tar.gz

$ tar zxvf php-5.4.4.tar.gz
$ cd php-5.4.4
$ ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --enable-mbstring --with-mcrypt(可能需要安装libmcrypt-dev )
$ sudo make install
$ sudo cp php.ini-development /usr/local/lib/php.ini

(2)配置HTTP Server使之支持PHPapache配置文件/usr/local/apache2/conf/httpd.conf修改或添加如下配置

<;IfMole dir_mole>
DirectoryIndex index.php
<;/IfMole>
<;FilesMatch \.php$>
SetHandler application/x-httpd-php
<;/FilesMatch>

(3)重启HTTP Server
$ sudo /usr/local/apache2/bin/apachectl restart

⑻ linux中web服务怎么修改httpd.conf文件能让普通用户启动httpd服务进程。

关于这个问题,linux服务类的必须用root权限启动