當前位置:首頁 » 網頁前端 » 製作linux最小web伺服器
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

製作linux最小web伺服器

發布時間: 2022-11-18 21:20:51

㈠ 怎麼在linux操作系統上搭建Web伺服器、要詳細的步驟

首先建好dns 新建web伺服器所對應的主機記錄 建好網頁目錄及網頁mkdir /wwwvi /www/index.html 輸入內容隨便什麼都行裝上web所需的軟體包rpm -ivh httpd-[tab]最後做如下修改 對應的ip地址對應的主目錄對應的主機記錄及域名這樣就行的了最簡單的web伺服器還有其他的.....

㈡ 如何搭建linux下web伺服器

建議你用linuxeye的腳本~或者省內存的話用llsmp,我阿里雲的伺服器裝好了才用23M內存~首先用root賬號登陸,然後輸入這些命令:
lnmp:
yum -y install wget screen wget http://mirrors.linuxeye.com/lnmp-full.tar.gz # 包含源碼,國內外均可下載tar xzf lnmp-full.tar.gzcd lnmpscreen -S lnmp # 如果網路出現中斷,可以執行命令`screen -r lnmp`重新連接安裝窗口./install.sh # 請勿sh install.sh或者bash install.sh這樣執行說明文檔見blog.linuxeye.com
llsmp的話
wget http://down.llsmp.cn/llsmp0.6_centos.tar.gztar -zxvf llsmp0.6_centos.tar.gzcd centossh install.sh如果需要安裝php5.3版本,在最後一行sh install.sh php5.3說明文檔見www.llsmp.cn

㈢ linux怎麼搭建web伺服器

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

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

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

㈤ Linux怎麼搭建Web伺服器

1.開始說明
本教程中使用的IP地址是192.168.0.100,主機名稱為Server1.example.com 這些設置可能會有所不同,你需要根據不同情況進行修改。

CentOS 6.2下安裝MySQL
2.開始安裝MySQL5
首先我們應該先用下面的命令安裝MySQL:
yum install mysql mysql-server
然後我們需要創建MySQL系統的啟動鍵鏈接啟動MySQL伺服器,這樣以便於MySQL在系統啟動時自動啟動
chkconfig --levels 235 mysqld on
/etc/init.d/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
proction 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 proction 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 6.2下安裝Apache
3.安裝阿帕奇2
Apache2的是作為一個CentOS的軟體包,因此我們可以直接用下面命令安裝它:
yum install httpd
現在配置系統在引導時啟動Apache
chkconfig --levels 235 httpd on
並啟動Apache
/etc/init.d/httpd start
現在,您的瀏覽器到http://192.168.0.100,你應該看到Apache2的測試頁:

Apache 2測試網頁
Apache的默認文檔根目錄是在CentOS上的/var/www/html 目錄 ,配置文件是/etc/httpd/conf/httpd.conf。配置存儲在的/etc/httpd/conf.d/目錄。
4.安裝PHP5
我們可以用下面的命令來安裝PHP5
yum install php
安裝完需要重啟
/etc/init.d/httpd restart

CentOS 6.2下安裝PHP5
5.我們可以安裝PHP5和Apache的PHP5的模塊如下:
默認網站的文件根目錄是在/srv/www/html中。現在我們將在該目錄中創建一個小型PHP文件(info.php的)在瀏覽器中調用它。該文件將顯示很多關於我們的PHP安裝,如安裝的PHP版本和有用的一些細節。
vi /var/www/html/info.php

修改細節
現在,我們可以用瀏覽器訪問例如http://192.168.0.100/info.php文件

PHP頁面
正如你所看到的,PHP5的工作,它通過Apache 2.0的處理程序,在伺服器API線。如果你繼續向下滾動,你會看到所有在PHP5中已經啟用的模塊。MySQL是沒有列出,這意味著我們沒有在PHP5支持MySQL。
6.PHP5獲得MySOL的支持
讓PHP在MySQL中獲得支持,我們可以安裝的php-mysql軟體包。安裝一些其他的PHP5模塊,以及您可能需要的應用程序,這是一個好主意:
yum search php
還安裝需要安裝的
yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc
現在重新啟動Apache2的:
/etc/init.d/httpd restart
現在,重載http://192.168.0.100/info.php在您的瀏覽器,並再次向下滾動到模塊部分。現在,你應該找到許多新的模塊,包括MySQL模塊:

MySQL頁面

CentOS 6.2下安裝phpMyAdmin
7.安裝phpMyAdmin
phpMyAdmin是一個網路介面,通過它可以管理你的MySQL資料庫。
首先,我們使CentOS系統RPMForge軟體庫的phpMyAdmin,而不是官方的CentOS 6.2庫:
所以需要導入RPMForge的GPG密鑰:
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
x86_64系統:
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
在i386系統:
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
安裝phpmyadmin
yum install phpmyadmin
現在我們可以設置phpMyAdmin,了我們可以改變Apache的配置來讓phpMyAdmin不僅僅只能從localhost登錄。
vi /etc/httpd/conf.d/phpmyadmin.conf

配置
下一步,我們從HTTP改變的phpMyAdmin的cookie來身份驗證:
vi /usr/share/phpmyadmin/config.inc.php

修改身份驗證
重啟阿帕奇
/etc/init.d/httpd restart
在地址欄輸入http://192.168.0.100/phpMyAdmin/:你就可以訪問phpMyAdmin了。

phpmyadmin頁面
CentOS可以得到RHEL的所有功能,甚至是更好的軟體。但CentOS並不向用戶提供商業支持,當然也不負上任何商業責任。
如果你要將你的RHEL轉到CentOS上,因為不希望為RHEL升級而付費。當然,你必須有豐富linux使用經驗,因此RHEL的商業技術支持對你來說並不重要。但如果你是單純的業務型企業,那麼還是建議你選購RHEL軟體並購買相應服務。這樣可以節省你的IT管理費用,並可得到專業服務。

㈥ 如何在linux搭建web伺服器

1.安裝apache,這種比較無腦,可以直接整合PHP和mysql
yum -y install httpd
2.安裝nginx,這種整合php的時候需要修改配置文件
yum -y install nginx

㈦ linux最小化安裝後安裝web伺服器要怎麼做

方法一:安裝linux下的xampp,假如你不能離開管理工具,不習慣命令的話。 http://www.apachefriends.org/en/xampp-linux.html 方法二:單獨安裝包。如在redhat enterprise 5.4下利用yum命令逐個安裝apache、mysql、php。安裝這三個就完成了LAMP...

㈧ 如何在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伺服器

你好, 這個是WEB伺服器,因為你能用WEB瀏覽器訪問你的伺服器了。
但估計你裝的是一體化安裝包。你目前顯示的只是WEB伺服器的增強功能模塊PHP模塊和MYSQL資料庫模塊的信息。不是WEB伺服器本身的信息。

上傳方式很簡單,你把文件直接拷貝到WEB服務安裝的目錄下即可, 目前從你的信息上, 看不到這個目錄到底在那個位置,一般來將你裝的WEB伺服器是APACHE,你查下/HOME等目錄下有沒有就可以了。。。

㈩ 高分請教如何搭建Linux下的web伺服器

你下載Ubuntu的伺服器版,在安裝的時候會提示你把伺服器干什麼用的,比如LAMP或者DNS,基本上是傻瓜式的向導操作。