译者:TonyGao (linuxertony at gmail dot com) 于2006年3月23日
EmailIt is no longer necessary to become an expert practitioner of the arcane dark arts of the Unix command line in order to get a complete Linux distribution working on your PC including all of the productivity, multimedia, and entertainment applications you will need on your desktop and a fully functional web server as well.
This
web page began as some notes to myself as I installed Fedora Core and
has evolved into a popular guide for the new Linux user.
Stan Finley
这些说明是假定你选择的是i386或i686系统(32位)。而且有上网条件和至少10G的分区给Federa。关于Fedora和Windows的双重启动介绍也包含在内。
这些介绍不能确定在64位计算机管用。64位处理器,比如Athlon64,Opteron 和 Xeon,虽然32位的fedora可以运行于它们之上,但是一些类似Firefox的插件只能运行于32位版本的Ff之上。
su -
gedit /boot/grub/grub.conf
# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,1) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/hda default=0 timeout=5 splashimage=(hd0,1)/grub/splash.xpm.gz #hiddenmenu title Fedora Core 5 (2.6.15-1.2054_FC5) root (hd0,1) kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.15-1.2054_FC5.img title Windows XP rootnoverify (hd0,0) chainloader +1
su -
yum -y update
gedit /etc/X11/xorg.conf
请注意: 你不能同时使用 livna.org 源和 dag/freshrpms/dries/newrpms (RPMforge) 来自动升级. 使用其中的一组或者单个,但是不要同时使用两组。这两组是相互矛盾的,如果自动升级会出错。不管你使用其中的哪一组你都应该避免再使用ATrpms yum源或apt源(原因). 一些额外的信息可以在这里找到.
虽然如此,你还是可以从矛盾的源里单独下载rpm包来用. 可以把某个源的可用标记设为"0" (off)来关闭这个源是用,想要再次使用这个源可以通过yum "--enablerepo"命令
我本人使用RPMforge,在下边你可以看见我的源的说明。dag/freshrpms/dries/newrpms/PlanetCCRMA (RPMforge) 源提供给我了所有我想要的程序。
想要你的Fedora Core 5 yum 程序也拥有 RPMForge源,就继续往下看吧:)
su -
rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/5/freshrpms-release/freshrpms-release-1.1-1.fc.noarch.rpm
gedit /etc/yum.repos.d/macromedia.repo
[macromedia] name=Macromedia for i386 Linux baseurl=http://macromedia.rediris.es/rpm/ enabled=1 gpgcheck=1 gpgkey=http://macromedia.mplug.org/FEDORA-GPG-KEY
rpm --import http://freshrpms.net/packages/RPM-GPG-KEY.txt
yum -y update
su
ls
rpm -ivh *.rpm
rm *.rpm
su -
yum -y install grip gtk-gnutella numlockx xscreensaver-extras xscreensaver-gl-extras xscreensaver-base
su -
yum -y install yumex
su
mv *.bin /opt
cd /opt
chmod +x *-linux-i586.bin
./*.bin
rm *.bin
su -
ln -s /opt/jre1.5.0_06/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so
(如果你想安装包含Java开发环境的 JDK,那么从Sun下载 JDK .bin 文件而不是 JRE .bin文件,在上面命令中用 "jdk 1.5.0_06" 代替 "jre 1.5.0_06"并用 "ln -s /opt/jdk 1.5.0_06/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so" 代替 "ln -s /opt/jre1.5.0_06/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so" 来创建浏览器插件。)
我们还没完全弄好Java环境,如果你的浏览器Java插件能工作,就继续我们的工作吧。
su -
gedit /etc/profile.d/java.sh
export J2RE_HOME=/opt/jre1.5.0_06 export PATH=$J2RE_HOME/bin:$PATH
source /etc/profile.d/java.sh
which java
/opt/jre1.5.0_06/bin/java
/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.5.0_06/bin/java 2
/usr/sbin/alternatives --config java
There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- * 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java + 2 /opt/jre1.5.0_06/bin/java Enter to keep the current selection[+], or type selection number:
2
/usr/sbin/alternatives --display java
java - status is manual. link currently points to /opt/jre1.5.0_06/bin/java /usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420 slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj slave jre: /usr/lib/jvm/jre-1.4.2-gcj /opt/jre1.5.0_06/bin/java - priority 2 slave rmiregistry: (null) slave jre_exports: (null) slave jre: (null) Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.
su -
yum -y install flash-plugin
su
yum -y install compat-libstdc++-33
rpm -ivh *.rpm
rm *.rpm
yum -y remove HelixPlayer
su -
yum -y install gstreamer-plugins-ugly
wget ftp://ftp.adobe.com/pub/adobe/reader/unix/7x/7.0/enu/AdobeReader_enu-7.0.1-1.i386.rpm
su
yum -y install compat-libstdc++-33
rpm -ivh *.rpm
rm *.rpm
su -
acroread
gedit /etc/mozpluggerrc
####################### ###application/pdf:pdf:PDF file ###application/x-pdf:pdf:PDF file ###text/pdf:pdf:PDF file ###text/x-pdf:pdf:PDF file ### ACROREAD() ### repeat noisy swallow(evince) fill: evince "$file" ### repeat noisy swallow(kpdf) fill: kpdf "$file" ### repeat noisy swallow(Xpdf) fill: xpdf -g +9000+9000 "$file" ### GV() #######################
cd /usr/lib/mozilla/plugins
ln -s /usr/local/Adobe/Acrobat7.0/Browser/intellinux/nppdf.so .
cd .mozilla/firefox
rm pluginreg.dat
su -
yum -y install xine xine-lib xine-skins
su
mkdir temp
mv *.bz2 temp
cd temp
tar xvfj *.tar.bz2
cd all-20050412
mkdir /usr/local/lib/codecs/
cp * /usr/local/lib/codecs/
cd /usr/local/lib/codecs/
chmod 755 /usr/local/lib/codecs/*
mkdir /usr/lib/win32
cp /usr/local/lib/codecs/* /usr/lib/win32
rm -rf /home/your_user_name/temp
su -
yum -y install mplayer mplayer-skins mplayer-fonts
gmplayer
gmplayer
su
rpm -Uvh *.rpm
rm *.rpm
su -
yum -y install xmms xmms-mp3
su -
yum -y install bmp bmp-mp3
su -
yum -y install videolan-client
su -
yum -y install amarok
su -
yum -y install bittorrent
yum -y install bittorrent-gui
/sbin/iptables -I INPUT -p tcp --destination-port 6881:6999 -j ACCEPT
/sbin/iptables-save > /etc/sysconfig/iptables
/sbin/iptables -L
su -
/sbin/iptables -I INPUT -p tcp --destination-port 6881:6999 -j ACCEPT
/sbin/iptables-save > /etc/sysconfig/iptables
/sbin/iptables -I INPUT -p udp --destination-port 18352:18352 -j ACCEPT
/sbin/iptables-save > /etc/sysconfig/iptables
/sbin/iptables -L
tar xvfj *.tar.bz2
rm *.bz2
cd azureus
./azureus
su
unzip -u LimeWireOther.zip -d /opt/
rm LimeWireOther.zip
chown -R root:root /opt/LimeWire/
su -
gedit /usr/bin/limewire.sh
cd /opt/LimeWire/ ./runLime.sh
chmod +x /usr/bin/limewire.sh
gedit /usr/share/applications/LimeWire.desktop
[Desktop Entry] Name=LimeWire Comment=LimeWire Exec=limewire.sh Icon=/opt/LimeWire/LimeWire.ico Terminal=false Type=Application Categories=Application;Network;
su
uname -rm
rpm -Uvh *.rpm
rm *.rpm
su -
mkdir /mnt/windows
/sbin/fdisk -l
gedit /etc/fstab
/dev/hda1 /mnt/windows ntfs ro,defaults,umask=0222 0 0
su -
gedit /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 67.172.236.37 stantonfinley.org stantonfinley
gedit /etc/sysconfig/network
NETWORKING=yes HOSTNAME=stantonfinley.org
gedit /etc/httpd/conf/httpd.conf
gedit /etc/httpd/conf/httpd.conf
拉到 "#ServerName" 部分去掉注释(去掉 "#"). 然后输入注册的 DNS ("whatever.com") 或者你的服务器IP来代替"www.example.com"
拉到并改变 "UseCanonicalName Off" 为 "UseCanonicalName On".
拉到 "Options"行并改变 "Options Indexes FollowSymLinks" 为 "Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews".
在你想在子目录中使用.htaccess文件的情况下改变 "AllowOverride None" 为 "AllowOverride Options FileInfo AuthConfig Limit"
改变 "DirectoryIndex index.html index.html.var" 为 "DirectoryIndex index.html index.html.var index.shtml index.cgi index.php index.phtml index.php3 index.htm home.html welcome.html".
在"AddType application/x-compress .Z" 和 "AddType application/x-gzip .gz .tgz" 行添加行: "AddType application/x-httpd-php .php .phps .php3 .phtml .html .htm .shtml .fds".
去除 "#AddHandler cgi-script .cgi"的注释并加上 ".pl"成为"AddHandler cgi-script .cgi .pl".
如果你想要为用户的home目录下也提供网页服务,注释掉 (在前面加一个 "#") "UserDir disable" 成为 "#UserDir disable"并去除"#UserDir public_html"的注释成为"UserDir public_html". 然后去除注释并编辑用户home目录的进入控制,类似
<Directory /home/*/public_html>
AllowOverride Options FileInfo AuthConfig Limit
Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Allow from all
</LimitExcept>
</Directory>
mkdir public_html
chmod -R 755 public_html
su -
cd /home
chmod 711 your_user_name
chcon -R -t httpd_user_content_t /home/your_user_name/public_html/
su -
gedit /etc/vsftpd/vsftpd.conf
并在"#chroot_list_file=/etc/vsftpd/chroot_list"下加入一行"chroot_local_user=YES".
去掉 ascii_ lines的注释成为 "ascii_upload_enable=YES" and "ascii_download_enable=YES".
保存,退出。su -
gedit /var/www/html/phpinfo.php
<?php phpinfo();?>
gedit /var/www/html/printenv.pl
#!/usr/bin/perl
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
chmod 755 /var/www/html/printenv.pl
chmod 755 /var/www/html/phpinfo.php
你的 /etc/php.ini 文件使用sendmail作为PHP程序的默认的传输代理来发送email("sendmail_path = /usr/sbin/sendmail -t -i").
如果你还没做,那就编辑 "/etc/hosts",加入"your.ip.address whatever.org whatever" ,其中 "your.ip.address" 是你的网页服务器的地址, "whatever.org" 你注册的域名, "whatever" 你的短域名(点前面的字符). 把IP地质和域名用两个tab分开
编辑 "/etc/sysconfig/network" ,改变 "localhost.localdomain" 为 "whatever.org" , "whatever.org" 是你注册的域名,从启
编辑 "/etc/mail/local-host-names" 包含的你的域名。
编辑 "/etc/mail/sendmail.mc" ,修改 "dnl define(`SMART_HOST',`smtp.your.provider')dnl" 为 "define(`SMART_HOST',`smtp.your.provider')dnl" ,其中 "smtp.your.provider" 是你的smtp主机,你通过email客户端用它来发送email。
修改 "DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl" 为 "dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl".
修改 "dnl MASQUERADE_AS(`mydomain.com')dnl" 为 "MASQUERADE_AS(`your.provider.com')dnl" where "your.provider.com" is the host that you use to send mail from your email client (the characters after the "@").
添加 ( 添加到/etc/mail/sendmail.mc文件底部,"MAILER"以上): "FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl" and "GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl".
如果需要编辑或创建: "/etc/mail/generics-domains". 在 "/etc/mail/generics-domains"里定义你的域名.
如果需要编辑或创建: "/etc/mail/genericstable". 在 "/etc/mail/genericstable"里的 "username mailusername@your.provider.com"行的"username"是你的非root用户名,"mailusername@your.provider.com"是你的email地址。
运行命令: "make -C /etc/mail". 这会更新 "/etc/mail/sendmail.cf".
运行 "yum -y install sendmail-cf".
从启或开启 sendmail ,通过 "System" > "Administration" > "Server Settings" > "Services".
(看 http://www.linuxhomenetworking.com/linux-hn/sendmail.htm.)
su -
gedit /etc/my.cnf
skip-innodb
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 skip-innodb [mysql.server] user=mysql basedir=/var/lib [mysqld_safe] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
mysql -u root
select user, host, password, select_priv, update_priv, delete_priv, insert_priv from mysql.user;
+------+------------------------+----------+-------------+-------------+-------------+-------------+ | user | host | password | select_priv | update_priv | delete_priv | insert_priv | +------+------------------------+----------+-------------+-------------+-------------+-------------+ | root | localhost | | Y | Y | Y | Y | | root | stantonfinley.org | | Y | Y | Y | Y | | | localhost | | N | N | N | N | | | stantonfinley.org | | N | N | N | N | +------+------------------------+----------+-------------+-------------+-------------+-------------+ 4 rows in set (0.17 sec) mysql>
set password for 'root'@'localhost' = password ('newpassword');
set password for 'root'@'host' = password ('newpassword');
select user, host, password, select_priv, update_priv, delete_priv, insert_priv from mysql.user;
+------+------------------------+------------------+-------------+-------------+-------------+-------------+ | user | host | password | select_priv | update_priv | delete_priv | insert_priv | +------+------------------------+------------------+-------------+-------------+-------------+-------------+ | root | localhost | 1e36745e3c0f99b0 | Y | Y | Y | Y | | root | stantonfinley.org | 1e36745e3c0f99b0 | Y | Y | Y | Y | | | localhost | | N | N | N | N | | | stantonfinley.org | | N | N | N | N | +------+------------------------+------------------+-------------+-------------+-------------+-------------+ 4 rows in set (0.00 sec) mysql>
exit
su -
mysql -u root -p
exit
su
mv *.tar.bz2 /var/www/html
cd /var/www/html
bzip2 -dc *.tar.bz2 | tar -xvf -
rm *.tar.bz2
mv phpMyAdmin-2.8.0.2 phpmyadmin
su -
gedit /var/www/html/phpmyadmin/config.default.php
修改 "$cfg['blowfish_secret'] = ''; 为 "$cfg['blowfish_secret'] = 'passphrase';" ,其中 "passphrase"任意的字符,当你用cookie鉴定方法时blowfish运算法则要用它来加密你的口令
在 "Server(s) configuration"下边修改 "$cfg['Servers'][$i]['auth_type'] = 'config';" 为 "$cfg['Servers'][$i]['auth_type'] = 'cookie';".
单击 "File" > "Save as.." ,保存为"config.inc.php".
运行"yum -y install php-mbstring". 从启。
浏览 http://whatever.com/phpmyadmin/ ( "whatever.com"你的网站). 在 "Username:"输入"root",在"Password:"输入mysql root用户的口令,单击 "Login" . 你会看到 " Welcome to phpMyAdmin" 页面. 打开一个终端
su -
mysql -u root -p
GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapassword';
GRANT SELECT (
Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
Execute_priv, Repl_slave_priv, Repl_client_priv
) ON mysql.user TO 'pma'@'localhost';
GRANT SELECT ON mysql.db TO 'pma'@'localhost';
GRANT SELECT ON mysql.host TO 'pma'@'localhost';
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
ON mysql.tables_priv TO 'pma'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
gedit /var/www/html/phpmyadmin/config.inc.php
修改 "$cfg['Servers'][$i]['controlpass'] = '';" 为 "$cfg['Servers'][$i]['controlpass'] = 'pmapassword';" ,其中 "pmapassword" 是pma用户的密码
修改 "$cfg['Servers'][$i]['pmadb'] = '';" 为 "$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';".
修改 "$cfg['Servers'][$i]['bookmarktable'] = '';" 为 "$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';".
修改 "$cfg['Servers'][$i]['relation'] = '';" 为 "$cfg['Servers'][$i]['relation'] = 'pma_relation';".
修改 "$cfg['Servers'][$i]['table_info'] = '';" 为 "$cfg['Servers'][$i]['table_info'] = 'pma_table_info';".
修改 "$cfg['Servers'][$i]['table_coords'] = '';" 为 "$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';".
修改 "$cfg['Servers'][$i]['pdf_pages'] = '';" 为 "$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';".
修改 "$cfg['Servers'][$i]['column_info'] = '';" 为 "$cfg['Servers'][$i]['column_info'] = 'pma_column_info';".
修改 "$cfg['Servers'][$i]['history'] = '';" 为 "$cfg['Servers'][$i]['history'] = 'pma_history';".
保存, 用 Firefox 浏览 http://whatever.com/phpmyadmin/ ,其总 "whatever.com" 是你的域名或IP.以root身份登陆 phpMyAdmin . 进入 "Database:" 你可以看到 "mysql", "phpmyadmin", 和 "test" 的数据库列表, 你已经成功的配置好 phpMyAdmin 了.
