怎么在openSUSE上安裝和配置LAMP

這篇文章主要講解了“怎么在openSUSE上安裝和配置LAMP”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“怎么在openSUSE上安裝和配置LAMP”吧!

創(chuàng)新互聯(lián)建站專注于南昌縣企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站建設(shè),商城網(wǎng)站開(kāi)發(fā)。南昌縣網(wǎng)站建設(shè)公司,為南昌縣等地區(qū)提供建站服務(wù)。全流程按需求定制開(kāi)發(fā),專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)建站專業(yè)和態(tài)度為您提供的服務(wù)

openSUSE上安裝和配置LAMP步驟如下:

LAMP是由Apache MySQL PHP組成的,是在Linux下***的軟件組合之一,目前互聯(lián)網(wǎng)上有很多網(wǎng)站運(yùn)行在LAMP服務(wù)器上。

Linux - 是富有情味的開(kāi)源操作系統(tǒng);Apache - 這個(gè)星球上大師級(jí)的WEB服務(wù)器;MySQL - 是你喜愛(ài)的開(kāi)源數(shù)據(jù)庫(kù)軟件;PHP - 受歡迎的WEB編程語(yǔ)言。

安裝LAMP服務(wù)最簡(jiǎn)單的方法是在YaST圖形界面,按以下步驟安裝:

1、Computer – YaST – Install Software - 選擇過(guò)渡”Patterns”,然后選擇并接受”Web and LAMP”。但是這種方法我們安裝了不需要的服務(wù),如DNS,Perl模塊等。

我喜歡手動(dòng)安裝一個(gè)LAMP服務(wù)。

所以不要浪費(fèi)時(shí)間了,讓我們立即讓LAMP在你的openSUSE上運(yùn)行起來(lái)吧。我用的是openSUSE11.0,這個(gè)安裝過(guò)程同樣適用早期的10.3、10.2版本,11.1版本也同樣適應(yīng)。

安裝和配置Apache2服務(wù)

安裝Apache服務(wù)器

opensuse11:~#yast2 –install apache2

這就安裝了Apache服務(wù),用下面的代碼檢驗(yàn):

opensuse11:~ # rcapache2 status

Checking for httpd2: unused

這是告訴我們,Apache服務(wù)已經(jīng)安裝上,但是還沒(méi)有運(yùn)行。為了測(cè)試Apache是否能夠運(yùn)行正常,在/srv/www/htdocs/目錄建立一個(gè)index.html文件。這個(gè)目錄是Apache默認(rèn)的網(wǎng)站根目錄。

opensuse11:~ # cd /srv/www/htdocs

opensuse11:~ # vi index.html

在上面鍵入鍵入文本“Welcome to openSUSE 11.1”。

啟動(dòng)Apache2服務(wù)

現(xiàn)在啟動(dòng)Apache2服務(wù),我們看看是否運(yùn)行正常。

opensuse11:~ # rcapache2 start

Starting httpd2 (prefork) done

現(xiàn)在開(kāi)啟一個(gè)瀏覽器如Firefox,輸入http://localhost,那么現(xiàn)在就可以看到剛才你輸入的文本了,下面我們安裝PHP5。

安裝PHP5

opensuse11:~ # yast2 –install php5 php5-mysql apache2-mod_php5

這將安裝PHP5, PHP5-MySQL 模塊和Apache2 PHP5 模塊。為了讓Apache2支持PHP5模塊,現(xiàn)在重啟Apache2讓改動(dòng)生效。

opensuse11:~ # rcapache2 restart

Syntax OK

Shutting down httpd2 (waiting for all children to terminate) done

Starting httpd2 (prefork) done

安裝和配置MySQL

opensuse11:~ # yast2 –install mysql mysql-tools

這樣就把MySQL數(shù)據(jù)庫(kù)和可選安裝的mysql-tools(設(shè)置工具)安裝到openSUSE上了。按以下命令驗(yàn)證是否已經(jīng)安裝上:

opensuse11:~ # rcmysql status

Checking for service MySQL: unused

上面的輸出顯示MySQL服務(wù)已經(jīng)安裝,但是還沒(méi)有運(yùn)行。

啟動(dòng)MySQL服務(wù)

opensuse11:~ # rcmysql start

Starting service MySQL done

默認(rèn)安裝是沒(méi)有root密碼的,但是root密碼是非常重要的。

設(shè)置root密碼

opensuse11:~ # mysqladmin -u root –p password rootpassword

這是將root密碼設(shè)置為”rootpassword”。你可以設(shè)置一個(gè)安全適當(dāng)?shù)拿艽a。

按以下操作檢查一下root密碼是否已經(jīng)設(shè)置和MySQL Client是否可以登陸到MySQL服務(wù)器。

opensuse11:~ # mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.51a SUSE MySQL RPM

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> show databases;

+——————–+

| Database |

+——————–+

| information_schema |

| mysql |

| test |

+——————–+

3 rows in set (0.04 sec)

mysql>

按以上操作,我用MySQL Client作為root登錄,輸入了剛才鍵入的密碼,列舉了數(shù)據(jù)庫(kù)。這樣就已經(jīng)完全在openSUSE上安裝了LAMP服務(wù)。

管理MySQL數(shù)據(jù)庫(kù)最簡(jiǎn)易和流行的工具是phpMyAdmin,phpMyAdmin的安裝需要我們上面已經(jīng)進(jìn)行過(guò)的PHP5,Apache2環(huán)境,現(xiàn)在可以快速安裝和配置phpMyAdmin了。

安裝phpMyAdmin

opensuse11:~ # yast2 –install phpMyAdmin

這就安裝了phpMyAdmin,并在/srv/www/htdocs/建立了phpMyAdmin目錄。進(jìn)入該目錄,并利用config.sample.inc.php快速配置phpMyAdmin。

opensuse11:~ # cd /srv/www/htdocs/phpMyAdmin

opensuse11:~ # cp config.sample.inc.php config.inc.php

查找下列語(yǔ)句修改為:

$cfg['blowfish_secret'] = ‘mysqladmin’;

在這里我設(shè)置了一個(gè)短語(yǔ)密碼 ‘mysqladmin’。

按上面操作并設(shè)置了默認(rèn)配置。 登錄http://localhost/phpMyAdmin 到phpMyAdmin 用root帳戶和剛才建立的密碼。

 RPM安裝MySQL

rpm -ivh MySQL-server-4.0.16-0.i386.rpm

rpm -ivh MySQL-client-4.0.16-0.i386.rpm

http://www.linux-cn.com/html/database/mysql/20070422/9875.html

Mono

在 Apache2.2 下設(shè)置 Mono 的 ASP。Net

在 Yast2控制中心里選 系統(tǒng) -> 磁盤分區(qū)管理 , 點(diǎn)開(kāi)左邊的樹(shù),選擇分區(qū),編輯,掛載 /mnt/Music (Music 是自己起的名字)。然后在 FSTAB 選項(xiàng)中,把 fmask 和 dmask 的值改為 000 ,完成。 就可以自動(dòng)掛載并可讀寫了。

經(jīng)本人實(shí)驗(yàn), 在OpenSuse11.2 x64 系統(tǒng)下,Apache2.2 建虛擬目錄總出現(xiàn) 403 無(wú)權(quán)限錯(cuò)誤,與此有關(guān)。

另外,Ubuntu 下如果出現(xiàn) 403 , 用以下配置文件是正確的. 但是需要注意, NTFS 分區(qū)是不能 chmod 的 . 所以,要把 Web 站點(diǎn)放到 Linux分區(qū)上,再 sudo chmod -R 777 MyWeb

在 /etc/apache2/config.d/ 下新建虛擬目錄的配置文件: MyTrade.conf (MyTrade 替換成你自己的虛擬目錄名,文件名需以 conf 結(jié)尾)

Alias /MyTrade "/mnt/App/MonoApp/MyWebTradeSln/MyTrade"

# MonoServerPath can be changed to specify which version of ASP.NET is hosted

# mod-mono-server1 = ASP.NET 1.1 / mod-mono-server2 = ASP.NET 2.0

# For SUSE Linux Enterprise Mono Extension, uncomment the line below:

# MonoServerPath MyTrade "/opt/novell/mono/bin/mod-mono-server2"

# For Mono on openSUSE, uncomment the line below instead:

MonoServerPath MyTrade "/usr/bin/mod-mono-server2"

# To obtain line numbers in stack traces you need to do two things:

# 1) Enable Debug code generation in your page by using the Debug="true"

# page directive, or by settingin the

# application's Web.config

# 2) Uncomment the MonoDebug true directive below to enable mod_mono debugging

MonoDebug MyTrade true

# The MONO_IOMAP environment variable can be configured to provide platform abstraction

# for file access in Linux. Valid values for MONO_IOMAP are:

# case

# drive

# all

# Uncomment the line below to alter file access behavior for the configured application

MonoSetEnv MyTrade MONO_IOMAP=all

# Additional environtment variables can be set for this server instance using

# the MonoSetEnv directive. MonoSetEnv takes a string of 'name=value' pairs

# separated by semicolons. For instance, to enable platform abstraction *and*

# use Mono's old regular expression interpreter (which is slower, but has a

# shorter setup time), uncomment the line below instead:

# MonoSetEnv MyTrade MONO_IOMAP=all;MONO_OLD_RX=1

MonoApplications MyTrade "/MyTrade:/mnt/App/MonoApp/MyWebTradeSln/MyTrade"

Options Indexes MultiViews

Allow from all

Order allow,deny

MonoSetServerAlias MyTrade

SetHandler mono

SetOutputFilter DEFLATE

SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript

這樣就行了。

感謝各位的閱讀,以上就是“怎么在openSUSE上安裝和配置LAMP”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)怎么在openSUSE上安裝和配置LAMP這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

本文標(biāo)題:怎么在openSUSE上安裝和配置LAMP
URL鏈接:http://bm7419.com/article24/jciije.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、網(wǎng)頁(yè)設(shè)計(jì)公司外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站策劃、微信小程序、網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化