Lighttpd是一款安全,高效,基於標準且為高速環境設計的web伺服器。這篇教程將教你如何在一台Fedora 14中安裝Lighttpd+PHP5(FastCGI模式)+MySQL。
我已經測試無誤,這將保證為你工作!1 前言備忘
在這篇教程中我使用的使用者名稱是www.unixbar.net,IP地址是192.168.0.100.這些設定可能與你的有所不同,因此 你需要在適當的地方修改一下.1.安裝MySQL
[root@server ~]# yum -y install mysql mysql-server
為MySQL添加自啟動,讓MySQL伴隨系統啟動:[root@server ~]# chkconfig --levels 235 mysqld on
[root@server ~]# /etc/init.d/mysqld start為root使用者佈建一個密碼(否則任何人都可以訪問到你的MySQL資料庫):[root@server1 ~]# mysql_secure_installationNOTE: 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, well need the current
password for the root user. If youve just installed MySQL, and
you havent 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): <--敲 ENTER鍵
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:<-- 輸入你的密碼
Re-enter new password: <-- 重複輸入你的密碼
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] <--敲 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 production 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 youve completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
[root@server1 ~]# 3.安裝Lighttpd
Fedora官方源中預設有Lighttpd這個包,所以我們直接用下列命令安裝:
[root@server ~]# yum -y install lighttpd
為Lighttpd建立自啟動,讓Lighttpd伴隨系統啟動
[root@server ~]# chkconfig --levels 235 lighttpd on[root@server ~]# /etc/init.d/lighttpd start
現在你就可以在瀏覽器中直接存取http://192.168.0.100了,就能看到Lighttpd的預留頁: