當前位置:首頁 » 網頁前端 » 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許可權啟動