slackware设置LAMP - digwtx's Blog

slackware设置LAMP

digwtx posted @ 2009年8月12日 21:56 in Slackware , 831 阅读

Apache2:

設定檔為/etc/httpd/httpd.conf,而網頁放置在/srv/httpd/htdocs/目錄中

替Apache2加上執行檔後啟動
# chmod +x /etc/rc.d/rc.httpd
# /etc/rc.d/rc.httpd start

打開Firefox在網址列打上http://localhost/,假如成功的話,會出現It works!

Mysql5:

先 vi /etc/rc.d/rc.mysqld 瞧瞧,會看到一堆英文......裡面有這兩行
# su - mysql
# mysql_install_db
給它照著打一遍

然後
# mv /etc/my-small.cnf /etc/my.cnf (my-small.cnf不一定適合你,請依需求自己換為my-huge.cnf,my-large.cnf或my-medium.cnf)
# chown -R mysql:mysql /var/lib/mysql/

啟動Mysql
# chmod +x /etc/rd.d/rc.mysqld
# /etc/rc.d/rc.mysqld start

接下來創個資料庫試試看,有沒有發現資料庫是Ro呀 ^^
# mysqladmin -u root password <Your_Pass_Word>
# mysqladmin -u root -p create ragnarok

測試一下有沒有乖乖的做事吧!
# 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.37 Source distribution

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

mysql>
看到mysql>的提示符號就知道正常工作嚕

PHP5:

PHP5的設定檔php.ini和mod_php.conf都在/etc/httpd目錄下
# cd /etc/httpd/
# mv php.ini-recommended php.ini
# mv mod_php.conf.example mod_php.conf
# vi /etc/httpd/httpd.conf,去掉第472行的註解#,然後在DirectoryIndex index.html的後面加上 index.htm index.php,如下

#Include /etc/httpd/mod_php.conf
改為
Include /etc/httpd/mod_php.conf
.
DirectoryIndex index.html
改為
DirectoryIndex index.html index.htm index.php

然後重啟Apache2
# /etc/rc.d/rc.httpd restart

接下來測試PHP5有沒有正常
# vi /srv/httpd/htdocs/test.php,輸入以下內容

<html>
<head>
<title> PHP Test Script </title>
</head>
<body>
<?php
    phpinfo();
?>

</body>
</html>


然後Firefox網址列打上http://localhost/test.php,假如出現PHP的訊息頁就是成功了

 


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee