導航:首頁 > 配伺服器 > linux如何啟用web伺服器

linux如何啟用web伺服器

發布時間:2022-08-15 10:32:12

① 在linux下如何配置WEB伺服器

你好。你可以裝一個伺服器,然後重啟服務就可以了。
吧自己要放的頁面 放多相應的位置就可以了

② linux怎麼搭建web伺服器

第一步,我們在Ubuntu下搭建LAMP環境,首先,安裝apache:
sudo apt-get install apache2 apache2-doc
測試apache2正常工作:
接下來是安裝mysql:
sudo apt-get install mysql-server
sudo apt-get install mysql-client
安裝mysql的時候會提醒設置root賬戶的密碼

,需要注意他和你的登錄賬戶密碼是沒有什麼聯系的。
接下來是php的安裝:
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5  //安裝apache服務支持php模塊
安裝配置完一些東西我們都是需要重啟apache生效。

③ windows /linux環境下如何搭建web伺服器

這是兩種完全不同的伺服器操作系統,但都可以使用BT安裝。

④ 如何在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伺服器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伺服器的簡單搭建
1、安裝一個可以提供web服務的軟體
yum -y install httpd

2、 啟動httpd服務
systemctl start httpd

3、進入主配置文件
vim /etc/httpd/conf/httpd.conf

在此范圍內添加或刪除設置,為了方便編寫,編輯了一個子配置文件/etc/httpd/conf.d/httpd-vhosts.conf
4、 編輯子配置文件
vim /etc/httpd/conf.d/httpd-vhosts.conf 此路徑必為conf.d/*.conf (意:為.conf 後綴命名)

systemctl restart httpd 重啟服務

5、 編輯頁面測試文件
在web服務中默認存放網頁文件的路徑:/var/ chaodiquan.com /html
默認網頁文件名字:index.html
6、 瀏覽器測試
ifconfig ens33 查看ens33網卡的地址

在瀏覽器裡面 輸入你的IP就可以看到測試文件里 希望可以幫助到的哈!

⑦ Linux下如何搭建WEB伺服器教程

一要在Linux下搭建web環境,譬如你想使用什麼進行搭建,例如lamp或者lnmp;lamp是Linux下apache伺服器,MySQL資料庫,PHP語言;lnmp使用nginx伺服器。
二將你的網站文件放在網站根目錄即可

⑧ Linux怎麼配置Web伺服器

工具/原料

Linux操作系統

Web伺服器配置詳解

方法/步驟

1.Apache是Linux下的Web伺服器,Apache用的是靜態頁面,需要載入模塊來支持動態頁面,會動態實時的調整進程來處理,最合理的使用多核CPU資源,支持虛擬主機應用,多個Web站點共享一個IP地址。

安裝Web服務

先安裝Web服務,通過命令yum groupinstall命令進行安裝,建議用groupinstall而不用Install是因為groupinstall,會把該服務所有相關的服務包一起安裝,這樣不會有丟失。

⑨ linux下怎樣配置web伺服器

可以用Apache,也可以用nginx,Apache直接yum安裝,啟動httpd服務既可以訪問,nginx的話下載編譯安裝後,就可以訪問了。一般只支持html頁面,如需支持更多頁面還是需要下載配置的,例如nginx+php,Apache+php等等。。。

閱讀全文

與linux如何啟用web伺服器相關的資料

熱點內容
juniper命令行 瀏覽:68
程序員咨詢銷售工作怎麼樣 瀏覽:780
蘋果文件伺服器是什麼 瀏覽:178
企業透明加密軟體有監視功能嗎 瀏覽:494
桌面的運行命令 瀏覽:9
主流廠商伺服器維護流程是什麼 瀏覽:807
壓縮棉的被子先洗洗在用 瀏覽:242
批處理bat代碼和文件夾 瀏覽:297
怎麼交叉編譯tslib14 瀏覽:494
致程序員生產力飆升 瀏覽:760
程序員害怕下班嗎 瀏覽:107
鐵路漢宜線加密網實景效果圖 瀏覽:929
php工作難找 瀏覽:440
微信拼手氣紅包源碼 瀏覽:380
javaexcel公式計算 瀏覽:629
mastercam二維編程 瀏覽:384
加密協議aes和tkip 瀏覽:707
數據結構與演算法彭軍 瀏覽:770
二類app是什麼意思 瀏覽:498
可示教編程的plc 瀏覽:405