當前位置:首頁 » 雲伺服器 » linux搭建http伺服器

linux搭建http伺服器

發布時間: 2022-01-16 03:53:04

❶ 如何在linux搭建完整的web伺服器

可以參考如下Web伺服器的建立過程。示例環境及web伺服器軟體:

Ubuntu 12.04
LAMP(Linux,Apache,Mysqlphp

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 centos怎麼搭建http文件伺服器

centos如果是建立文件伺服器一般使用ftp,安裝vsftp服務即可。
如果使用http的文件伺服器,可以使用apache的目錄瀏覽功能。

❸ linux 怎麼創建http伺服器

海騰曾超為您解答
實際上就是apache

http://blog.163.com/hlz_2599/blog/static/142378474201182811611382/

❹ linux系統下怎麼搭建網站伺服器

具體方法如下:

1、使用putty或類似的SSH工具登錄伺服器(本地安裝跳過);

❺ 怎麼在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
x86_64系統:
yum install
在i386系統:
yum install
安裝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中如何實現用java寫一個http伺服器,本人新手一枚,不知道從哪裡開始

建議你系統學習下:
1.java基礎
2.sevlet
3.jsp
4.tomcat
5.mysql
6.ssh框架
7.ssm框架
這些內容網上都有免費教程

❼ 阿里雲linux系統搭建好了HTTP伺服器 現在要做個項目讓人可以下載 我自己放的東西 項目怎麼寫

你們公司有人懂架設,沒有就找網路公司買空間或伺服器,因為買了空間或伺服器就要把程序架設上去,在做域名解析,你們公司沒人懂操作,你買了也是沒有辦法用。還有你們公司是企業網站,建議買空間,一年才兩三百,買伺服器一年最少要七八百,還要有人管理,很麻煩的。

❽ linux怎樣安裝http服務

可以查看所有的服務。看看其中是否有httpd即可。httpd是http服務的守護進程。可以參考如下Web伺服器的建立過程。示例環境及web伺服器軟體:LAMP(Linux,Apache,Mysql,PHP)(1)、下載安裝mysql-5.5.25.tar.gz,默認安裝位置/usr/local/mysql/

❾ 如何在linux系統搭建http服務

1、安裝ftp服務端,方便你從客戶端上傳文件。linux上一般安裝vsftp.VSFTP的軟體安裝包是: vsftpd-2.2.2-12.el6_5.1.i686.rpm
查詢:#rpm -q vsftpd
安裝:#rpm -ivh vsftpd-2.2.2-12.el6_5.1.i686.rpm或者直接yum install vsftpd
啟動、停止及重啟VSFTP的命令: #service vsftpd start/stop/restart
配置文件:
/etc/vsftpd/vsftpd.conf //主配置文件
/etc/vsftpd.ftpusers //被禁止登錄FTP的用戶文件
/etc/vsftpd.user_list //允許登錄FTP的用戶文件
a、將登錄後的用戶限制在本地家目錄下:
#vi /etc/vsftpd/vsftpd.conf
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
新建受限用戶的列表文件並加入受限用戶名
#vi /etc/vsftpd.chroot_list
raykeso
重啟ftp服務
#service vsftpd restart
2、安裝apache,開啟目錄索引,這樣你就可以瀏覽和下載文件。
apache配置文件
<Directory "I:/build/dist"> #設置瀏覽文件的目錄
Options Indexes #開啟目錄列表索引模式Order allow,deny
Allow from all
</Directory>

❿ 如何得知LINUX伺服器上安裝了什麼HTTP伺服器

這個得根據情況,如果web伺服器是開啟的,直接ps查進程即可

如果沒有開啟就需要全盤檢索,找一些常用的目錄來看安裝的是什麼web伺服器了。

熱點內容
自動欣悅版有哪些配置 發布:2024-03-29 03:48:26 瀏覽:286
如何用腳本搶 發布:2024-03-29 03:01:59 瀏覽:119
火影忍者手游配置怎麼調 發布:2024-03-29 02:53:53 瀏覽:102
編程畫櫻花 發布:2024-03-29 02:11:24 瀏覽:473
騰訊雲伺服器1mb老掉線 發布:2024-03-29 01:56:11 瀏覽:215
執行sql語句的存儲過程 發布:2024-03-29 01:52:37 瀏覽:697
婚紗攝影腳本 發布:2024-03-29 01:47:40 瀏覽:901
我的世界伺服器咋開外掛 發布:2024-03-29 01:07:45 瀏覽:456
sql寫報表 發布:2024-03-29 01:03:23 瀏覽:306
家用伺服器怎麼選 發布:2024-03-29 00:49:18 瀏覽:402