自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

新鮮體驗(yàn) openSUSE 12.1下搭建Web服務(wù)器

系統(tǒng) Linux
隨著互聯(lián)網(wǎng)技術(shù)的不斷發(fā)展,Web服務(wù)器在中小企業(yè)中迅速得到廣泛應(yīng)用,而搭建Web服務(wù)器是管理人員經(jīng)常會(huì)遇到一個(gè)基本技能。Web服務(wù)器的搭建一般可分為兩種情況,Windows或者Linux,Windows可以借助自帶的IIS服務(wù)器搭建,也可以借助第三方的軟件搭建,比如Home Web Server軟件;而對(duì)于Linux,現(xiàn)在常用到的軟件為Apache。

隨著互聯(lián)網(wǎng)技術(shù)的不斷發(fā)展,Web服務(wù)器在中小企業(yè)中迅速得到廣泛應(yīng)用,而搭建Web服務(wù)器是管理人員經(jīng)常會(huì)遇到一個(gè)基本技能。Web服務(wù)器的搭建一般可分為兩種情況,Windows或者Linux,Windows可以借助自帶的IIS服務(wù)器搭建,也可以借助第三方的軟件搭建,比如Home Web Server軟件;而對(duì)于Linux,現(xiàn)在常用到的軟件為Apache。

 

[[62132]]

Linux是近年來比較流行的Web服務(wù)器的搭建系統(tǒng),以開源、穩(wěn)定、高安全等特性迅速成為Web服務(wù)器的主流。在國內(nèi)Red Hat可以說是搭建服務(wù)器的最多Linux系統(tǒng),但國際上,openSUSE則依靠著其強(qiáng)大的性能得到非常廣泛的應(yīng)用,其實(shí)在Linux下搭建服務(wù)器原理上是基本相同的,只不過一些具體的命令操作會(huì)有不同,本文給大家演示的是在openSUSE12.1的服務(wù)器版搭建Apache2的Web服務(wù)器。

LAMP是Lniux,Apache,MySQL,PHP的縮寫,這里我們將給大家展示怎么在OpenSUSE 12.1的服務(wù)器版本中用PHP5和MySQL搭建Apache2的Web服務(wù)器。具體請(qǐng)看下面步驟。

1.開始說明

本教程中使用的IP地址是192.168.0.100,主機(jī)名稱為Server1.example.com 這些設(shè)置可能會(huì)有所不同,你需要根據(jù)不同情況進(jìn)行修改。

openSUSE 12.1下安裝MySQL5

 

2.安裝MySQL5

首先我們需要先用下面的命令安裝MySQL5:

yast2 -i mysql mysql-client mysql-community-server

然后我們需要?jiǎng)?chuàng)建MySQL系統(tǒng)的啟動(dòng)鍵鏈接啟動(dòng)MySQL服務(wù)器,這樣以便于MySQL在系統(tǒng)啟動(dòng)時(shí)自動(dòng)啟動(dòng),

systemctl enable mysql.service
systemctl start mysql.service

為了確保MySQL的安裝完成,運(yùn)行:

mysql_secure_installation

下面會(huì)遇到下面的提示問題;

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] <-- 輸入Y
New password: <-- 設(shè)置數(shù)據(jù)庫密碼
Re-enter new password: <-- 重新輸入數(shù)據(jù)庫密碼
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
production environment.
Remove anonymous users? [Y/n] <-- 選擇Y
... 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] <-- 選擇Y
... 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 production environment.
Remove test database and access to it? [Y/n] <-- 選擇Y
- 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] <-- 選擇Y
... 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!
server1:~ #

現(xiàn)在你的MySQL安裝應(yīng)成功了

openSUSE 12.1下安裝Apache2

 

3.openSUSE 12.1下安裝Apache2

Apache2的是作為一個(gè)openSUSE的軟件包,因此,我們可以用下面命令安裝它:

yast2 -i apache2

現(xiàn)在配置系統(tǒng)在引導(dǎo)時(shí)啟動(dòng)Apache

systemctl enable apache2.service

并啟動(dòng)Apache2

systemctl start apache2.service

現(xiàn)在,在您的瀏覽器輸入http://192.168.0.100,你應(yīng)該看到Apache2的首頁頁(不用擔(dān)心403錯(cuò)誤,這種情況,因?yàn)橛袥]有索引文件(例如index.html的文件根目錄)) :

在opensuse12.1搭建web服務(wù)器
錯(cuò)誤提示

 

Apache的默認(rèn)文檔根目錄是在openSUSE上的/srv/www/htdocs/目錄 ,配置文件是/etc/apache2/httpd.conf。配置存儲(chǔ)在的/etc/apache2/conf.d /目錄。

4.安裝PHP5

我們可以安裝PHP5和Apache的PHP5的模塊如下:

yast2 -i apache2-mod_php5

事后我們必須重新啟動(dòng)Apache:

systemctl restart apache2.service

openSUSE 12.1下此時(shí)PHP5

 

5.測試PHP5并獲取PHP5的安裝信息

默認(rèn)網(wǎng)站的文件根目錄是在/srv/www/htdocs/中。現(xiàn)在我們將在該目錄中創(chuàng)建一個(gè)小型PHP文件(info.php的)和在瀏覽器中調(diào)用它。該文件將顯示很多關(guān)于我們的PHP安裝,如安裝的PHP版本和有用的一些細(xì)節(jié)。

vi /srv/www/htdocs/info.php
 在opensuse12.1搭建web服務(wù)器  PHP設(shè)置

 

如果您得到的消息是你沒有一個(gè)有效的Vim安裝的二進(jìn)制軟件包。請(qǐng)安裝“VIM”,“vim的增強(qiáng)型”或者“gvim”,請(qǐng)運(yùn)行:

yast2 -i vim

安裝VI并再次嘗試。

現(xiàn)在,我們請(qǐng)?jiān)跒g覽器(如文件http://192.168.0.100/info.php):

在opensuse12.1搭建web服務(wù)器
PHP首頁

正如你所看到的,PHP5的工作,它通過Apache 2.0的處理程序,在服務(wù)器API線。如果你繼續(xù)向下滾動(dòng),你會(huì)看到所有在PHP5中已經(jīng)啟用的模塊。MySQL是沒有列出,這意味著我們沒有在PHP5支持MySQL。

6.獲得MySQL支持

讓PHP在MySQL中獲得支持,我們可以安裝的php5-mysql軟件包。安裝一些其他的PHP5模塊,以及您可能需要的應(yīng)用程序,這是一個(gè)好主意:

yast2 -i php5-mysql php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm

現(xiàn)在重新啟動(dòng)Apache2的:

systemctl restart apache2.service

現(xiàn)在,重載http://192.168.0.100/info.php在您的瀏覽器,并再次向下滾動(dòng)到模塊部分?,F(xiàn)在,你應(yīng)該找到許多新的模塊,包括MySQL模塊:

在opensuse12.1搭建web服務(wù)器
MYSQL顯示

openSUSE 12.1下安裝phpMyAdmin

 

7. 安裝phpMyAdmin

phpMyAdmin是一個(gè)網(wǎng)絡(luò)接口,通過它可以管理你的MySQL數(shù)據(jù)庫。

phpMyAdmin的可安裝如下:

yast2 -i phpMyAdmin

為了確保我們稍后通過ISPConfig創(chuàng)建的所有網(wǎng)站訪問phpMyAdmin的可以和登錄使用phpmyadmin(http://www.example.com/phpmyadmin)和phpMyAdmin(如http://www.example.com/phpMyAdmin),打開/ etc/apache2/conf.d/phpMyAdmin.conf文件設(shè)置

vi /etc/apache2/conf.d/phpMyAdmin.conf

并開始添加以下兩個(gè)別名:

在opensuse12.1搭建web服務(wù)器
設(shè)置別名

 

重新啟動(dòng)Apache:

systemctl restart apache2.service

在地址欄輸入http://192.168.0.100/phpMyAdmin/:你就可以訪問phpMyAdmin了。

在opensuse12.1搭建web服務(wù)器
phpMyAdmin頁面

以上就是在openSUSE12.1服務(wù)器版本搭建Web服務(wù)器的具體過程,大家可以根據(jù)提示一步步進(jìn)行操作,基本上就能設(shè)置好,大家可以用虛擬機(jī)進(jìn)行嘗試,畢竟Linux下搭建服務(wù)器是經(jīng)常碰到的操作。

責(zé)任編輯:張浩 來源: zol.com
相關(guān)推薦

2012-03-22 10:35:20

CentOSWeb服務(wù)器

2016-10-11 12:45:50

PythonWeb服務(wù)器

2016-08-10 16:28:00

WebURLHTTP

2016-08-22 20:37:10

PythonWeb服務(wù)器

2011-11-17 10:08:08

openSUSE發(fā)布

2010-05-25 09:17:51

搭建SVN服務(wù)器

2009-06-11 11:13:01

LinuxWeb服務(wù)器

2009-02-10 15:38:00

ApacheLinuxWeb服務(wù)器

2017-10-19 16:12:57

2013-06-18 10:48:41

OpenSUSEOpenSUSE 12

2011-04-11 11:05:07

FreeBSD 8.1

2009-09-03 15:19:06

RHEL5下DNS服務(wù)器紅帽

2009-09-16 16:02:11

2009-09-25 10:13:15

2010-05-25 08:46:12

2021-05-18 09:01:09

Windows操作系統(tǒng)NodeJs服務(wù)器

2010-05-21 13:07:14

Windows下SVN

2011-02-25 15:38:58

2009-12-18 09:53:20

Android

2022-02-22 11:57:32

BOAWeb服務(wù)器
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)